Skip to content

fix(tui): fit project paths in open menu - #39887

Merged
kitlangton merged 2 commits into
v2from
project-picker-width
Jul 31, 2026
Merged

fix(tui): fit project paths in open menu#39887
kitlangton merged 2 commits into
v2from
project-picker-width

Conversation

@kitlangton

@kitlangton kitlangton commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

What

Fit project paths within Open-menu rows without clipping the end of the already-truncated path, while using the full width of the large dialog on wider terminals.

This follows up on #39678. The path helper was given a width that did not match DialogSelect row geometry, and the original follow-up calculation still assumed a 60-column dialog although Open uses the 88-column large size.

Before / After

Before

A constrained 60-column row budgeted three columns more than it could display, so the path's final characters were clipped after truncation. On wider terminals, Open still capped the calculation at 60 columns and unnecessarily discarded up to 28 columns of its large dialog.

After

Dialog sizes and selectable-row content width have shared policies. Open calculates against its actual large-dialog width, constrained by the terminal, and truncateFilePath receives the exact remaining content width.

How

  • packages/tui/src/ui/dialog.tsx owns medium, large, and xlarge dialog widths.
  • packages/tui/src/ui/dialog-select.tsx owns the selectable-row content width.
  • packages/tui/src/component/dialog-open.tsx derives path width from the large dialog and row content policies.
  • packages/tui/src/component/dialog-move-session.tsx reuses the same row policy for its xlarge dialog.
  • packages/tui/test/cli/tui/dialog-select.test.tsx covers constrained and full-width budgets and renders a truncated footer to verify its complete tail remains visible.

Scope

This does not change the path truncation algorithm or general dialog size values.

Testing

  • cd packages/tui && bun run test (577 passed, 5 skipped)
  • cd packages/tui && bun typecheck
  • Pre-push hook: bun turbo typecheck --concurrency=3 (33 tasks passed)

@kitlangton
kitlangton merged commit 7fd12c5 into v2 Jul 31, 2026
15 of 17 checks passed
@kitlangton
kitlangton deleted the project-picker-width branch July 31, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant