Skip to content

fix: keep the picker's progress line inside the terminal - #99

Merged
youdie006 merged 2 commits into
mainfrom
fix/progress-line-width
Nov 9, 2026
Merged

youdie006 merged 2 commits into
mainfrom
fix/progress-line-width

Conversation

@youdie006

Copy link
Copy Markdown
Owner

Problem

While prodex ui waited for an answer, its progress line was wider than the terminal. Found 2026-11-09 driving the picker in a pty.

  • At 80 columns, the frame for "prompt sent, waiting for answer (budget 5m)" was 102 columns wide.
  • The line wrapped, and each redraw (ESC[2K\r) cleared only the wrapped row, so a new row was left behind every 250 ms.
  • The label was cut at 60 UTF-16 units, not at a terminal width.

Change

  • renderProgressBar takes columns. When the line does not fit, it cuts the label by display width (truncateToWidth). The bar, elapsed time, budget and "ctrl-c to stop" stay whole.
  • On a terminal too narrow even for those, the whole line is cut.
  • The picker passes process.stdout.columns and no longer slices the label itself.

Verification

  • New case in tests/tui.test.ts: 80 columns with the real label, a 40-column Korean label, and a 30-column terminal. It fails against main (102 > 79) and passes here.
  • A line that already fits is unchanged.
  • npx tsc --noEmit passes. Full suite: 1894 passed, 3 skipped.
  • Not changed: the bar still fills against a fixed 20-minute budget, while the send reports its own budget in the label.

While prodex ui waited for an answer, renderProgressBar never fitted its
line to the terminal, and the label was cut at 60 UTF-16 units instead of
columns. At 80 columns the frame for "prompt sent, waiting for answer
(budget 5m)" was 102 columns wide; it wrapped, and the redraw (ESC[2K\r)
cleared only the wrapped row, leaving a new row every 250 ms. Found
2026-11-09 driving the picker in a pty.

renderProgressBar takes the terminal's columns and, when the line does not
fit, cuts the label by display width (truncateToWidth) so that the bar,
elapsed time, budget and "ctrl-c to stop" stay whole; a terminal too
narrow even for those gets the line cut. The picker passes
process.stdout.columns and no longer slices the label itself.

Not changed: the bar still fills against a fixed 20-minute budget while
the send reports its own budget in the label.

Verified: the new tests/tui.test.ts case fails against main (102 > 79) and
passes here; npx tsc --noEmit; full suite 1894 passed, 3 skipped.

Claude-Session: https://claude.ai/code/session_01EMqNwnnhHXznd2P2PDsaDV
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

What this touches

  • tests

4 file(s), 62 line(s) changed. Tests changed.

This is an automated first pass, not a review. CI is the gate; a person decides.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T03:16:23.960922Z b2d5eb8 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@youdie006
youdie006 merged commit 52f76d6 into main Nov 9, 2026
7 checks passed
youdie006 added a commit that referenced this pull request Nov 10, 2026
…minal) to the container image

Same change as main PR #99 (merge 52f76d6), released in 0.40.51, applied to
src, tests and docs without changes. The CHANGELOG lines are main's with
the PR noted.
Verified on the 12 ports together (35bb83b..this commit): tsc clean;
full suite 2247 passed, 3 skipped; release:verify ok.

Claude-Session: https://claude.ai/code/session_01EMqNwnnhHXznd2P2PDsaDV
youdie006 added a commit that referenced this pull request Nov 10, 2026
0.40.51 (#88-#99) published and installed on WSL, M3 and the Mac mini; M4
was unreachable. The publish run's first attempt failed on macOS Intel (the
suite's 15 minute budget) and Windows (a fixed 200 ms wait in a test); the
failed jobs passed on rerun, and both causes were fixed in #100.

Both browser containers now run 88a8d96. M3's colima VM had been stopped
since M3 restarted and was started for the swap. Includes the live check of
#96's stdio limit on the WSL container.

Claude-Session: https://claude.ai/code/session_01EMqNwnnhHXznd2P2PDsaDV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant