Skip to content

ui: always show Global Arguments and drop the broken G toggle - #7

Merged
someson merged 2 commits into
mainfrom
fix/always-show-globals
Sep 7, 2026
Merged

someson merged 2 commits into
mainfrom
fix/always-show-globals

Conversation

@someson

@someson someson commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Problem

G (toggle the Global Arguments section) was a no-op in every configuration measured. With a fixture matching a real az command (7 globals):

Terminal Globals visible? G changes anything?
106x30 yes no — fitAll forces them visible, so the toggle cannot hide them
106x12 no no — hidden and unrevealable
106x5 no no
80x30 (single-col) no no — and the view printed press G to show 4 global argument(s), advertising a key that did nothing

The key reached the handler and flipped showGlobals correctly; the rendering just never depended on it in a way the user could reach. gridLayout computed showAllGlobals := m.showGlobals || fitAll, and fitAll was true whenever the globals fit vertically — which is the common case.

Change

Globals always participate in the layout. Removed showGlobals, the G binding (including the dead ShowGlobal entry in keys.go), fitAll/showAllGlobals, hasHiddenGlobal, both press G hints, the ShowGlobals() 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 in globalsCol at six terminal sizes (140x40 down to 80x10) and that no view mentions press 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.
  • TestFormShowGlobalsToggle deleted (behaviour gone). TestShowGlobalsMovedToShiftG reduced to TestLowercaseGOpensSetVarPopup, keeping the half that still matters: g must open the set-var popup.
  • makeGridForm lost its showGlobals parameter across 11 call sites.

Full suite, go vet, gofmt and golangci-lint all clean locally, with the e2e tests genuinely executing (internal/ui 61s, not the ~1.4s that means they skipped).

Note

The keys.go diff is large because gofmt realigned both blocks after ShowGlobal — the longest field name — was removed. Only two lines are semantic.

@someson
someson merged commit 0ba08b4 into main Sep 7, 2026
6 checks passed
@someson
someson deleted the fix/always-show-globals branch September 7, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant