fix(cli): guard gradient rendering without colors#3640
Conversation
75aa8fb to
cc9e653
Compare
Additional interactive validation reportI added a before/after interactive validation pass for the Test matrix checked
Before:
|
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
wenshao
left a comment
There was a problem hiding this comment.
No issues found. LGTM! ✅ — gpt-5.5 via Qwen Code /review
wenshao
left a comment
There was a problem hiding this comment.
No issues found. LGTM! ✅ — gpt-5.5 via Qwen Code /review
…LM#3699) (#181) * fix(cli): guard gradient rendering without colors (QwenLM#3640) * fix(cli): auto-submit on number key press in AskUserQuestionDialog (QwenLM#3407) Fixes QwenLM#500. Number keys in AskUserQuestionDialog previously only moved the highlight cursor without submitting, inconsistent with RadioButtonSelect and the standard tool approval dialog. Users pressed a number, saw the option highlight, and assumed it was selected, but the dialog was still waiting for Enter. - For single-select predefined options, pressing a number key now auto-submits immediately. - Multi-select, "Other" custom input, and the Submit tab remain highlight-only (unchanged). - Extracted a shared selectAndAdvance helper to deduplicate the select-and-submit/advance logic across 4 code paths (number key, Enter, multi-select submit, custom input submit). - Removed redundant isFocused guard inside the useKeypress callback; it is already handled via the isActive parameter. Tests cover all four behavioral branches: single-select auto-submits, multi-select does not, "Other" custom input does not, and the Submit tab does not. * fix(core): treat ask_user_question multiSelect as optional (QwenLM#3699) Cherry-picked from QwenLM/qwen-code: 784b3ce Make `multiSelect` field optional in the askUserQuestion tool schema. Older / smaller models often omit the field entirely; treating it as required forced a validation failure when the model otherwise produced a well-formed question. Also refactors a pre-existing conditional expect that lint-staged now flags (no behavior change). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore: trigger PR mergeability recompute * ci: force CI re-trigger --------- Co-authored-by: 易良 <1204183885@qq.com> Co-authored-by: jinye <djy1989418@126.com> Co-authored-by: Automaker <automaker@localhost> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
What changed:
getRenderableGradientColorssoink-gradientonly receives gradients with at least two non-empty color stops.Headerto fall back to plain text rendering whenNO_COLOR=1or the active theme has no renderable gradient.StatsDisplayto avoid the same crash for one-color or otherwise invalid gradients.NO_COLOR=1and StatsDisplay title rendering with a one-color custom gradient.Why it changed:
NoColorThemeprovidesui.gradient: [].theme.ui.gradient || fallbacklogic passed[]to<Gradient>.ink-gradient/gradient-stringrequires at least two color stops and throwsInvalid number of stops (< 2)otherwise.Reviewer focus:
HeaderandStatsDisplaymatchNO_COLORbehavior.Validation
Commands run:
Prompts / inputs used:
tmuxterminal:Expected result:
NO_COLOR=1in a wide terminal that renders the ASCII logo.Invalid number of stops (< 2)is not shown.Observed result:
Header.test.tsxandStatsDisplay.test.tsxpassed: 27 tests total.typecheckpassed.lintpassed.build && bundlepassed.tmuxsmoke test rendered the CLI with the plain-text logo and prompt, with noERRORorInvalid number of stopsoutput.Quickest reviewer verification path:
Evidence:
Invalid number of stops (< 2).tmuxsmoke test renders normally.Scope / Risk
Testing Matrix
Testing matrix notes:
npm run lint,npm run typecheck, andnpm run build && npm run bundle.NO_COLOR=1smoke test usingnode dist/cli.js.Linked Issues / Bugs
Fixes #3639