fix(tui): make the welcome panel responsive to terminal size (#1067)
Closes #1067.
What & why
The welcome panel (home_logo slot) rendered a fixed two-column boot box — block ALTIMATE CODE wordmark on the left (~65 cols), "What is Altimate Code" on the right — that never shrank. On a typical terminal it took ~40–50% of the screen and couldn't be reduced, which is what #1067 reports.
What this does
It now scales with terminal size, reactively (adapts live on resize), using the repo's existing breakpoint idiom (useTerminalDimensions + createMemo, as in routes/session/permission.tsx and component/upgrade-indicator.tsx). Both axes gate each step — the wordmark is wide and tall:
| Variant | When | What shows | ~height |
|---|---|---|---|
| full | ≥110w & ≥44h | the two-column wordmark boot box (large windows only) | ~13 rows |
| medium | in between (the common case) | title + one condensed line + CTA, no wordmark | ~6 rows |
| compact | <60w or <18h | a single line; the border title already carries the version | ~3 rows |
On an everyday laptop terminal (e.g. 106×31, 80×24) you now get medium; the full branded panel returns only when there's genuinely room for it.
Notes
- The breakpoint decision is a pure function in
welcome-panel-utils.ts(mirroringupgrade-indicator-utils.ts), so it's unit-testable without the render/sync context. 4 tests cover the thresholds and that the smaller dimension wins. - Scope: responsiveness only. No dismiss / collapse-once-connected behavior change — that's separable and can be a follow-up if wanted.
- Thresholds are four named constants in
welcome-panel-utils.ts, easy to tune.
Verified
tsgo --noEmit clean · 4 unit tests pass · existing home-onboarding render test still passes · oxlint 0/0 · prettier.
🤖 Generated with Claude Code
Summary by cubic
Make the TUI welcome panel responsive to its available space, so it no longer overtakes small terminals or sidebar layouts. Addresses AI-1067 by switching between full, medium, and compact layouts, updating live on resize and sidebar toggle.
- Bug Fixes
- Moved breakpoint logic to
welcome-panel-utilsaswelcomePanelVariant(width, height)using available size andPANEL_VERTICAL_RESERVE; thresholds are floors (MEDIUM_MIN_*,FULL_MIN_*with height floor 36). WelcomePanelnow acceptsavailableWidth/availableHeight;homepasseswidth-4andheight-PANEL_VERTICAL_RESERVE,sessionpassescontentWidth()andheight-PANEL_VERTICAL_RESERVE.- Simplified render logic with
<Switch>/<Match>, deduped the CTA, trimmed the full left column to 54 cols, and shortened the medium copy; no change to CTA/dismiss behavior. - Expanded unit tests to prove both width/height gates, exact boundaries, and sidebar/short-terminal cases.
- Moved breakpoint logic to
Summary by CodeRabbit
-
New Features
- The welcome panel now adapts its layout to the available terminal size.
- Added full, medium, and compact layouts for different terminal dimensions.
- Compact layouts provide condensed information and streamlined readiness actions.
- The panel now accounts for available content space across home and session views.
-
Tests
- Added coverage for layout selection across terminal size thresholds, boundary conditions, and constrained dimensions.