feat(ui): define the global keys, and give the status bar three zones - #49
Merged
Conversation
A key is global when it does the same thing in every focus. Six do — t track, u untrack, m rename, a api, ? keys, q quit — and the status bar now carries exactly those. enter and / used to lead the list and are the two that failed the definition: enter runs a tool in [1], installs a release in [2] and is unbound in [3]; / filters the list in [1] but searches [3]'s text from [2]. Both moved to [1]'s footer beside space group, where their meaning is fixed. The bar is three zones: the running version pinned left, the six keys centered on the bar, the API gauge pinned right. Centering is measured against the whole bar and then clamped into the band the edges leave, so a narrow terminal pushes the block up against the version cell instead of overlapping it. The collapsed self-update cell rides with the version — it carries its action alone, and the version cell is the subject that names what is being updated. Two collisions had to be settled to free the letters. Rename takes m, so panel [3]'s man source becomes M — and with it the whole trio goes capital: R readme, H help, M man. That also retires the worst of the old overlaps, where the [3] title advertised "r readme" while pressing r in [2] silently spent three requests on a refresh. All three now fire from [2] as well as [3]; lowercase r means refresh and nothing else. The API overlay moves L -> a. Also fixed on the way: an absent right cell in a panel footer reserved two cells for the gap to a neighbour that does not exist, which dropped [1]'s last footer cell one step earlier than the width required; and the tag-grouping refusal still pointed at [t], which has been the track verb since the tag editor moved to [#]. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
A key is global when it does the same thing in every focus. Six do, and the status bar now carries exactly those:
enterand/used to lead that list and are the two that failed the definition —enterruns a tool in[1], installs a release in[2]and is unbound in[3];/filters the list in[1]but searches[3]'s text from[2]. The bar could only ever advertise one of their meanings and be wrong in the other panels. Both moved to[1]'s footer besidespace group.The bar is three zones
Version pinned left, keys centered, gauge pinned right (
renderHintsBar, render.go). Centering is measured against the whole bar and then clamped into the band the two edges leave, so a narrow terminal pushes the block up against the version cell instead of overlapping it. The collapsed self-update cell rides with the version: it carries its action alone (U update) and the version cell is the subject naming what is being updated.Drop order under width pressure: trailing hints, then the gauge, then the version, then the self cell. The leading cell is truncated, never wrapped — a wrapped bar makes
View()returnheight+1rows and scrolls the top border off the alt screen.Two key collisions had to be settled
mtakes rename, so[3]'s man source becomesM— and the whole trio goes capital:Rreadme,Hhelp,Mman. That retires the worst of the old overlaps: the[3]title advertisedr readmeregardless of focus, so pressingrfrom[2]silently spent three API requests on a refresh instead. All three now fire from[2]as well as[3]; lowercasermeans refresh and nothing else.API overlay:
L→a.Fixed on the way
panelFooterreserved 2 cells for the gap to a right cell that does not exist.[1]and[2]pass""there, so[1]lost its last footer cell one step earlier than the width required.press [t].thas been the track verb since the tag editor moved to#.Known limit
[1]is 20% of the width, so the three footer cells (34 columns with separators) only all fit on a wide terminal:[1]inner/ filter · enter run · space group/ filter · enter run/ filterCells drop from the right in priority order. Shortening the labels or widening
[1]'s share would buy the third cell back; neither is in this PR.Testing
TestRunHintLivesInToolsFooter,TestToolsFooterCellOrder—enteris in[1]'s footer and out of the bar; cell order and drop order.TestRenderHintsBarAlignment— three zones: version at the left edge, hint block centered on the bar within ±1 cell, gauge at the right edge, plus the clamped narrow case.TestReadmeKeyBranches—Rfires from both[2]and[3],rno longer switches the source,mrenames.TestModeEnterAndEsc— each global verb opens its mode from a panel other than[1].Every new assertion was mutation-checked: reverting the production edit turns it red (7/7 killed). Rendered output read at 80 and 120 columns.
CLAUDE.md,ARCHITECTURE.mdandREADME.mdupdated in the same commit.Preflight green:
go build/go vet/go test -race ./.../golangci-lint run.Not in scope
Four findings from the same review are left alone:
ctrl+cis dead in 11 of 13 input modes,/is a silent no-op in readme mode,l(focus right) is bound but undocumented, and[3]'s footer saysctrl+d/u pagewhere the[?]overlay sayshalf page.The demo GIFs show the status bar and footers and are now stale.