Skip to content

fix(tui): keep the welcome menu from wrapping apart on narrow terminals - #1441

Open
addyCooks wants to merge 2 commits into
Nano-Collective:mainfrom
addyCooks:fix/welcome-menu-width-1434
Open

addyCooks wants to merge 2 commits into
Nano-Collective:mainfrom
addyCooks:fix/welcome-menu-width-1434

Conversation

@addyCooks

@addyCooks addyCooks commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Description

Closes #1434.

Each welcome menu row is one line: label, gap, key, as wide as the menu's own text. The menu was chosen by terminal height alone, so on a terminal narrower than that line each row wrapped and its key landed on a line of its own (at 20 columns: Resume session / /resume on separate, misaligned lines).

A menu is now only offered when its rows also fit the width, stepping down the same way the height budget already does: the full menu, then the short one (Help / Quit), then none. At 20 columns you get the short menu with each row on one line. The existing column-width calculation is reused rather than duplicated.

This is separate from #1330 / #1376, which fixed the height budget.

Recording

B23-FIXED-welcome-menu-narrow

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Changeset

  • Added a changeset (pnpm changeset) describing this change for the changelog

Testing

Automated Tests

  • New features include passing tests in .spec.ts/tsx files
  • All existing tests pass (pnpm test:all completes successfully)
  • Tests cover both success and error scenarios

New test: full menu at 25 columns, short menu at 20, no menu at 12, each label and key on the same line. It fails without the fix. The welcome spec passes (26 tests); types, format, lint and knip are clean; the full AVA suite has no new failures compared with main (the ones it reports are known Windows-only failures).

Manual Testing

  • Tested with Ollama
  • Tested with OpenRouter
  • Tested with OpenAI-compatible API
  • Tested MCP integration (if applicable)

Layout-only change; it doesn't depend on the provider.

Checklist

  • If this was for an open issue, I was assigned to it
  • Code follows project style guidelines
  • Self-review completed
  • Documentation updated (if needed)
  • No breaking changes (or clearly documented)
  • Appropriate logging added using structured logging (see CONTRIBUTING.md)

Each welcome menu row is one line, label then key, as wide as the menu's
own text. The menu was chosen by height alone, so on a terminal narrower
than that line each row wrapped and its key landed on a line of its own.

Offer a menu only when its rows also fit the width: the full menu, then
the short one, then none, the same ladder the height budget already uses.

Closes Nano-Collective#1434.
@github-actions

Copy link
Copy Markdown
Contributor

nc-review: comments — 1 nit

@addyCooks — a few things worth a look, none blocking.

The change extracts a menuWidth helper and gates the MENU_FULL / MENU_MIN selection on column width as well as height, mirroring the existing row-budget ladder. The diff is small, the new test exercises a regression-differentiating width (20 cols, where the bug manifests as wrapped text), and the changeset is a correctly-named patch entry. Issue #1434 is fully addressed.

⚪ nit · tests · source/components/welcome-message.spec.tsx:196

The new steps the menu down to fit narrow terminals test passes on the buggy code at widths 25 and 12 — only the 20-col case is regression-differentiating. The 25-col assertion would also pass before the fix (the full-row content is exactly 25 cols, so it does not wrap). Consider tightening the width-25 case to make the failure mode explicit, e.g. asserting against a regex that only matches a single-line row with the key (/^Resume session +\/resume\s*$/m) rather than the looser /Resume session +\/resume/, which would also catch the buggy wrapped output.


🔴 blocking · 🟠 a reviewer would ask for a change · ⚪ optional

Automated code review — correctness, security, design, tests, plus duplicates and scope. A human still decides; this is not a substitute for review and is not exhaustive. The required status checks separately cover lint, formatting, types, unused dependencies, the test suite and the build. This bot never merges. Maintainers can rerun with /re-review.

@github-actions github-actions Bot added the agent:comments nc-review left non-blocking findings label Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:comments nc-review left non-blocking findings area:tui Terminal UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] The welcome menu's columns wrap apart on narrow terminals, independent of #1330's height fix

1 participant