xonecas.io
64875
Mc

mini-coder / commit 70dbd9a

fix: Ui improvements

xonecas2026-03-13 70dbd9a8802c54b55140e9e0c6c67663fa9f4331 parent 981f262

6 files changed

TODO.md+8−2
@@ -19,9 +19,15 @@ Do an extensive pass to cleanup tests, dead code and anything else that might ha
1919
2020 ## UI Audit
2121
22-Our output is currently not in a good spot, with weird newlines and inconsistent whitespace separation between tool calls, tool responses, and assistant response.
22+- Inspect reasoning and markdown rendering, it feels very slow and laggy to the user.
23+- We need to revise all of our output to ensure consistency, performance and correctness.
24+- Ensure we have a good styled output that is clear to the user, refactor as needed.
25+- Ensure we have propper hierchy in output, and the different types of output are clearly distinguishable for the user, using styles and whitespace.
26+- Ensure proper spinner functionality, that follow up messages don't rended inline and that is doesn't break anything.
2327
24-Audit our output to make sure it's refactored to the new tools and working correctly and performant and ensure propper whitespace.
28+## CLI vs headless mode
29+
30+- I need to understand this better tell me all about what is headless mode and what it does in our code.
2531
2632 ---
2733
src/cli/output-reporter.ts+6−2
@@ -1,4 +1,3 @@
1-import * as c from "yoctocolors";
21 import type {
32 AgentReporter,
43 StatusBarData,
@@ -6,6 +5,7 @@ import type {
65 } from "../agent/reporter.ts";
76 import type { TurnEvent } from "../llm-api/types.ts";
87 import {
8+ G,
99 renderError,
1010 renderHook,
1111 renderInfo,
@@ -20,10 +20,12 @@ export class CliReporter implements AgentReporter {
2020 private spinner = new Spinner();
2121
2222 info(msg: string): void {
23+ this.spinner.stop();
2324 renderInfo(msg);
2425 }
2526
2627 error(msg: string | Error, hint?: string): void {
28+ this.spinner.stop();
2729 if (typeof msg === "string") {
2830 renderError(msg, hint);
2931 } else {
@@ -32,10 +34,12 @@ export class CliReporter implements AgentReporter {
3234 }
3335
3436 warn(msg: string): void {
35- writeln(`! ${c.yellow(msg)}`);
37+ this.spinner.stop();
38+ writeln(`${G.warn} ${msg}`);
3639 }
3740
3841 writeText(text: string): void {
42+ this.spinner.stop();
3943 writeln(text);
4044 }
4145
src/cli/spinner.test.ts+4−2
@@ -17,7 +17,7 @@ describe("SPINNER_FRAMES", () => {
1717 });
1818
1919 describe("Spinner", () => {
20- test("moves cursor to a new line when stopped", () => {
20+ test("clears the spinner line and shows cursor without advancing to a new line", () => {
2121 const originalWrite = process.stderr.write;
2222 let stderr = "";
2323 process.stderr.write = ((text: string) => {
@@ -29,7 +29,9 @@ describe("Spinner", () => {
2929 const spinner = new Spinner();
3030 spinner.start("thinking");
3131 spinner.stop();
32- expect(stderr).toContain("\n");
32+ expect(stderr).toContain("\r\x1B[2K");
33+ expect(stderr).toContain("\x1B[?25h");
34+ expect(stderr).not.toContain("\n");
3335 } finally {
3436 process.stderr.write = originalWrite;
3537 }
src/cli/spinner.ts+1−1
@@ -19,7 +19,7 @@ export class Spinner {
1919 if (!this.timer) return;
2020 clearInterval(this.timer);
2121 this.timer = null;
22- process.stderr.write("\r\x1B[2K\x1B[?25h\n");
22+ process.stderr.write("\r\x1B[2K\x1B[?25h");
2323 }
2424
2525 update(label: string): void {
src/cli/stream-render.ts+2−0
@@ -156,8 +156,10 @@ export async function renderTurn(
156156 }
157157
158158 case "turn-complete": {
159+ const hadContent = inText || inReasoning;
159160 flushAnyText();
160161 spinner.stop();
162+ if (!hadContent) writeln();
161163 inputTokens = event.inputTokens;
162164 outputTokens = event.outputTokens;
163165 contextTokens = event.contextTokens;
src/cli/tool-render.ts+2−1
@@ -313,8 +313,9 @@ export function renderToolResult(
313313 };
314314 const label = r.agentName ? ` ${c.dim(c.cyan(`[@${r.agentName}]`))}` : "";
315315 writeln(
316- ` ${c.cyan("←")}${label} ${c.dim(`subagent done (${r.inputTokens ?? 0}in / ${r.outputTokens ?? 0}out tokens)`)}`,
316+ ` ${G.agent}${label} ${c.dim(`subagent done (${r.inputTokens ?? 0}in / ${r.outputTokens ?? 0}out tokens)`)}`,
317317 );
318+
318319 return;
319320 }