Skip to content

Make settings UI reflow on narrow terminals - #317

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-5341-make-settings-ui-reflow-on-narrow-terminals
Aug 5, 2026
Merged

Make settings UI reflow on narrow terminals#317
TheGreatAxios merged 2 commits into
mainfrom
cl-5341-make-settings-ui-reflow-on-narrow-terminals

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

Settings and Agent Configuration forms reflow on narrow terminals (~40–60 columns).

Approach

  • Extract shared helpers into src/tui/components/form-reflow.ts:
    • STACK_FORM_COLUMNS (56) — stack labels above values below this width
    • formContentWidth — account for margin/padding chrome
    • fitTrailingText — keep caret on-screen for long append-only values
    • wrapHelpSegments — pack help footer into pane-width lines
  • Wire settings-overlay.tsx and agent-modal.tsx to stack fields, shrink padding, truncate long labels/values, and multi-line help.

Test plan

  • form-reflow unit tests (fit/wrap/chrome at 40–60 cols)
  • Manual: open Settings + Agent form at ~40–60 columns; confirm labels stack, caret visible, help usable
  • Manual: wide terminal still side-by-side labels

Closes CL-5341

@linear-code

linear-code Bot commented Aug 5, 2026

Copy link
Copy Markdown

CL-5341

@TheGreatAxios

Copy link
Copy Markdown
Collaborator Author

Code review (parent — multi-agent fleet unavailable)

Verdict: approve with nits

Strengths

  • Introduces shared form-reflow helper with unit tests — right place for narrow-terminal layout math.
  • Settings overlay + agent-modal reflow together so both surfaces behave consistently.

Nits

  • Large surface area (~368 LOC). Watch for interaction with CL-5344 (Bifrost removal) and CL-316 field spacing on the same files — merge order may need a small rebase.
  • Confirm very narrow widths still keep Enter/Esc footer hints readable.

@TheGreatAxios

Copy link
Copy Markdown
Collaborator Author

Review — approve (with merge-order note)

Good extraction. form-reflow.ts is small, pure, and well-tested; wiring into Settings + Agent Configuration matches the ~40–60 col acceptance band.

Correctness

  • formContentWidth chrome math matches marginX={1} + paddingX 1/2.
  • fitTrailingText is the right strategy for append-only fields with a trailing caret (reserves one cell via valueWidth - 1).
  • wrapHelpSegments packing is sound; over-long single segments fall back to trailing ellipsis.
  • Stacked layout (STACK_FORM_COLUMNS = 56) + reduced padding on narrow terminals is a sensible threshold.
  • Bonus: agent form already nests value+caret with gap={0}, so this PR also covers CL-5342 for agent-modal (not codex-login).

Risks / gaps

  • Merge conflict with fix(tui): remove stray space in settings text fields #316 is real — same form-field blocks in agent-modal.tsx. Prefer merging this first, then land fix(tui): remove stray space in settings text fields #316’s codex-login-only leftover.
  • No component-level Ink render tests for stacked layout; only pure helpers. Manual 40–60 col pass remains the real gate (still open in the PR body).
  • Settings reflow mainly covers outer width, TabBar, and Permissions entry truncation — Compaction / other tabs are thinner.
  • fitTrailingText is codepoint-length, not display-width (emoji/CJK). Consistent with most of the TUI; call out if wide glyphs show up in API keys/URLs.

Verdict: approve — merge ahead of or carefully rebased against #316.

@TheGreatAxios

Copy link
Copy Markdown
Collaborator Author

Multi-agent review (blended: cto / greybeard / neckbeard / critique / bruckheimer)

Verdict: Approve

Findings

  • Narrow-width reflow for settings is correct and well-tested.
  • No correctness or product blockers.

Ready for human review/merge.

@TheGreatAxios

Copy link
Copy Markdown
Collaborator Author

Hard review (greybeard + CTO)

Verdict: APPROVE

Greybeard

form-reflow is a pure layout helper with unit tests; agent-modal and settings-overlay consume it without inventing a second layout system. Narrow terminals get stacked fields instead of smashed columns.

CTO

This is the right abstraction for the problem. Keep form-reflow as the single place for future form width work.

No blockers.

Extract shared form-reflow helpers and wire Settings + Agent
Configuration so labels stack, long values keep the caret on-screen,
and help footers wrap at ~40-60 columns.

Closes CL-5341
…minal

fitTrailingText was using string length, so CJK and emoji overran the pane.
Also drop the forced 16-column box floor so margin plus width cannot exceed tiny terminals.
@TheGreatAxios
TheGreatAxios force-pushed the cl-5341-make-settings-ui-reflow-on-narrow-terminals branch from 83a1e44 to d819098 Compare August 5, 2026 06:12
@TheGreatAxios
TheGreatAxios merged commit 48b44e1 into main Aug 5, 2026
1 check passed
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