← Back to Pull requests

fix(tui): clip host display names by terminal columns #4203

Closed
unknown closed this pull request without merging on Nov 30, 2026 07:38 UTC
View on GitHub
unknown unknown commented on Nov 30, 2026 05:34 UTC
Author

What a user gets

Host display names now fit the explorer's available terminal columns without splitting a grapheme. For example, 東京開発機 previously produced a 17-column label in a 13-column budget, and clipping 👩‍💻station could leave a partial joined emoji. Reuse the existing columns and columnIndex helpers while reserving space for the host identity and reachability suffix.

How you verified it

Tested commit 41960cead4773c670bef85bb7e8e42dcc1abad86 on Windows, Node 24.14.1:

  • The new tests on base f2fe3e529 failed in four cases: three wide labels and the joined emoji.

  • npx vitest run packages/tui/test/host-label-width.test.ts packages/tui/test/terminal-safe-text.test.ts packages/tui/test/emoji-truncation.test.ts — 25 passed.

  • npm run build — passed.

  • npm run lint — passed.

  • git diff origin/main...HEAD --check — passed.

  • npm test — incomplete: repository script checks reported failures in unchanged packaging/policy/POSIX-oriented checks, and the run stopped making progress and was interrupted. Workspace suites were not reached.
  • Anything you were unsure about

    Rendering is verified through deterministic unit tests; no native terminal session was exercised. As before, the command identity and reachability suffix are retained when they alone exceed the available width.

    If this is security-related

    N/A.

  • One concern per PR; no version bump; no CHANGELOG.md edit

  • Tests added or updated where the change is testable

  • I listed the checks I ran, their results, and any checks I could not run
  • <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    Bug Fixes
    Host labels now fit the available terminal width more accurately, including names with wide characters and emoji.
    Command identity remains visible when there is no room for a display name.
    Tests
    * Added coverage for host label clipping and fitting across different host states.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 261 lines (+195 / -66) across 3 files Reviewer: openrig-review Review duration: 124m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.39) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 261 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.333
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #4203"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.2% (MEDIUM) · Higher = larger blast radius
    39.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.0% · Safe to merge
    17.0%