feat: Add reusable modal and task detail view
Split the task detail modal into its own view and add a generic modal frame, plus new models and service mapping for task details. Update app layout, keymaps, and sidebar focus events to support the modal and keyboard flow, with small UI tweaks like wrapping and scroll handling.
This commit is contained in:
1 parent
87ecec7f67
commit
1693655e47
16 files changed
+1453
-645
No files matched your search
@@ -25,6 +25,8 @@ pub enum Command {
|
||||
// Modal
|
||||
CloseModal,
|
||||
SaveModal,
|
||||
ModalScrollUp,
|
||||
ModalScrollDown,
|
||||
|
||||
// Filter
|
||||
ApplySearch,
|
||||
@@ -70,6 +72,8 @@ impl Command {
|
||||
"BlurInput" => Some(Self::BlurInput),
|
||||
"CloseModal" => Some(Self::CloseModal),
|
||||
"SaveModal" => Some(Self::SaveModal),
|
||||
"ModalScrollUp" => Some(Self::ModalScrollUp),
|
||||
"ModalScrollDown" => Some(Self::ModalScrollDown),
|
||||
"ApplySearch" => Some(Self::ApplySearch),
|
||||
"ClearFilters" => Some(Self::ClearFilters),
|
||||
"ClearAllFilters" => Some(Self::ClearAllFilters),
|
||||
@@ -110,6 +114,8 @@ impl Command {
|
||||
Self::BlurInput => "BlurInput",
|
||||
Self::CloseModal => "CloseModal",
|
||||
Self::SaveModal => "SaveModal",
|
||||
Self::ModalScrollUp => "ModalScrollUp",
|
||||
Self::ModalScrollDown => "ModalScrollDown",
|
||||
Self::ApplySearch => "ApplySearch",
|
||||
Self::ClearFilters => "ClearFilters",
|
||||
Self::ClearAllFilters => "ClearAllFilters",
|
||||
|
||||
@@ -403,6 +403,26 @@ pub fn build_default_keymap() -> KeymapLayer {
|
||||
KeyChord::new(Key::Escape, Mods::none()),
|
||||
Command::CloseModal,
|
||||
);
|
||||
layer.bind(
|
||||
ContextId::Modal,
|
||||
KeyChord::new(Key::Char('j'), Mods::none()),
|
||||
Command::ModalScrollDown,
|
||||
);
|
||||
layer.bind(
|
||||
ContextId::Modal,
|
||||
KeyChord::new(Key::Char('k'), Mods::none()),
|
||||
Command::ModalScrollUp,
|
||||
);
|
||||
layer.bind(
|
||||
ContextId::Modal,
|
||||
KeyChord::new(Key::ArrowDown, Mods::none()),
|
||||
Command::ModalScrollDown,
|
||||
);
|
||||
layer.bind(
|
||||
ContextId::Modal,
|
||||
KeyChord::new(Key::ArrowUp, Mods::none()),
|
||||
Command::ModalScrollUp,
|
||||
);
|
||||
layer.bind(
|
||||
ContextId::Modal,
|
||||
KeyChord::new(Key::Enter, Mods::ctrl()),
|
||||
|
||||
Reference in new issue
Block a user