Skip to content

fix(tui): keep shortcuts overlay on screen and make it scrollable - #1865

Open
puri-adityakumar wants to merge 1 commit into
Nano-Collective:mainfrom
puri-adityakumar:fix/1813-shortcuts-overlay-scroll
Open

puri-adityakumar wants to merge 1 commit into
Nano-Collective:mainfrom
puri-adityakumar:fix/1813-shortcuts-overlay-scroll

Conversation

@puri-adityakumar

@puri-adityakumar puri-adityakumar commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Description

Closes #1813.

On short terminals, the ? shortcuts overlay ran off the bottom of the screen, cutting off the lower entries, the close hint, and the bottom border.

  1. Cap the visible list to the terminal height (SHORTCUTS_OVERHEAD_ROWS = 11 in user-input.tsx, leaving one spare row so Ink doesn't clear and redraw the full inline chat on every keypress) and scroll with Up/Down or PgUp/PgDn.
  2. Keep each shortcut on one line (wrap="truncate-end") so narrow terminals don't wrap rows and overflow the height budget.
  3. Report open and close from UserInput via onShortcutsOverlayChange (including on unmount) so ChatInput and InteractiveApp hide the live task list and other footer rows while the overlay is open.
  4. Pause chat transcript scrolling (scrollActive) while the overlay is open so PgUp/PgDn only move the overlay.
Before (60x18) After (60x18)
Before at 60x18 After at 60x18

Type of Change

  • Bug fix

Changeset

  • Added a patch changeset

Testing

  • New tests in user-input.spec.tsx (18-row fit, 60-col single-line truncation, arrow/page scrolling, resize clamping, tall terminal, and open/close callback on unmount) and interactive-app.spec.tsx (task list hidden at 18 rows, PgUp/PgDn don't scroll chat).
  • user-input, user-input-completion, chat-input, chat-history, and interactive-app specs pass (186 tests), and all CI checks pass.
  • Checked by hand in a 60x18 terminal with a 40-line chat and 3 live tasks.

Checklist

  • If this was for an open issue, I was assigned to it
  • Code follows project style guidelines
  • Self-review completed
  • Documentation updated (if needed)
  • No breaking changes (or clearly documented)

@github-actions github-actions Bot added area:tui Terminal UI area:docs Documentation labels Oct 20, 2026
@puri-adityakumar
puri-adityakumar marked this pull request as ready for review October 20, 2026 16:01
@puri-adityakumar

Copy link
Copy Markdown
Contributor Author

Hey @akramcodez, could you please take a look at this when you have a moment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs Documentation area:tui Terminal UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Keyboard shortcuts overlay is cut off on short terminals and can't be scrolled

1 participant