feat: redesign Todos tab — grouping, collapsible headers, cleaned columns
Implements the approved mockup from the UX debate report:
- new DisplayRow::TodoHeader variant: collapsible group headers, toggled
by Enter/Space, tracked in HubState.todo_group_collapsed
- [g] cycles grouping: status (default) -> project -> repo -> none
- [s] cycles which statuses are included before grouping: active
(open+in-progress, default) -> open -> done -> all
- table: dropped SRC/EST (near-always empty), code-scan todos show a dim
'no status icon' marker instead of a separate source column, project
name colored by the project's own color (was DarkGray, wasting the most
useful visual identifier in the tool), age now tracks updated_at not
created_at ('what's moving' beats 'what's old')
- right panel: added Repo/Difficulty/Estimate, previously only visible in
the table despite the panel having more room for them
- block title shows live counts + current view/group/code-scan state
Simplified vs. the literal ASCII mockup: [s] filters the underlying set
before grouping, so e.g. the default 'active' view omits Done/Cancelled
groups entirely rather than always showing them collapsed - a simpler,
more internally consistent model. Flagged for foksiu to request the exact
mockup behavior if he wants it.
Verified via pyte: group/status-view cycling, collapse/expand (arrow flips
and child rows appear/disappear), right panel on header vs. todo row.
This commit is contained in:
1 parent
3eb922559c
commit
6adc22d665
10 files changed
+288
-61
No files matched your search
+15
-3
@@ -60,10 +60,13 @@ pub static HELP_LINES: &[&str] = &[
|
||||
" p Project menu (create / assign / rename / delete)",
|
||||
" + New todo",
|
||||
" e Edit todo (Todos tab)",
|
||||
" Space (Todos tab) Cycle todo status",
|
||||
" Space (Todos tab) Cycle todo status, or expand/collapse a group",
|
||||
" Enter (Todos tab) Expand/collapse a group header",
|
||||
" s (Todos tab) Cycle status view: active → open → done → all",
|
||||
" g (Todos tab) Cycle grouping: status → project → repo → none",
|
||||
" c / X (Todos tab) Toggle code-scan todos",
|
||||
" D / Del Delete todo or project",
|
||||
" T Scan repos for TODO/FIXME/HACK → import to Todos",
|
||||
" X (Todos tab) Toggle code-scan todos",
|
||||
"",
|
||||
"── Help ──────────────────────────────────────",
|
||||
" ? Show this help",
|
||||
@@ -165,7 +168,16 @@ pub fn render_hub(f: &mut Frame, state: &mut HubState) {
|
||||
.constraints([Constraint::Percentage(73), Constraint::Percentage(27)])
|
||||
.split(outer[1]);
|
||||
|
||||
let left_blk = Block::default().borders(Borders::ALL);
|
||||
let mut left_blk = Block::default().borders(Borders::ALL);
|
||||
if state.tab == Tab::Todos {
|
||||
let in_progress = state.todos.iter().filter(|t| t.status == crate::todos::TodoStatus::InProgress).count();
|
||||
let open = state.todos.iter().filter(|t| t.status == crate::todos::TodoStatus::Open).count();
|
||||
left_blk = left_blk.title(format!(
|
||||
" todos · {} in progress · {} open · [s]tatus:{} · [g]roup:{} · [c]ode-scan:{} ",
|
||||
in_progress, open, state.todo_status_view.label(), state.todo_group_by.label(),
|
||||
if state.show_code_todos { "on" } else { "off" },
|
||||
));
|
||||
}
|
||||
let left_inner = left_blk.inner(cols[0]);
|
||||
f.render_widget(left_blk, cols[0]);
|
||||
state.visible_rows = left_inner.height.saturating_sub(1) as usize;
|
||||
|
||||
Reference in new issue
Block a user