xonecas.io
64875
Mc

mini-coder / commit df6518c

refactor: rename CliArgs.listSessions to list for consistency with --list flag

xonecas2026-03-16 df6518cd98da0dcd4fef5d6e7e8e974f79c7cdbd parent 86247fa

3 files changed

UI-AUDIT-PROMPT.md+0−56
@@ -1,56 +0,0 @@
1-# UI Audit Refactor
2-
3-We're on branch `refactor/ui-audit` doing the UI Audit from TODO.md.
4-
5-## Goals
6-
7-- Revise all console output for consistency, **performance**, and correctness.
8-- Ensure clear styled output with proper hierarchy — different output types (user, assistant, reasoning, tool calls, tool results, errors) must be clearly distinguishable via styles and whitespace.
9-- Ensure proper spinner functionality — follow-up messages don't render inline, nothing breaks.
10-- Ensure conversation log is logical — user, assistant, reasoning, tools/tool calls/results are clearly labelled and associated for readability.
11-
12-## Key rendering files
13-
14-- `src/cli/output.ts` — Glyphs (`G`), banner, error rendering, `CliReporter`
15-- `src/cli/tool-render.ts` — Tool call lines + tool result dispatch
16-- `src/cli/tool-result-renderers.ts` — Per-tool result formatting (shell, subagent, skills, web, MCP)
17-- `src/cli/stream-render.ts` — Main turn event loop — orchestrates text, reasoning, tools, spinner
18-- `src/cli/stream-render-content.ts` — Text/reasoning delta accumulation + markdown highlighting
19-- `src/cli/live-reasoning.ts` — Streamed reasoning block display
20-- `src/cli/spinner.ts` — Braille spinner on stderr
21-- `src/cli/status-bar.ts` — Model/session/token info bar
22-
23-## Testing approach
24-
25-- Use `simulateTerminal()` + captured stdout for "user perspective" tests (handles cursor rewrites).
26-- Test with `stripAnsi()` for structure, `hasAnsi()` for styling assertions.
27-- Test realistic multi-event sequences through `renderTurn()` to catch spacing/hierarchy issues.
28-- Verify indentation levels, blank line separators, glyph prefixes, spinner clears.
29-
30-## Status
31-
32-- [x] Baseline tests for current output (24 tests in ui-audit.test.ts)
33-- [x] Shared test helpers in test-helpers.ts (captureStdout, simulateTerminal, eventsFrom, etc.)
34-- [x] Parallel tool call tests (5 tests)
35-- [x] Manual one-shot script (scripts/ui-oneshot.ts, 14 scenarios) — run: bun run ui-oneshot
36-- [x] Identify inconsistencies and issues from one-shot output
37-- [x] Refactor rendering for consistency
38-- [x] Verify all tests pass (33 UI audit tests + 392 total)
39-
40-## Issues found and fixed
41-
42-1. **Parallel tool calls had blank lines between them** — consecutive tool-call-start events
43- in a batch each triggered a blank line separator, making parallel calls look disconnected.
44- Fixed by detecting consecutive tool calls and skipping the blank line within a batch.
45-
46-2. **Web tools used generic glyph/label** — `webSearch` and `webContent` fell through to the
47- generic `· toolName` renderer. Added dedicated rendering: `? search <query>` and
48- `← fetch <url>` with proper glyphs.
49-
50-3. **Missing one-shot scenarios** — added scenarios 15-17 for webSearch, webContent, and
51- listSkills to ensure visual coverage of all tool types.
52-
53-4. **Duplicate stdout for single-line failing shell commands** — when a shell command failed
54- with exactly 1 line of stdout and no stderr, the stdout was shown both inline in the
55- summary badge (`out: <line>`) AND as a separate `stdout (1 lines)` preview block.
56- Fixed by skipping the preview when stdout is already inlined in the summary.
src/cli/args.ts+3−3
@@ -4,7 +4,7 @@ import { writeln } from "./output.ts";
44 interface CliArgs {
55 model: string | null;
66 sessionId: string | null;
7- listSessions: boolean;
7+ list: boolean;
88 resumeLast: boolean;
99 prompt: string | null;
1010 cwd: string;
@@ -18,7 +18,7 @@ export function parseArgs(argv: string[]): CliArgs {
1818 const args: CliArgs = {
1919 model: null,
2020 sessionId: null,
21- listSessions: false,
21+ list: false,
2222 resumeLast: false,
2323 prompt: null,
2424 cwd: process.cwd(),
@@ -47,7 +47,7 @@ export function parseArgs(argv: string[]): CliArgs {
4747 break;
4848 case "--list":
4949 case "-l":
50- args.listSessions = true;
50+ args.list = true;
5151 break;
5252 case "--cwd":
5353 args.cwd = argv[++i] ?? process.cwd();
src/index.ts+1−1
@@ -100,7 +100,7 @@ async function main(): Promise<void> {
100100 process.exit(0);
101101 }
102102
103- if (args.listSessions) {
103+ if (args.list) {
104104 printSessionList();
105105 process.exit(0);
106106 }