use crate::domain::filter::{Tab, TabKind};
use crate::keymap::Action;
const SECTIONS_GROUP: (&str, &[Action]) = (
"Sections",
&[
Action::ManageSections,
Action::SectionJump,
Action::ToggleGrouping,
Action::ReorderUp,
Action::ReorderDown,
],
);
const VIEW_GROUP: (&str, &[Action]) = (
"View",
&[
Action::ToggleSelect,
Action::Filter,
Action::ChangesFilter,
Action::Columns,
Action::Sort,
Action::ToggleFavFloat,
Action::ToggleSlugs,
Action::CopyPath,
Action::Github,
],
);
const PANEL_GROUP: (&str, &[Action]) = (
"Panel",
&[
Action::Preview,
Action::PreviewPosition,
Action::PreviewScrollUp,
Action::PreviewGrow,
],
);
const GIT_HINT_GROUPS: &[(&str, &[Action])] = &[
(
"Open",
&[
Action::Jump,
Action::Open,
Action::GitTool,
Action::JumpCd,
Action::OpenApp,
],
),
(
"Manage",
&[
Action::Add,
Action::Edit,
Action::Delete,
Action::ToggleFav,
Action::Archive,
Action::Slug,
Action::Undo,
],
),
("Backup", &[Action::Zip, Action::ZipAll]),
VIEW_GROUP,
PANEL_GROUP,
SECTIONS_GROUP,
(
"Git",
&[
Action::Reload,
Action::ReloadFetch,
Action::RefreshOne,
Action::RefreshOneFetch,
Action::RepairPath,
Action::Errors,
],
),
];
const FILES_HINT_GROUPS: &[(&str, &[Action])] = &[
(
"Open",
&[Action::Jump, Action::Open, Action::JumpCd, Action::OpenApp],
),
(
"Manage",
&[
Action::Add,
Action::Edit,
Action::Delete,
Action::ToggleFav,
Action::Archive,
Action::Slug,
Action::Undo,
],
),
("Backup", &[Action::Zip, Action::ZipAll]),
VIEW_GROUP,
PANEL_GROUP,
SECTIONS_GROUP,
(
"Paths",
&[Action::Reload, Action::RepairPath, Action::Errors],
),
];
pub fn hint_groups(tab: Tab) -> &'static [(&'static str, &'static [Action])] {
match tab.kind() {
TabKind::Git => GIT_HINT_GROUPS,
TabKind::Files => FILES_HINT_GROUPS,
}
}