fix(dashboard): stop top bar flicker from frame overflow - #38
Merged
Conversation
Three causes, three fixes: - Disable terminal autowrap for the dashboard session so an overwide line clips instead of wrapping. The frame is built to exactly the terminal height, so a single wrapped line scrolled the SIDEMUX top bar off screen; wide glyphs in captured pane content made this intermittent (banner flashing in and out). - Wrap each repaint in synchronized-output brackets (?2026) and run on the alternate screen: no blank flash between clear and redraw, and the shell scrollback survives quitting the dashboard. - Measure widths in terminal columns, not JS chars: visibleWidth, truncate, wrapLines, and pad now use a simplified wcwidth (CJK and emoji are 2 columns, combining marks and variation selectors are 0). wrapLines also strips ANSI before slicing so a wrap point can no longer land inside an escape sequence. Closes sidemux-2a7
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.
Fixes the SIDEMUX top bar flashing in and out of the dashboard.
Root cause
The frame is built to exactly the terminal height with zero slack.
visibleWidthcounted JS chars, not terminal columns, so preview lines containing wide glyphs (CJK, emoji, ambiguous-width symbols from captured panes) rendered wider than the terminal, auto-wrapped, grew the frame by a row, and scrolled the top bar off screen. Preview content changes every refresh tick, so the banner flickered.Changes
?7l) for the dashboard session: overwide lines clip instead of wrapping, so the frame can never scroll. Restored on close.?2026) around each repaint plus alternate screen (?1049): no blank flash between clear and redraw, and shell scrollback survives quitting.visibleWidth/truncate/wrapLines/padnow use a simplified wcwidth (CJK/emoji = 2 columns, combining marks/variation selectors = 0).wrapLinesstrips ANSI before slicing so wrap points can't land inside an escape sequence, with a guard so a double-width char that doesn't fit still consumes input.Testing
Closes sidemux-2a7