Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/lib/init/ui/logging-ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ export class LoggingUI implements WizardUI {

// ── Lifecycle ─────────────────────────────────────────────────────

banner(art: string): void {
// Plain stderr write, no markdown rendering — the banner already
// contains its own ANSI styling and shouldn't be re-processed.
this.stderr.write(`\n${art}\n\n`);
banner(_art: string): void {
// No-op — LoggingUI is used in non-TTY / CI contexts where the
// large ASCII banner wastes vertical space and adds noise for
// programmatic consumers (agents, scripts, piped output).
}

intro(title: string): void {
Expand Down Expand Up @@ -157,12 +157,12 @@ export class LoggingUI implements WizardUI {
start: (message?: string) => {
active = true;
if (message) {
this.writeLine(this.stdout, `... ${this.renderInline(message)}`);
this.writeLine(this.stdout, this.renderInline(message));
}
},
message: (message?: string) => {
if (active && message) {
this.writeLine(this.stdout, `... ${this.renderInline(message)}`);
this.writeLine(this.stdout, this.renderInline(message));
}
},
stop: (message?: string, code: SpinnerExitCode = 0) => {
Expand Down
10 changes: 5 additions & 5 deletions test/lib/init/ui/logging-ui.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,15 @@ describe("LoggingUI spinner", () => {
spinner.message("Still working");
spinner.stop("Done", 0);
const lines = stdout().split("\n").filter(Boolean);
expect(lines).toEqual(["... Working", "... Still working", "ok: Done"]);
expect(lines).toEqual(["Working", "Still working", "ok: Done"]);
});

test("error stop routes to stderr with error prefix", () => {
const { ui, stdout, stderr } = createUI();
const spinner = ui.spinner();
spinner.start("Working");
spinner.stop("Boom", 1);
expect(stdout()).toBe("... Working\n");
expect(stdout()).toBe("Working\n");
expect(stderr()).toBe("error: Boom\n");
});

Expand All @@ -170,7 +170,7 @@ describe("LoggingUI spinner", () => {
spinner.stop("Done");
spinner.message("ignored");
const lines = stdout().split("\n").filter(Boolean);
expect(lines).toEqual(["... Working", "ok: Done"]);
expect(lines).toEqual(["Working", "ok: Done"]);
});
});

Expand Down Expand Up @@ -248,11 +248,11 @@ describe("LoggingUI disposal", () => {
});

describe("LoggingUI banner", () => {
test("writes art to stderr wrapped in newlines", () => {
test("is a no-op in non-TTY context", () => {
const { ui, stdout, stderr } = createUI();
ui.banner(" ███ SENTRY ███");
expect(stdout()).toBe("");
expect(stderr()).toBe("\n ███ SENTRY ███\n\n");
expect(stderr()).toBe("");
});
});

Expand Down
Loading