feat(cli): add built-in status line presets with interactive dialog#4120
feat(cli): add built-in status line presets with interactive dialog#4120DragonnZhang wants to merge 5 commits into
Conversation
Replace the shell-command-only status line with a preset system that
renders structured session info (model, context usage, git branch,
token counts, etc.) without external commands. Users can configure
which items to display via a new interactive dialog accessible through
/statusline or the settings UI.
- Add statusLinePresets module with 16 built-in item types
- Add StatusLineDialog component with search, multi-select, and preview
- Update /statusline command to open the preset dialog
- Extend settings schema to support { type: "preset", items: [...] }
- Enhance MultiSelect with separator items, active marker, and
customizable checked text
- Update Footer to support theme-colored preset output
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.
6 Critical and 10 Suggestion findings from review. Test coverage gaps (11 of 16 preset items, useThemeColors return value, preset lifecycle in useStatusLine, dialog:statusline slash command action, and helper functions like formatTokenCount / getRunStateLabel / inferPullRequestNumber) are not mapped to specific lines but should be addressed before merging.
|
Addressed the requested status line preset review feedback in 8d0d11a.\n\nSummary:\n- Fixed dialog search/navigation key interaction, effective-scope saving, and preview memoization.\n- Fixed stale preset override behavior, PR lookup warning/retry handling, and shared token aggregation.\n- Fixed duplicate model preset output, preset item dedupe, exhaustive default handling, and preset dependency tracking.\n- Added/expanded tests for the dialog, useStatusLine lifecycle, all preset items, helper functions, theme color behavior, and PR lookup failures.\n\nVerification:\n- cd packages/cli && npx vitest run src/ui/components/StatusLineDialog.test.tsx src/ui/hooks/useStatusLine.test.ts src/ui/statusLinePresets.test.ts\n- npm run build && npm run typecheck |
|
|
||
| const handleConfirm = useCallback(() => { | ||
| const effectiveScope = getEffectiveStatusLineScope(settings); | ||
| settings.setValue(effectiveScope, 'ui.statusLine', presetConfig); |
There was a problem hiding this comment.
[Suggestion] settings.setValue() may throw (e.g. permission denied for System scope). Consider wrapping in try-catch to show a user-friendly error instead of crashing the UI.
| settings.setValue(effectiveScope, 'ui.statusLine', presetConfig); | |
| try { | |
| settings.setValue(effectiveScope, 'ui.statusLine', presetConfig); | |
| } catch (err) { | |
| addItem( | |
| { | |
| type: MessageType.ERROR, | |
| text: `Failed to save status line: ${(err as Error).message}`, | |
| }, | |
| Date.now(), | |
| ); | |
| return; | |
| } |
— DeepSeek/deepseek-v4-pro via Qwen Code /review
| const [statusLineConfigOverride, setStatusLineConfigOverride] = useState< | ||
| StatusLinePresetConfig | undefined | ||
| >(undefined); | ||
| const notifyStatusLineSettingsChanged = useCallback( |
There was a problem hiding this comment.
[Suggestion] notifyStatusLineSettingsChanged sets statusLineConfigOverride but never clears it. If the user later switches to a command-type statusLine, the stale override persists in React state. Consider clearing it when the settings config type no longer matches.
| const notifyStatusLineSettingsChanged = useCallback( | |
| // Add to the settings-watch effect: | |
| if (settingsStatusLineConfig?.type !== 'preset') { | |
| setStatusLineConfigOverride(undefined); | |
| } |
— DeepSeek/deepseek-v4-pro via Qwen Code /review
Summary
/statuslineor the settings UI.statusLinePresets.tsmodule (data model + rendering), theStatusLineDialog.tsxcomponent (interactive picker with search and live preview), and the settings schema extension from command-only tocommand | preset.Validation
npm run dev, open the status line dialog with/statusline, toggle items and observe the live preview update. Check that preset selections persist across sessions via user settings.Scope / Risk
statusLinenow accepts{ type: "preset", items: [...] }in addition to{ type: "command", command: "..." }. Existing command-based configs remain fully supported; no migration needed.{ type: "command", command: "..." }format is unchanged.Testing Matrix
Testing matrix notes:
🤖 Generated with Qwen Code