The best way to control Claude Code, Codex and more from any computer or phone
fix(shared): PASS and FAIL badges stay readable in dark command output (#24042)
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Wesley Smits committed
Nov 14, 2026 at 11:33 UTC
f315da333952f161a381e3afedbd1dfcb08ae3e5
2 files changed
+7
-1
packages/shared/src/terminalOutput.test.ts
+6
@@ -264,4 +264,10 @@ describe("terminalOutputSpans", () => {
264
expect(spans.at(-1)?.style).toBeNull();
265
expect(spans.map((span) => span.text).join("")).toBe("xy".repeat(50));
266
});
267
+
268
+ it("gives badge text at least 3:1 on the dark palette's coloured backgrounds", () => {
269
+ const text = normalizeTerminalOutput("\u001b[42m PASS \u001b[1;37;41m FAIL ").text;
270
+ const spans = terminalOutputSpans(text, TERMINAL_PALETTES.dark);
271
+ expect(spans.map((span) => span.style?.color)).toEqual(["#1f2328", "#1f2328"]);
272
+ });
273
});
packages/shared/src/terminalOutput.ts
+1
-1
@@ -831,7 +831,7 @@ function spanStyle(pen: string, palette: ReadonlyArray<string>): TerminalSpanSty
831
background !== undefined &&
832
(foreground === undefined || contrastRatio(foreground, background) < 3)
833
) {
834
- color = luminance(background) > 0.35 ? "#1f2328" : "#ffffff";
834
+ color = luminance(background) > 0.3 ? "#1f2328" : "#ffffff";
835
}
836
}
837
const textDecorationLine = attributes.underline