Skip to content

Trim helper text for navigating and add leaked shortcut and UI trimming#50

Merged
subinium merged 7 commits into
subinium:mainfrom
soomtong:shortcuts
Jun 11, 2026
Merged

Trim helper text for navigating and add leaked shortcut and UI trimming#50
subinium merged 7 commits into
subinium:mainfrom
soomtong:shortcuts

Conversation

@soomtong

@soomtong soomtong commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

We will improve some of the text in the screen and adjust the margin when the list navigation cursor moves to the bottom.

  • Fix Ctrl+H leaking into fuzzy search textarea
  • Add Ctrl+L navigation to grouped browse for previewing selected session
  • Add Ctrl+P/N navigation to help screen for consistency with other modes
  • Clarify summary cycle key label from [ / ] to [ or ] to avoid / key confusion
  • Colorize [ or ] summary key in help screen
  • Make session summary navigation wrap around (true cycle)
  • Keep margin navigate to bottom edge

…rl+P/N to help, and clarify summary key label
soomtong and others added 3 commits June 2, 2026 20:48
- (selected + margin + 1).saturating_sub(visible) at all three scroll
  sites (browse, grouped, watch): the margin branch can fire while
  selected < visible, where the previous form underflowed usize and
  panicked in debug builds
- clamp grouped/watch scroll offsets to list end the way adjust_scroll
  already does, so the margin cannot leave blank rows at the bottom
- collapse the Ctrl+L if-let per clippy::collapsible_match and return
  after switching to Preview, matching the Esc handler above it
- cargo fmt over the touched regions; add scroll-margin regression tests

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@subinium

Copy link
Copy Markdown
Owner

Thanks @soomtong — the margin-on-scroll and the leak fixes are keepers, and the wrap-around summary cycle matches what the help screen always implied. I pushed one fixup commit (d623f0c) to your branch so this can land as-is:

  • Debug-build panic: the new selected - visible + 1 + margin can fire while selected < visible (viewport 10, margin 3 → triggers at row 7), which underflows usize — reproduced attempt to subtract with overflow in a debug build. Rewrote all three sites (browse / grouped / watch) as (selected + margin + 1).saturating_sub(visible); release behavior is identical.
  • Overscroll clamp: grouped browse and agf watch lacked the max_offset clamp that adjust_scroll has, so the margin could leave up to 3 blank rows at the end of the list. Added the same clamp to both.
  • Gates: clippy::collapsible_match on the Ctrl+L block (collapsed to Some((gi, Some(ci))), plus an early return to match the Esc handler), and cargo fmt over the new lines — these were the CI Format/Clippy failures.
  • Added regression tests pinning the three scroll behaviors (no-underflow, margin honored, end clamp).

Will merge once CI is green.

@subinium subinium merged commit dffc847 into subinium:main Jun 11, 2026
5 checks passed
@soomtong soomtong deleted the shortcuts branch June 11, 2026 01:38
@subinium subinium mentioned this pull request Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants