fix: keep help overlay within the terminal (two columns + height guard) #18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/help-overlay-layout"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The
?help overlay rendered as a single ~50-line column, andcenterOverlayplaced it withlipgloss.Place, which positions but never truncates. So on any terminal shorter than the panel (i.e. essentially all of them at 80×24), the top and bottom — including the? or esc to closehint — were silently clipped off-screen.Helponly ever knew the terminal width, never its height, so it couldn't defend against this.Fix
Help.NewHelp/SetSizenow take height; the open site passesa.height.… resize terminal to see all keysindicator — while the title and close hint are always kept on screen. No more silent clipping.Tests
TestHelpHeightGuardClipsToTerminalasserts the rendered panel never exceeds the terminal height, the close hint survives, and the resize indicator appears.NewHelp.go vet ./... && go test ./...green (7 packages).Note on overlap with #17 (git sync)
This branches from
mainand is independent of the sync feature. Both touchinternal/views/help.go(this PR rewrites the render path and renameshelpSections→helpGroups; #17 adds aSynckey row) andTestHelpGolden.golden. Whichever merges second will need a small rebase: re-add theSyncgroup tohelpGroupsand regenerate the golden.a0d5f290f05afb3ef239