The best way to control Claude Code, Codex and more from any computer or phone
fix(web): chip palette test follows the single design (#26131)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 27, 2026 at 13:47 UTC
5808469018fb95676af148e7a7662c23665c67a3
2 files changed
+21
-34
apps/web/src/themePalette.browser.test.ts
+17
-22
@@ -25,31 +25,26 @@ describe("standard painted theme colors", () => {
25
it("match the chip surfaces index.css paints", () => {
26
const root = document.documentElement;
27
try {
28
- for (const redesign of [false, true, false]) {
29
- root.toggleAttribute("data-redesign", redesign);
30
- for (const appearance of ["light", "dark"] as const) {
31
- root.classList.toggle("dark", appearance === "dark");
32
- const colors = getStandardPaintedThemeColors(appearance, redesign);
33
- const canvas = paintedChannels("--background");
34
- for (const [variable, role] of [
35
- ["--background", "canvas"],
36
- ["--card", "surface"],
37
- ["--surface-raised", "surfaceRaised"],
38
- ["--message-surface", "messageSurface"],
39
- ] as const) {
40
- const expected = toRgb(colors[role])!;
41
- const painted = paintedChannels(variable, canvas);
42
- [expected.r, expected.g, expected.b].forEach((channel, index) => {
43
- expect(
44
- Math.abs(channel * 255 - painted[index]!),
45
- `${appearance} ${role}`,
46
- ).toBeLessThan(1.5);
47
- });
48
- }
28
+ for (const appearance of ["light", "dark"] as const) {
29
+ root.classList.toggle("dark", appearance === "dark");
30
+ const colors = getStandardPaintedThemeColors(appearance);
31
+ const canvas = paintedChannels("--background");
32
+ for (const [variable, role] of [
33
+ ["--background", "canvas"],
34
+ ["--card", "surface"],
35
+ ["--surface-raised", "surfaceRaised"],
36
+ ["--message-surface", "messageSurface"],
37
+ ] as const) {
38
+ const expected = toRgb(colors[role])!;
39
+ const painted = paintedChannels(variable, canvas);
40
+ [expected.r, expected.g, expected.b].forEach((channel, index) => {
41
+ expect(Math.abs(channel * 255 - painted[index]!), `${appearance} ${role}`).toBeLessThan(
42
+ 1.5,
43
+ );
44
+ });
45
}
46
}
47
} finally {
52
- root.removeAttribute("data-redesign");
48
root.classList.remove("dark");
49
}
50
});
apps/web/src/themePalette.ts
+4
-12
@@ -403,19 +403,12 @@ export function getStandardThemeColors(appearance: ThemeAppearance): ThemeColors
403
// index.css paints the light bubble a step darker than the shared palette mobile uses.
404
const STANDARD_WEB_PAINTED_COLORS: Record<ThemeAppearance, Partial<ThemeColors>> = {
405
light: { messageSurface: "#ebebed" },
406
- dark: {},
406
+ dark: { canvas: "#000000", messageSurface: "#1e1e1e" },
407
};
408
409
/** The standard theme as index.css paints it, for solves that measure the page. */
410
-export function getStandardPaintedThemeColors(
411
- appearance: ThemeAppearance,
412
- redesign = false,
413
-): ThemeColors {
414
- return {
415
- ...getStandardThemeColors(appearance),
416
- ...STANDARD_WEB_PAINTED_COLORS[appearance],
417
- ...(redesign && appearance === "dark" ? { canvas: "#000000", messageSurface: "#1e1e1e" } : {}),
418
- };
410
+export function getStandardPaintedThemeColors(appearance: ThemeAppearance): ThemeColors {
411
+ return { ...getStandardThemeColors(appearance), ...STANDARD_WEB_PAINTED_COLORS[appearance] };
412
}
413
414
type ThemeRgbColor = {
@@ -1636,8 +1629,7 @@ export function applyThemePalette(theme: ThemePreference, appearance?: ThemeAppe
1629
for (const variable of Object.values(APP_THEME_VARIABLES)) {
1630
root.style.removeProperty(variable);
1631
}
1639
- // The redesign's lighter dark bubble is the stricter surface, so this ink also covers legacy UI.
1640
- applyContextChipVariables(root, getStandardPaintedThemeColors(appearance ?? "light", true));
1632
+ applyContextChipVariables(root, getStandardPaintedThemeColors(appearance ?? "light"));
1633
}
1634
1635
export function resolveThemeAppearance(