Repository navigation
Description
Summary
The TUI's configuration form renders 31 lines and never scrolls, so on a standard 80×24 terminal some of it can't be shown. Below the 23 field rows sit the key hints and the line that shows a validation error, so a short terminal can hide either the first fields or the error that explains why ctrl+r did nothing.
Where
internal/tui/form.go(formModel.View): writes the title, every field row, then the error or loading line and the key hints, with no regard for the terminal heightinternal/tui/model.go(Model.View): alt-screen view of the full form content;m.heightis tracked but only the scan view uses it
Details
Measured with newFormModel(savedConfig{}).View(): 31 lines at the current HEAD (23 field rows plus the title, the gap lines and the hints), and 28 before the three #274 fields were added. Either way it is more than a 24-row terminal holds, and a visible validation error adds two more lines.
Impact
TUI users on default-size terminals, small tmux panes or split IDE terminals. The form looks complete at a glance, but rows are missing, and a rejected run gives no visible reason when the error line is the part cut off.
Steps to reproduce
- Size a terminal to 80×24.
- Run
subenum -tui. - Count the visible rows against the 23 fields, or leave Domain empty and press ctrl+r to look for the error line.
Suggested fix
Render the field rows through a window that keeps the focused row visible when height is smaller than the form (the scan view already sizes itself from m.height). Always keep the error or loading line and the hints on screen. A compact two-column layout above a width threshold is an alternative.
Acceptance criteria
- At 80×24 the focused field, any validation error and the key hints are always visible.
- Tabbing from Domain to the last field and back keeps the focused row on screen.
- A test renders the form at a small height and checks the above.
Getting started
- Relevant files:
internal/tui/form.go,internal/tui/model.go - How to run tests:
go test ./internal/tui/
Related: #274
Filed by repo-audit/fix-issues at d0c56f0. Severity: medium. Effort: M. audit-key: bug|internal/tui/form.go|formModel.View-height
Activity
TMHSDigital commentedon Nov 15, 2026
Fixed in d826821.
The form now follows the terminal's height. When it does not fit, it drops the two-line logo first, then shows a window of field rows that always contains the focused one, with
↑ N more fields/↓ N more fieldsmarkers. The error or loading line and the key hints are always drawn. On a tall terminal the form looks as before. The form reopened withrafter a scan gets the current size too.Verified with
TestFormFitsShortTerminal(80x24 with a validation error: tab through every field and back, checking each view is at most 24 lines and contains the focused row, the error and the hints; also a wrapped 280-character value and a 40-line terminal) andTestFormAfterScanKeepsTerminalSize. Both fail without the change.go test ./...andgolangci-lint runpass.I took the windowing approach rather than the two-column layout. Below roughly 8 lines the view can still be taller than the terminal; the focused field is still drawn.
Fit the TUI form to the terminal height (TMHSDigital#287)