Repository navigation
Clamp and scroll the help overlay so it fits the terminal - #306
Merged
Merged
Conversation
the help popup sized itself to its content and got clipped on every side once it outgrew the terminal. At 100x40 it rendered 41x122 (51x137 with --vim-motion), so whole sections were unreachable with no way to scroll to them. It now clamps to the terminal, falls back to a single column when two don't fit, and scrolls with the usual navigation keys and the wheel. Related to #304
prose and bullets were single lines running up to 1441 chars, and four tables carried rows up to 884. Wrapped everything at 100 and turned those tables into the bullet style the document already used elsewhere. Code fences and the ASCII diagram are untouched.
four doc surfaces still said the help overlay ignores mouse events, which the scroll support made false. Horizontal truncation cut rows with no marker while every other truncation in the codebase carries one, and the overlay has no horizontal scroll to recover the text. also replaces the height assertion in TestModel_HelpOverlayNeverExceedsTerminal, which could not fail: overlayCenter drops popup rows outside the background, so the composed view is always exactly the terminal height. Clipping shows up as missing content, so the test now checks the popup's first and last rows survive. Related to #304
There was a problem hiding this comment.
Pull request overview
This PR fixes the help overlay rendering bug reported in #304 by making the help popup respect terminal dimensions and adding vertical scrolling, preventing content from being clipped off-screen on smaller terminals.
Changes:
- Clamp help overlay dimensions to the terminal (with margins), including fallback to single-column layout when two columns don’t fit.
- Add scroll support to the help overlay (keys + mouse wheel) with a visible “scroll position” hint row when content overflows.
- Update documentation surfaces to reflect that the help overlay now responds to mouse wheel scrolling.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
app/ui/overlay/help.go |
Implements size clamping, 1↔2 column layout selection, truncation marker, and scroll state for the help overlay. |
app/ui/overlay/help_test.go |
Adds extensive unit coverage for sizing guarantees, layout fallback, scrolling behavior, and truncation marker behavior. |
app/ui/handlers_test.go |
Adds model-level regression tests to ensure help scrolling works and rendered lines never exceed terminal width. |
README.md |
Updates mouse-support docs to include help overlay wheel scrolling. |
site/docs.html |
Updates mouse-support docs to include help overlay wheel scrolling. |
plugins/codex/skills/revdiff/references/usage.md |
Updates plugin usage docs to include help overlay wheel scrolling. |
.claude-plugin/skills/revdiff/references/usage.md |
Updates plugin usage docs to include help overlay wheel scrolling. |
docs/ARCHITECTURE.md |
Reflows and updates overlay documentation to describe the new help overlay behavior (including scrolling and clamping). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
the help popup sized itself to its content and never read the terminal size, so once it outgrew the screen
overlayCentercomputed a negativestartY, dropped rows off the top and bottom, and wrote over-wide lines past the right edge. At 100x40 it rendered 41x122 (51x137 with--vim-motion), which is what #304 reported: whole sections missing with no way to reach them. It was the only overlay that ignoredctx.Width/ctx.Heightand had no scrolling.What changed
app/ui/overlay/help.gonow clamps toterm_w - 4xterm_h - 4, keeps two columns when they fit, drops to a single column when they don't, and truncates with a…marker only as a last resort. A body taller than the viewport scrolls withj/k, page and half-page,Home/End,g/Gand the wheel, and spends its last row on a↑/↓ scroll · N-M of Thint. Rows are padded to the full body width so the box does not resize while scrolling.pageSize()is there because the hint row shortens the viewport. Paging byusableHeight()instead skipped one row at every page boundary.Docs
Four surfaces still said the help overlay ignores mouse events, which this change makes false: README,
site/docs.html, and both pluginreferences/usage.mdcopies.docs/ARCHITECTURE.mdis also reflowed to 100 columns in its own commit, with four wide tables converted to the bullet style the document already used. That commit is formatting only.Related to #304