Skip to content

[Repo Assist] feat(ui): make help overlay scrollable#176

Draft
github-actions[bot] wants to merge 1 commit intomainfrom
repo-assist/improve-scrollable-help-2026-05-03-9763dc877a2248ba
Draft

[Repo Assist] feat(ui): make help overlay scrollable#176
github-actions[bot] wants to merge 1 commit intomainfrom
repo-assist/improve-scrollable-help-2026-05-03-9763dc877a2248ba

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented May 3, 2026

🤖 This PR was created by Repo Assist, an automated AI assistant.

What

Makes the ? help overlay scrollable so all keybindings are accessible
on any terminal size.

Before: The help text (36 lines) was rendered as a static
Paragraph with no scroll support. On a typical 24-row terminal the
centered_rect(60, 70, ...) overlay is only ~17 rows of content — roughly
half the keybindings were silently clipped below the bottom border.

After: ↑ ↓ PgUp PgDn Home End (and j/k vim aliases) scroll
the help overlay. A scrollbar appears on the right edge when the content
overflows. The title shows ↑↓ to scroll as a discoverability hint.
Closing the overlay (? or Esc) resets the scroll position to the top.

Why

This is a real usability bug: users on compact terminals (e.g. 24-row
VS Code integrated terminal) could never see the Mouse section or the
General section at the bottom of the help. The fix uses only existing
Ratatui primitives — no new dependencies.

Changes

File Change
src/app.rs help_scroll: u16 + help_max_scroll: u16 fields; initialised to 0
src/handler.rs New handle_help_input() function; called from handle_events when show_help is true
src/ui.rs draw_help_overlay now takes &mut App; uses .scroll((app.help_scroll, 0)); renders a Scrollbar when content overflows; title updated

Keybindings inside the overlay

Key Action
/ k Scroll up one line
/ j Scroll down one line
PgUp Scroll up 10 lines
PgDn Scroll down 10 lines
Home Jump to top
End Jump to bottom
? / Esc Close overlay (scroll resets to top)

Test Status

cargo check --all-targets  → clean
cargo fmt -- --check       → clean
cargo clippy -- -D warnings → clean
cargo test                 → 238 passed (was 231) — 7 new tests:
  help_scroll_starts_at_zero
  help_scroll_down_increments_within_max
  help_scroll_down_clamped_at_max
  help_scroll_up_saturates_at_zero
  help_scroll_home_resets_to_zero
  help_scroll_end_jumps_to_max
  help_close_resets_scroll

Generated by Repo Assist · ● 7.9M ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@cbb46ab386962aa371045839fc9998ee4e97ca64

The help overlay previously rendered all keybinding lines as a static
Paragraph with no scroll support. On a typical 24-row terminal the
overlay is ~17 rows tall (70% of height), but the help text has 36
lines — roughly half the content was silently clipped.

Changes:
- Add help_scroll (u16) and help_max_scroll (u16) to App state
- Extract handle_help_input() from the inline match in handle_events()
  so the scroll logic is testable in isolation
- help_scroll resets to 0 when the overlay is closed
- help_max_scroll is computed each render frame from the area height
  and total line count; current scroll is clamped on resize
- Title updated to '… ↑↓ to scroll' to hint at the new capability
- Vertical scrollbar rendered when content exceeds visible height
- 7 new unit tests: initial state, down/clamp, up/saturate,
  Home, End, and close-resets-scroll (231 → 238)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants