Skip to content

fix(tui): keep status rule one-line in skinny terminals - #31081

Merged
ethernet8023 merged 3 commits into
mainfrom
bb/tui-skinny-status-rule
May 25, 2026
Merged

fix(tui): keep status rule one-line in skinny terminals#31081
ethernet8023 merged 3 commits into
mainfrom
bb/tui-skinny-status-rule

Conversation

@OutThisLife

Copy link
Copy Markdown
Collaborator

Summary

  • Clamp the cwd/branch segment in the TUI status rule so it cannot force the status row wider than the terminal.
  • Truncate the right-hand cwd label on narrow panes instead of wrapping into the composer input.
  • Add width calculation regression tests for skinny terminal sizes.

Context

Addresses the skinny-terminal report where the status bar wraps into the input field.

Test plan

  • npm run build --prefix packages/hermes-ink
  • npx vitest run --maxWorkers 4 --testTimeout 15000 src/__tests__/statusRule.test.ts
  • npx eslint src/components/appChrome.tsx src/__tests__/statusRule.test.ts (0 errors; existing GoodVibesHeart dependency warning remains)
  • npm run build

Clamp and truncate the cwd/branch segment so narrow status bars cannot wrap into the composer input row.
@github-actions

github-actions Bot commented May 23, 2026

Copy link
Copy Markdown
Contributor

🔎 Lint report: bb/tui-skinny-status-rule vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 9029 on HEAD, 9029 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 4805 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts the TUI StatusRule layout so the status bar stays on one line in narrow terminals by clamping/truncating the right-hand cwd/branch segment, and adds regression tests around the width calculations.

Changes:

  • Introduces a statusRuleWidths helper to compute left/right/separator widths based on terminal columns.
  • Updates StatusRule rendering to conditionally render and truncate the cwd/branch segment within a fixed-width box.
  • Adds vitest coverage for the width calculation behavior across “skinny terminal” sizes.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
ui-tui/src/components/appChrome.tsx Adds statusRuleWidths and uses it to clamp/truncate the status rule’s right-hand cwd/branch segment.
ui-tui/src/tests/statusRule.test.ts Adds regression tests to ensure computed widths do not exceed the terminal width and that the cwd segment is truncated/omitted on narrow widths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ui-tui/src/components/appChrome.tsx Outdated
Comment thread ui-tui/src/__tests__/statusRule.test.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread ui-tui/src/components/appChrome.tsx Outdated
Comment thread ui-tui/src/__tests__/statusRule.test.ts Outdated
Make the cwd separator width conditional so the computed status layout matches the rendered row on ultra-narrow terminals.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread ui-tui/src/components/appChrome.tsx
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/tui Terminal UI (ui-tui/ + tui_gateway/) labels May 23, 2026
Budget the right-hand status label by terminal display width so wide Unicode paths cannot wrap skinny status bars.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@hal-blinc hal-blinc left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coach review: ready to merge. Verified clean merge state, no failing/pending checks, targeted review/tests passed or were confirmed by CI. Low-risk housekeeping fix.

@ethernet8023

Copy link
Copy Markdown
Collaborator

LGTM in tests.

@ethernet8023
ethernet8023 merged commit b288de8 into main May 25, 2026
21 checks passed
@ethernet8023
ethernet8023 deleted the bb/tui-skinny-status-rule branch May 25, 2026 05:24
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…-status-rule

fix(tui): keep status rule one-line in skinny terminals
alt-glitch pushed a commit that referenced this pull request Jun 14, 2026
fix(tui): keep status rule one-line in skinny terminals
T02200059 pushed a commit to T02200059/hermes-agent that referenced this pull request Jun 18, 2026
…-status-rule

fix(tui): keep status rule one-line in skinny terminals
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
…-status-rule

fix(tui): keep status rule one-line in skinny terminals
santhreal pushed a commit to santhreal/hermes-agent that referenced this pull request Jul 13, 2026
…-status-rule

fix(tui): keep status rule one-line in skinny terminals
Gravezzz pushed a commit to Gravezzz/hermes-agent that referenced this pull request Jul 21, 2026
…-status-rule

fix(tui): keep status rule one-line in skinny terminals
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

5 participants