fix(ui+tui): stabilize spinner/ticker width to reduce status-line jitter#20683
Merged
Conversation
The verb-padding change dropped the leading space in durationSegment on
the assumption that the verb's trailing pad always supplies the gap. But
the unicode spinner style sets showVerb=false, making verbSegment an
empty string — in that mode the output would become `{frame}· {duration}`
with no separator. Add the space back; harmless when the verb segment
is shown (its trailing pad still provides the gap).
Contributor
|
I'm still working on the jumping of the original ui, but the TUI does not jump I can confirm |
7 tasks
19 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.
Salvages the UI/TUI portions of #20466 onto current main. Original PR bundled these with an unrelated install.sh change under a misleading title; the install.sh half is in #20680, this is everything else.
Summary
Make the spinner elapsed timer (classic CLI) and the FaceTicker verb + duration (TUI) fixed-width so the status line to the right doesn't shift every tick.
Changes
cli.py: elapsed timer formats as9.2s/01m05s(both 6 chars) instead of9.2s→1m 5s(variable width).ui-tui/src/components/appChrome.tsx:padVerbpads every verb inVERBSto the longest verb + ellipsis.padTickerDurationright-padsfmtDurationoutput to 7 chars (covers up to 100+ hours).VERB_PAD_LEN/DURATION_PAD_LENexported for tests.durationSegment(original author dropped it, but the unicode spinner style hides the verb segment entirely and would have lost the gap between frame and middot).Validation
scripts/run_tests.sh tests/cli/test_cli_status_bar.py→ 27/27 pass.fmtDurationmax output is59m 59s= 7 chars;100h 0medge case still 7 chars;padTickerDurationproduces stable-length output across[9s, 10s, 59s, 60s, 61s, 3599s].Notes
Credits @adybag14-cyber — cherry-picked onto current main with authorship preserved.
Closes the UI portion of #20466.