You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The v1 PRD (#1, user story 10) calls for sortable ordering by size, age, last
updated, and priority. The Rust TUI has no user-facing sort: within a Smart-status group PRs keep their pooled input order, and Grouping::None is
a flat list in that same order (src/app/grouping.rs — smart_status_rows
"preserving input order within each tier"; grouped_rows only sorts group keys
alphabetically). There is no key to reorder PRs by any column.
Approach
Add a sort dimension applied to PRs within each group (and globally under Grouping::None), independent of the grouping/tier order:
Sort keys: age (created), updated (last activity), size
(additions+deletions, ideally code-only via the File Category breakdown
when enrichment is present), and priority (Tier order).
A keybinding to cycle the active sort key, and one to flip direction, with the
active sort surfaced in the status bar / a chip (mirror the Substring
Filter chip pattern in src/view.rs).
Sorting composes with grouping: it orders members inside each group; tier/group
ordering itself is unchanged. PRs still loading enrichment (no tier/size yet)
sort last within their bucket rather than jumping around as data streams in.
Persist the default sort key/direction in config (ui block, src/config.rs), matching how grouping defaults are handled.
Keep the ordering a pure function over the visible-index list so it is
table-test friendly, consistent with src/app/grouping.rs.
Open Questions
Which keys? g is taken by the grouping cycle; s for sort-key cycle and S
for direction is the obvious pairing, but confirm no conflict with existing
bindings.
Should size use total churn or code-only churn by default? Code-only matches
the PRD's "real change size vs. noise" intent (stories 21-23).
Acceptance Criteria
A keybinding cycles the sort key (age / updated / size / priority) and a
modifier/second key flips direction.
The active sort key + direction is visible in the UI.
Sorting reorders PRs within each group and across the flat list, leaving
group/tier ordering intact.
PRs without the data a sort key needs sort deterministically (last) rather
than reordering as enrichment arrives.
Default sort persists via config.
Pure ordering function with table-driven tests covering each key, both
directions, missing-data, and ties.
Problem
The v1 PRD (#1, user story 10) calls for sortable ordering by size, age, last
updated, and priority. The Rust TUI has no user-facing sort: within a
Smart-status group PRs keep their pooled input order, and
Grouping::Noneisa flat list in that same order (
src/app/grouping.rs—smart_status_rows"preserving input order within each tier";
grouped_rowsonly sorts group keysalphabetically). There is no key to reorder PRs by any column.
Approach
Add a sort dimension applied to PRs within each group (and globally under
Grouping::None), independent of the grouping/tier order:age(created),updated(last activity),size(additions+deletions, ideally code-only via the File Category breakdown
when enrichment is present), and
priority(Tier order).active sort surfaced in the status bar / a chip (mirror the Substring
Filter chip pattern in
src/view.rs).ordering itself is unchanged. PRs still loading enrichment (no tier/size yet)
sort last within their bucket rather than jumping around as data streams in.
uiblock,src/config.rs), matching how grouping defaults are handled.Keep the ordering a pure function over the visible-index list so it is
table-test friendly, consistent with
src/app/grouping.rs.Open Questions
gis taken by the grouping cycle;sfor sort-key cycle andSfor direction is the obvious pairing, but confirm no conflict with existing
bindings.
sizeuse total churn or code-only churn by default? Code-only matchesthe PRD's "real change size vs. noise" intent (stories 21-23).
Acceptance Criteria
modifier/second key flips direction.
group/tier ordering intact.
than reordering as enrichment arrives.
directions, missing-data, and ties.
References
src/app/grouping.rs,src/config.rs(ui),src/view.rs(filter chip),CONTEXT.md — Smart-status, Tier, File Category.