ui: always show Global Arguments and drop the broken G toggle - #7
Merged
Merged
Conversation
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.
Problem
G(toggle the Global Arguments section) was a no-op in every configuration measured. With a fixture matching a realazcommand (7 globals):Gchanges anything?fitAllforces them visible, so the toggle cannot hide thempress G to show 4 global argument(s), advertising a key that did nothingThe key reached the handler and flipped
showGlobalscorrectly; the rendering just never depended on it in a way the user could reach.gridLayoutcomputedshowAllGlobals := m.showGlobals || fitAll, andfitAllwas true whenever the globals fit vertically — which is the common case.Change
Globals always participate in the layout. Removed
showGlobals, theGbinding (including the deadShowGlobalentry inkeys.go),fitAll/showAllGlobals,hasHiddenGlobal, bothpress Ghints, theShowGlobals()accessor, the in-app help entry, and the README line.Net −73 lines including a new test file.
Tests
TestGlobalsAlwaysInLayout— asserts all 7 globals are inglobalsColat six terminal sizes (140x40 down to 80x10) and that no view mentionspress G. The assertion is on the layout, not the rendered window: on a short terminal globals sit below the fold, which is ordinary scrolling rather than hiding.TestGlobalsRenderWhenRoom— the visible counterpart on a roomy terminal.TestFormShowGlobalsToggledeleted (behaviour gone).TestShowGlobalsMovedToShiftGreduced toTestLowercaseGOpensSetVarPopup, keeping the half that still matters:gmust open the set-var popup.makeGridFormlost itsshowGlobalsparameter across 11 call sites.Full suite,
go vet,gofmtandgolangci-lintall clean locally, with the e2e tests genuinely executing (internal/ui61s, not the ~1.4s that means they skipped).Note
The
keys.godiff is large because gofmt realigned both blocks afterShowGlobal— the longest field name — was removed. Only two lines are semantic.