.qwen/design/tui-spacing-density-pr1.md
The current TUI often spends extra rows on spacing before assistant output, between status/tool blocks, and inside expanded tool groups. In common sessions this makes simple answers, file lists, tool output, error states, diffs, and long streaming output harder to scan because users need to scroll through blank space rather than content.
This PR is the first focused pass for QwenLM/qwen-code#4588. It addresses only spacing and density so the review can compare row usage before and after without also reviewing thinking visibility, tool borders, SubAgent layout, branding, or theme color changes.
The implementation keeps the existing information structure and rendering surfaces intact:
HistoryItemDisplay. User prompts
and standalone command views still start with a turn separator, while
assistant continuations, tool groups, status messages, tool summaries, and
related in-turn output no longer add an extra leading spacer row.Markdown blank-line behavior is intentionally left unchanged. The renderer already collapses consecutive blank lines to one spacer and preserves complex blocks such as tables, code blocks, and math blocks.
Under the same terminal width and same rendered content, target scenarios should use fewer visible rows:
The automated spacing assertions and terminal evidence use 100-column fixtures for the changed rules:
| Scenario | Width | Baseline rows | PR1 rows | Delta | Evidence |
|---|---|---|---|---|---|
| Simple assistant reply | 100 | 2 | 1 | -1 | leading history spacer removed |
| Tool header with one-line result | 100 | 3 | 2 | -1 | header and result are adjacent |
| Three-tool expanded group with rendered results | 100 | 16 | 11 | -5 | one header/result spacer removed per tool result and one inter-tool separator removed between adjacent tools |
| Full representative fixture | 100 | 26 | 19 | -7 | same rendered content captured in tmux |
The snapshot diffs also cover the existing 80-column fixtures to confirm the same row-count deltas in the current component test harness.