Repository navigation
Layout follow-ups: clamp the report header, align the budget percentage - #146
Merged
Merged
Conversation
Measured before writing, and the measurements reordered the work: the report header overflows at 60 columns too, not just at 40 (68 columns once the member note is there), and the 16 columns of background exposed beside the palette box at width 40 come from that header rather than from the table. So the header clamp goes first, and the compositor decision is made afterwards against the new numbers instead of against these. Also recorded: dimming the exposed background is byte-identical to today under the termenv.Ascii that TestMain pins, so no golden could verify it — the same trap as #141.
The review found three critical defects, all mine: - The exposure formula measured the wrong rows. The widest body line is the title at row 0, which sits ABOVE the box (paletteTopY = 2, covering rows 2-13), so "16 columns exposed beside the box" was the title's own overflow attributed to the compositor. Measured properly, iterating only over covered rows: the exposure is 1 column at width 40 and 0 everywhere else, it is the report table's right border, and clamping the header does not change it. The Task 3 dependency on Task 2 was an artifact of the same formula. - Clipping that column would break composite's documented layering contract (overlay.go:11-13) and three tests that pin it, and the safety argument for it was false: after the header clamp nothing overflows the terminal, and on a wide terminal the body legitimately extends between the box and the screen edge. So #143's compositor half closes without code, with a test that pins the column as intended. - Both prescribed budget tests could never pass. One anchored the figure column on "/" with fixture rows whose Billed values differ in width, asserting an alignment the spec deliberately does not provide; the other asserted the absence of a separator space that the prescribed implementation always emits. Also corrected: "dimming is unverifiable by this suite" is false — TestCompositeDoesNotLeakStyleIntoTheBox builds its own colored renderer for exactly the failure mode goldens cannot see. It stays cut, for the right reason.
…ngelog - overlay_test.go: correct the comment on the narrow-palette clipping test — row 7 is not "the widest row, against 38 for every other covered row"; the six table rows below it are 39 cells too and each exposes a cell, so what survives beside the box is the table's whole right-border strip, not one stray cell. Remeasured from goldenPaletteModel at width 40 to confirm. - budget_test.go: add TestBudgetViewLeavesPercentLabelsNaturalAtZeroWidth, the untested half of the #144 invariant documented on budget.go's view — that width <= 0 never pads the percentage label. Verified it fails without the guard in view (pctW measured unconditionally) and passes with it. - CHANGELOG.md: finish the dangling "instead of ragged" into "instead of a ragged column".
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.
🇬🇧 English
Summary
The two follow-ups the tranche D final review filed. One is a fix, one is a fix plus a decision not to change anything.
62%started its figures one column left of a row at104%.The half of #143 that closes without code. The issue also asked to stop the overlay compositor from letting the background show beside the palette box. Measuring says there is nothing to fix:
paletteTopY = 2) attributed to the compositor by a formula that measured the widest body row instead of the widest covered row.overlay.go:11-13— "cells of body outside the box's rectangle survive verbatim — that layering is the whole point of Keymap registry + navigation stack + overlay compositor (foundations) #59" — and the three tests that pin it. On a wide terminal the body legitimately extends between the box's edge and the screen's, so clipping would erase exactly the depth that contract defends.So instead of a crop there is a test,
TestCompositeDoesNotClipTheReportTableBesideANarrowPalette, that pins that column as intended and names the three tests that would fall if someone tried again. The reasoning is recorded on the issue, including a correction of an earlier comment of mine that carried the wrong figure.Linked issue
Closes #144
Closes #143
Type of change
Checklist
go test ./... -racepassesgofmt,go vet,staticcheckare cleanCo-Authored-Byin commit messagesNotes for the reviewer
internal/tui/overlay.gois untouched. The only production changes arebudget.go(the percentage width, measured once and shared with the layout arithmetic) andreport.go(the header clamp).palette_narrow.golden, whose header and its margin line drop from 68 columns to 40. No golden rendered at 80 moves, because 68 fits there.th.Title.Render(the style carriesMarginBottom(1), so truncating the rendered string would leave the padding line long), and the budget label stays natural atwidth <= 0. Inverting either passed the whole suite before those tests existed.🇮🇹 Italiano
Riepilogo
I due follow-up aperti dalla review finale della tranche D. Uno è una correzione, l'altro è una correzione più la decisione di non cambiare niente.
62%iniziava le cifre una colonna più a sinistra di una riga al104%.La metà della #143 che si chiude senza codice. La issue chiedeva anche di impedire al compositore dell'overlay di lasciar vedere il fondo accanto al box del palette. La misura dice che non c'è niente da correggere:
paletteTopY = 2) attribuito al compositore da una formula che misurava la riga più larga del body invece della riga coperta più larga.overlay.go:11-13— «cells of body outside the box's rectangle survive verbatim — that layering is the whole point of Keymap registry + navigation stack + overlay compositor (foundations) #59» — e i tre test che lo inchiodano. Su un terminale largo il body sta legittimamente fra il bordo del box e quello dello schermo, quindi il ritaglio cancellerebbe proprio la profondità che quel contratto difende.Al posto del ritaglio c'è un test,
TestCompositeDoesNotClipTheReportTableBesideANarrowPalette, che inchioda quella colonna come voluta e nomina i tre test che cadrebbero se qualcuno ci riprovasse. Il ragionamento è registrato sulla issue, inclusa la correzione di un mio commento precedente che portava il numero sbagliato.Issue collegata
Closes #144
Closes #143
Tipo di modifica
Checklist
go test ./... -racepassagofmt,go vet,staticcheckpulitiCo-Authored-Bynei messaggi di commitNote per chi rivede
internal/tui/overlay.goè intatto. Le uniche modifiche di produzione sonobudget.go(la larghezza della percentuale, misurata una volta e condivisa con l'aritmetica del layout) ereport.go(il clamp dell'intestazione).palette_narrow.golden, la cui intestazione e la sua riga di margine scendono da 68 colonne a 40. Nessun golden reso a 80 si muove, perché lì 68 ci sta.th.Title.Render(lo stile portaMarginBottom(1), quindi troncare la stringa già resa lascerebbe lunga la riga di padding), e l'etichetta del budget resta naturale awidth <= 0. Invertire l'uno o l'altro passava tutta la suite prima che quei test esistessero.