fix(tui): Tighten message and tool spacing - #4594
Conversation
📋 Review SummaryThis PR tightens TUI spacing and density by centralizing margin logic in 🔍 General Feedback
🎯 Specific Feedback🟢 Medium
🔵 Low
✅ Highlights
|
|
Superseded by #4595, which uses the upstream feat/tui-spacing-density-pr1 branch. |
wenshao
left a comment
There was a problem hiding this comment.
| case 'stop_hook_system_message': | ||
| case 'goal_status': | ||
| return 0; | ||
| default: |
There was a problem hiding this comment.
[Suggestion] The default: return 1 branch silently assigns marginTop=1 to any future HistoryItem variant. The codebase's established pattern for HistoryItem switches — see historyUtils.ts:94 (const _exhaustive: never = item) and utils/checks.ts:8 (assumeExhaustive()) — uses a never guard so adding a new variant without classifying it here triggers a TS2322 compile error. Without it, the next new variant will silently get a spacer row, undermining this PR's density goal.
| default: | |
| default: { | |
| // Compile-time exhaustiveness — adding a new HistoryItem variant | |
| // without classifying it here triggers a TS2322 on this line. | |
| const _exhaustive: never = item; | |
| void _exhaustive; | |
| return 1; | |
| } |
— qwen3.7-max via Qwen Code /review
| </Box> | ||
| {effectiveDisplayRenderer.type !== 'none' && ( | ||
| <Box paddingLeft={STATUS_INDICATOR_WIDTH} width="100%" marginTop={1}> | ||
| <Box paddingLeft={STATUS_INDICATOR_WIDTH} width="100%"> |
There was a problem hiding this comment.
[Suggestion] The marginTop={1} removal here also needs the matching update to RESERVED_LINE_COUNT at line 49: it should drop from 5 to 4, since the removed margin was one of the rows that constant reserved for. Otherwise availableHeight = availableTerminalHeight - STATIC_HEIGHT(1) - RESERVED_LINE_COUNT(5) (line 614) undercounts content space by 1 row per tool, and 5+ test assertions (e.g. expect(output).toContain('height=94') at lines 591, 624, 663, 857, 877) encode the stale budget.
At line 49:
| <Box paddingLeft={STATUS_INDICATOR_WIDTH} width="100%"> | |
| const RESERVED_LINE_COUNT = 4; // for tool name, status etc. |
Also update the corresponding height=94 test assertions to height=95 and the inline // 100 - STATIC_HEIGHT(1) - RESERVED_LINE_COUNT(5) = 94 comments to ... - 4 = 95.
— qwen3.7-max via Qwen Code /review
This PR is closed and superseded by QwenLM/qwen-code#4595.
The active PR uses the upstream branch
feat/tui-spacing-density-pr1fromQwenLM/qwen-code, and its evidence artifacts are hosted under the upstream repository: