fix(tui): size the welcome screen to the viewport it actually gets - #1376
will-lamerton merged 1 commit into
Conversation
The banner budgeted its logo and menu against the raw terminal height, but fullscreen clips at the chat viewport - the terminal minus the input footer and frame padding - so on a standard 80x24 screen the last menu item and the tip were cut off with no hint anything was missing. App now passes the rows the banner actually has, and its thresholds are the banner's measured heights (14 rows with a two-item menu, 16 with the full menu, 26 with the block wordmark), so the decorative wordmark is dropped before the menu and tip. At 80x24 the banner now renders in 16 rows inside a ~17-row viewport. Closes Nano-Collective#1330.
nc-review: nothing to raise@addyCooks — nothing to raise from the automated review. The PR threads an 🔴 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 |
|
Nice as always! @addyCooks |
|
Thankyou @will-lamerton : ) |
Closes #1330
Description
welcome-message.tsxbudgeted its logo and menu against the raw terminal height (useTerminalRows), but fullscreen mode clips at the chat viewport, which is the terminal minus the input footer and the frame's padding.chat-history.tsxclips withoverflow: "hidden", so the overflow was silent: on a standard 80×24 screen a new user's first view lost theQuit /exitrow and the tip line, with nothing to indicate content was missing.Measured at 80 columns (this drove the thresholds):
A 24-row terminal leaves the banner ~17 rows, and the old ladder rendered 26 into it.
Fix:
WelcomeMessageaccepts anavailableRowsbudget (defaults to the terminal height, for callers nothing clips).App.tsxpassesterminalRows - FULLSCREEN_CHROME_ROWSwhen the alternate screen is active, and the full height inline, where scrollback clips nothing.createStaticComponentsforwards it.At 80×24 the banner now renders in 16 rows: full menu, tip, no wordmark. The wordmark returns once the banner has 26 rows.
Behaviour change worth calling out: the block wordmark now needs 26 available rows rather than 16, so short terminals show the menu and tip instead of the logo. That is the trade this issue asks for, and it applies inline too, where the 26-row banner never fit on a 24-row screen either.
Recording
Type of Change
Changeset
pnpm changeset) describing this change for the changelogTesting
Automated Tests
.spec.ts/tsxfilespnpm test:allcompletes successfully)Manual Testing
Checklist