Skip to content

fix(ui+tui): stabilize spinner/ticker width to reduce status-line jitter#20683

Merged
teknium1 merged 3 commits into
mainfrom
fix/tui-status-bar-jitter-20466
May 6, 2026
Merged

fix(ui+tui): stabilize spinner/ticker width to reduce status-line jitter#20683
teknium1 merged 3 commits into
mainfrom
fix/tui-status-bar-jitter-20466

Conversation

@teknium1

@teknium1 teknium1 commented May 6, 2026

Copy link
Copy Markdown
Contributor

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 as 9.2s / 01m05s (both 6 chars) instead of 9.2s1m 5s (variable width).
  • ui-tui/src/components/appChrome.tsx:
    • padVerb pads every verb in VERBS to the longest verb + ellipsis.
    • padTickerDuration right-pads fmtDuration output to 7 chars (covers up to 100+ hours).
    • VERB_PAD_LEN / DURATION_PAD_LEN exported for tests.
  • Follow-up: put a space back in 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).
  • Python + TS regression tests for width stability.

Validation

  • scripts/run_tests.sh tests/cli/test_cli_status_bar.py → 27/27 pass.
  • TS assertions verified manually: fmtDuration max output is 59m 59s = 7 chars; 100h 0m edge case still 7 chars; padTickerDuration produces stable-length output across [9s, 10s, 59s, 60s, 61s, 3599s].
  • Didn't run vitest — worktree npm deps not installed. Tests are straightforward length assertions on pure functions.

Notes

  • This does NOT fix the prompt_toolkit input-bar-jumps-up bug on Termux that the Discord thread was originally about. That's a separate issue (the classic CLI input widget repositioning when the Android keyboard opens/closes) and is still open. These changes reduce a different, smaller class of jitter — status-bar width changes causing the line to wrap/unwrap during repaints.

Credits @adybag14-cyber — cherry-picked onto current main with authorship preserved.

Closes the UI portion of #20466.

adybag14-cyber and others added 3 commits May 6, 2026 03:55
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).
@adybag14-cyber

Copy link
Copy Markdown
Contributor

I'm still working on the jumping of the original ui, but the TUI does not jump I can confirm

@teknium1 teknium1 merged commit a0556b8 into main May 6, 2026
10 of 11 checks passed
@teknium1 teknium1 deleted the fix/tui-status-bar-jitter-20466 branch May 6, 2026 11:02
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard comp/tui Terminal UI (ui-tui/ + tui_gateway/) labels May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/tui Terminal UI (ui-tui/ + tui_gateway/) P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants