feat: rename categories from views and selectors

This commit is contained in:
2026-10-11 23:10:15 +02:00
parent aa66ac9d7f
commit ff7590dfa7
4 changed files with 1065 additions and 19 deletions
+22 -3
View File
@@ -22,6 +22,7 @@ pub enum Context {
TagList,
TagFilter,
TagInput,
RenameInput,
Help,
}
@@ -38,6 +39,7 @@ const ALL: &[Context] = &[
Context::TagList,
Context::TagFilter,
Context::TagInput,
Context::RenameInput,
Context::Help,
];
const VIEW: &[Context] = &[
@@ -58,6 +60,7 @@ const TEXT: &[Context] = &[
Context::SelectorInput,
Context::TagFilter,
Context::TagInput,
Context::RenameInput,
];
const NON_TEXT: &[Context] = &[
Context::Normal,
@@ -102,7 +105,7 @@ actions! {
Interrupt, "app.interrupt", "Exit immediately", ALL, ["ctrl+c"];
Quit, "app.quit", "Quit the application", &[Context::Normal, Context::Info, Context::Description, Context::CollectionNormal, Context::CollectionInfo, Context::CollectionDescription, Context::Help], ["q"];
Help, "help.toggle", "Open or close keyboard help", NON_TEXT, ["?"];
InputSubmit, "input.submit", "Submit search, browse selector, leave tag filter or stage new tag", TEXT, ["enter"];
InputSubmit, "input.submit", "Submit search, browse selector, leave tag filter, stage new tag or rename category", TEXT, ["enter"];
InputCancel, "input.cancel", "Leave text input without submitting", TEXT, ["escape"];
DeleteCharacter, "input.delete.character", "Delete the previous character", TEXT, ["backspace"];
DeleteWord, "input.delete.word", "Delete the previous word", TEXT, ["alt+backspace", "ctrl+w"];
@@ -126,6 +129,7 @@ actions! {
VideoChannel, "video.channel", "Open the selected video's channel", VIEW, ["U"];
ChannelTags, "channel.tags", "Edit the selected channel's category tags", VIEW, ["s"];
CategoryTags, "category.tags", "Edit category tags for all channels in this category", VIEW, ["S"];
CategoryRename, "category.rename", "Rename the current or selected category", &[Context::Normal, Context::CollectionNormal, Context::SelectorNormal, Context::TagList], ["R"];
WatchLaterSave, "video.watch_later.save", "Save the selected video to watch later", VIEW, ["w"];
WatchLaterBrowse, "view.watch_later.browse", "Choose watch later across all categories or one category", VIEW, ["W"];
WatchLaterBrowseCategory, "view.watch_later.category", "Browse the current category's watch later", VIEW, ["alt+w"];
@@ -478,6 +482,10 @@ impl Bindings {
(&[CategoryBrowse], "Choose a saved category"),
(&[ChannelTags], "Edit the selected channel's tags"),
(&[CategoryTags], "Edit all channels in a category"),
(
&[CategoryRename],
"Rename the current category (including scoped collections)",
),
(&[ViewTabNext, ViewTabPrevious], "Cycle visible tabs"),
(&[ViewPrevious], "Back (preview close takes priority)"),
(&[ViewNext], "Forward after going back"),
@@ -568,6 +576,10 @@ impl Bindings {
&[SelectorPin],
"Pin / unpin a category (category picker only)",
),
(
&[CategoryRename],
"Rename the selected category, not combined / channel rows",
),
(&[InputCancel, SelectorClose], "INSERT → NORMAL → close"),
],
),
@@ -583,6 +595,10 @@ impl Bindings {
),
(&[TagToggle], "Toggle a tag"),
(&[TagNew], "Enter a new tag name"),
(
&[CategoryRename],
"Rename a tag; existing category renames save immediately",
),
(&[TagSave], "Save tags"),
(&[InputSubmit], "Stage a new tag name"),
(&[TagCancel], "Cancel tag changes"),
@@ -592,8 +608,11 @@ impl Bindings {
(
"TEXT INPUT",
&[
(&[InputSubmit], "Submit; search returns to NORMAL"),
(&[InputCancel], "Leave INSERT / abandon tag name"),
(
&[InputSubmit],
"Submit search / stage tag / commit category rename",
),
(&[InputCancel], "Leave INSERT / abandon tag name or rename"),
(&[DeleteCharacter], "Delete one character"),
(&[DeleteWord], "Delete previous word"),
(&[DeleteLine], "Clear the line"),