refactor: extract FormNav trait, unify form key handling, decentralize view titles and hints

This commit is contained in:
2026-05-27 02:09:44 +08:00
parent d3bd4af634
commit 0d65be65d3
16 changed files with 238 additions and 316 deletions
+11
View File
@@ -16,6 +16,17 @@ use ratatui::{
pub struct ImportView;
impl View for ImportView {
fn title(&self) -> &'static str { "Import" }
fn hints(&self) -> Vec<(&'static str, &'static str)> {
vec![
("j/k", "move"),
("Space", "toggle"),
("a/A", "all/none"),
("Enter", "import"),
("Esc", "cancel"),
]
}
fn draw(&self, frame: &mut Frame<'_>, app: &App, area: Rect) {
draw_import(frame, app, area);
}