qwen-code/packages/cli
tanzhenxin 879b854e8a
fix(cli): Keep model picker entries contiguous in short terminals (#6359)
* fix(cli): keep model picker entries contiguous

* fix(cli): account for the error box when capping model picker rows

The model list's row budget didn't reserve space for the inline error
message shown after a failed switch, so it could still overflow a
short terminal in that state. Also cover the capping formula's
untested branches (floor at very small heights, the two-row
description path, the undefined-height fallback) and the
DescriptiveRadioButtonSelect ReactNode description path introduced by
the same change.

* fix(cli): pad error-row estimate for wrapped error text

errorMessageRows only counted explicit newlines, undercounting rows
when the error Text wraps on narrow terminals. Add a small buffer and
tighten the regression test's assertion to the exact expected value.

* fix(cli): show scroll arrows and document the model dialog row budget

Short terminals can now cap the model list well below its old worst
case of 10, hiding most entries with no indicator that the list
scrolls (unlike ThemeDialog, ApprovalModeDialog, and ArenaStartDialog,
which already show scroll arrows). Enable them here too, and reserve
the 2 extra chrome rows they add. Also document the fixed-rows budget
so future layout changes know to keep it in sync.

* fix(cli): drop model picker scroll arrows when they would crowd out entries

The scroll arrows are two always-rendered chrome rows, so on dialogs too
short to fit them plus a single option row they pushed the option rows
past the dialog's clipped height — the picker showed arrows, title, and
footer but no entries. Hide the arrows in that case and spend their rows
on the list instead. Verified with an E2E height sweep (rows 14-34): at
least one entry is now visible at every height and windows stay
contiguous, with arrows still shown wherever they fit.

* fix(cli): remove model picker scroll arrows to reclaim rows for entries

The ▲/▼ indicators are two always-rendered chrome rows, and in a
height-capped dialog those rows are the scarcest resource — enabling
them cost two visible entries at every constrained height and required
extra logic to avoid crowding out the list entirely on very short
dialogs. Remove them and restore the 14-row chrome budget: the entry
numbering already shows where the visible window sits in the list, and
the footer hint covers navigation. Supersedes the earlier change that
enabled the arrows.

* test(cli): cover the max-item clamp for tall terminals
2026-07-06 14:05:32 +00:00
..
src fix(cli): Keep model picker entries contiguous in short terminals (#6359) 2026-07-06 14:05:32 +00:00
index.ts fix(cli): add bootstrap fast paths (#6188) 2026-07-02 22:28:11 +00:00
package.json chore(release): v0.19.6 (#6280) 2026-07-03 16:37:54 +00:00
test-setup.ts perf(cli): code-split lowlight to cut startup V8 parse cost (#4070) 2026-05-15 17:26:18 +08:00
tsconfig.json feat(cli): Add daemon-managed channel worker for serve --channel (#6031) 2026-07-01 01:40:54 +00:00
vitest.config.ts fix(serve): optimize daemon NDJSON stream handling (#6263) 2026-07-03 15:27:28 +00:00