Repository navigation
fix(mecatui): normalize tabs before display layout - #2413
Merged
Merged
Conversation
Expand tabs using the text style's tab width before calculating wrapped reasoning rows so the assistant rail cannot widen the transcript past the viewport. Cover framed output across widths and resizes, and document the layout rule. Co-authored-by: Mecatl <[email protected]>
Centralize fixed-width and style-aware tab expansion in terminaltext, accounting for Lip Gloss's unset tab-width getter behavior. Normalize affected plain-text wrapping and title truncation paths before layout, and verify text preservation and rendered widths. Co-authored-by: Mecatl <[email protected]>
Merged
2 tasks
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.
Summary
Prevent tabs from widening terminal content after wrapping or truncation, which can make the session view scroll horizontally or cause bounded views to clip text.
cmd/mecatui/internal/terminaltext/tabs.go:ExpandTabshandles explicit fixed widths, andExpandStyleTabsfollows the effective Lip Gloss style policy.docs/tui.md.Cause and behavior
ANSI width/wrapping helpers do not account for Lip Gloss's later tab expansion. The indentation and assistant-rail budget was already correct, but expanding tabs after wrapping could widen the complete framed block; the reasoning regression reproduced 78 columns in a 60-column viewport.
Lip Gloss v2.0.6 also returns zero from
GetTabWidth()for an unset style, despite rendering unset tabs as four spaces. The style-aware helper resolves the implicit default while preserving explicit zero (remove tabs) and negative (no conversion) settings. This avoids fixing overflow by accidentally deleting word separators.Regression tests compare tabbed content against manually expanded input and check final rendered widths. Coverage includes default and explicit style policies, framing, terminal-width changes, title truncation, and real soul/saved-memory rendering paths. The added regression tests failed before the corresponding fixes.
Verification
On the current revision:
task testpassed.task lintpassed.task docspassed.On the initial reasoning-only revision:
go run ./cmd/mecademopassed, including tool calls, permission ask/approval, and final result.task test:racepassed on a full rerun. The initial run hit the existing scheduler flakeTestFireProvisionalAdmissionDeadlineKeepsPendingUntilRecovery, tracked in CI: track flaky tests on main and PRs #2327 (item 7); five focused race-enabled repetitions also passed. No scheduler code changed. The full race suite has not been rerun after the shared-helper follow-up.API compatibility
No wire/API, Go public API, or stored-data changes. This is a terminal-client rendering correction; no API major or feature identifier changes and no upgrade coordination are required.