feat: discard playback selection with Escape

This commit is contained in:
2026-10-22 15:27:19 +02:00
parent b67a3d38c6
commit 01275e20b8
5 changed files with 40 additions and 21 deletions
+3 -3
View File
@@ -114,7 +114,7 @@ actions! {
SearchEdit, "search.edit", "Edit general or current-category search", VIEW, ["i"];
ViewSearch, "view.search", "Go to general YouTube Search", VIEW, ["/"];
ViewFeed, "view.feed", "Go to the combined subscription Feed", VIEW, ["F"];
ViewPrevious, "view.history.previous", "Go back in view history", VIEW, ["-", "escape"];
ViewPrevious, "view.history.previous", "Go back in view history", VIEW, ["-"];
ViewNext, "view.history.next", "Go forward in view history", VIEW, ["+"];
ViewTabNext, "view.tab.next", "Select the next view tab", VIEW, ["tab", "ctrl+tab"];
ViewTabPrevious, "view.tab.previous", "Select the previous view tab", VIEW, ["shift+tab"];
@@ -126,7 +126,7 @@ actions! {
VideoFirst, "video.select.first", "Select the first video", VIEW, ["g", "home"];
VideoLast, "video.select.last", "Select the last video", VIEW, ["G", "end"];
VideoToggle, "video.select.toggle", "Toggle the selected video's playback check", VIEW, ["space"];
VideoClear, "video.select.clear", "Clear playback checks in the current view", VIEW, ["ctrl+space"];
VideoClear, "video.select.clear", "Discard playback checks in the current view", VIEW, ["escape", "ctrl+space"];
InfoOverview, "video.info.overview", "Show the video overview", VIEW, ["d"];
InfoDescription, "video.info.description", "Show the video description", VIEW, ["d"];
InfoHide, "video.info.hide", "Close the video preview", &[Context::Info, Context::Description, Context::CollectionInfo, Context::CollectionDescription], ["escape"];
@@ -782,7 +782,7 @@ fn overlap_winner(context: Context, first: Action, second: Action) -> Option<Act
},
);
}
if pair(InfoHide, ViewPrevious)
if (pair(InfoHide, ViewPrevious) || pair(InfoHide, VideoClear))
&& matches!(
context,
Context::Info
+4 -7
View File
File diff suppressed because one or more lines are too long
+6 -2
View File
@@ -1573,7 +1573,7 @@ impl Browser {
fn markers(&self, id: &str) -> String {
let mut markers = String::new();
for (present, label) in [
(self.state.is_watched(id), "✓ watched"),
(self.state.is_watched(id), "watched"),
(
self.state.contains(CollectionKind::WatchLater, id),
"watch later",
@@ -1660,7 +1660,11 @@ impl Browser {
.is_some_and(|id| self.screen().checked.contains(id))
{
"* "
} else if row.key.as_deref().is_some_and(|id| self.state.is_watched(id)) {
} else if row
.key
.as_deref()
.is_some_and(|id| self.state.is_watched(id))
{
"✓ "
} else {
" "