Extract shared help footer reflow#29
Merged
Merged
Conversation
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
Roborev and kata currently maintain copies of the same footer packing algorithm. That duplication risks behavior drift, while directly sharing either implementation would couple callers to incompatible Charm major versions. Provide the primitive under kit's tui namespace so both apps can share stable ordering and terminal-cell width decisions without surrendering styling or rendering ownership. Explicit column-gap accounting keeps each caller's presentation choices outside the API. Generated with Codex Co-authored-by: Marius van Niekerk <mariusvniekerk@users.noreply.github.com>
Callers need reflow fit decisions and renderer alignment to use identical terminal-cell measurements; otherwise a renderer can disagree with the helper at exact-width boundaries. Empty source rows also need stable treatment across known and unknown widths so intentional separators survive resize. Expose canonical column widths, preserve blank rows, and make the global overwide, text, and gap contracts explicit while retaining consumer-owned styling. Generated with Codex Co-authored-by: Marius van Niekerk <mariusvniekerk@users.noreply.github.com>
Column maxima alone still force renderers to remeasure each cell before adding alignment fill, which can diverge from reflow decisions at Unicode exact-width boundaries. Expose the same per-item terminal-cell measurement used by ReflowRows and ColumnWidths so callers can calculate padding without depending on their rendering stack's width rules. Generated with Codex Co-authored-by: Marius van Niekerk <mariusvniekerk@users.noreply.github.com>
f98f974 to
af0143a
Compare
roborev: Combined Review (
|
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.
Why
Roborev and kata currently maintain copies of the same help/footer packing algorithm. Keeping those copies separate invites ordering and width-boundary behavior to drift, but sharing either app implementation directly would couple kit to incompatible Charm major versions.
Design consequence
go.kenn.io/kit/tui/helplayoutowns only unstyled help-item data and deterministic row layout. Callers explicitly provide the visible inter-column gap and retain ownership of styling and final rendering, so follow-on consumer migrations do not force Bubble Tea or lipgloss version choices into this module. Overwide items remain intact rather than being truncated by a layout helper.Validation
go build ./...go tool gotestsum --format pkgname-and-test-fails -- ./...(597 passed, 2 expected skips)go vet ./...go mod tidyproduced no changesgenerated by a clanker