fix(mobile): separate unfolded thread list from header (#13088)
This commit is contained in:
3 files changed
+23
-5
No files matched your search
@@ -158,6 +158,21 @@ describe("mobile themes", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it.each(MOBILE_THEME_IDS)("keeps %s sidebar text readable on Android", (themeId) => {
|
||||
for (const appearance of ["light", "dark"] as const) {
|
||||
const variables = getMobileThemeRuntimeVariables(themeId, appearance, "android");
|
||||
for (const foreground of [
|
||||
"--color-drawer-foreground",
|
||||
"--color-drawer-foreground-muted",
|
||||
] as const) {
|
||||
expect(
|
||||
contrastRatio(variables[foreground], variables["--color-drawer"]),
|
||||
`${appearance}: ${foreground}`,
|
||||
).toBeGreaterThanOrEqual(4.5);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
it("applies palette overrides on top of the selected built-in theme", () => {
|
||||
const variables = getMobileThemeVariables("ocean", "dark", {
|
||||
"--color-primary": "#123456",
|
||||
@@ -182,9 +197,11 @@ describe("mobile themes", () => {
|
||||
runtime[platform === "android" ? "--color-header" : "--color-drawer"],
|
||||
runtime["--color-screen"],
|
||||
);
|
||||
expect(relativeLuminance(sidebar)).toBeLessThan(
|
||||
relativeLuminance(runtime["--color-thread-canvas"]),
|
||||
);
|
||||
if (platform === "ios") {
|
||||
expect(relativeLuminance(sidebar)).toBeLessThan(
|
||||
relativeLuminance(runtime["--color-thread-canvas"]),
|
||||
);
|
||||
}
|
||||
expect(contrastRatio(chrome, runtime["--color-screen"])).toBeGreaterThanOrEqual(1.06);
|
||||
const foregroundRoles =
|
||||
platform === "android"
|
||||
|
||||
@@ -24,7 +24,7 @@ describe("mobile theme runtime variables", () => {
|
||||
});
|
||||
|
||||
it.each(MOBILE_THEME_IDS)(
|
||||
"keeps %s colors on Android with an opaque Material frame",
|
||||
"uses a screen-colored %s sidebar beneath an opaque Android frame",
|
||||
(themeId) => {
|
||||
for (const appearance of ["light", "dark"] as const) {
|
||||
const base = getMobileThemeVariables(
|
||||
@@ -43,6 +43,7 @@ describe("mobile theme runtime variables", () => {
|
||||
1,
|
||||
),
|
||||
"--color-header-foreground": base["--color-drawer-foreground"],
|
||||
"--color-drawer": base["--color-screen"],
|
||||
});
|
||||
expect(android["--color-header"]).toMatch(/^rgba\(\d+, \d+, \d+, 1\)$/);
|
||||
}
|
||||
@@ -76,7 +77,6 @@ describe("mobile theme runtime variables", () => {
|
||||
expect(ios["--color-header-foreground"]).toBe(ios["--color-drawer-foreground"]);
|
||||
} else {
|
||||
expect(ios).toEqual(getMobileThemeVariables("t3-code", appearance));
|
||||
expect(ios["--color-drawer"]).toBe(android["--color-drawer"]);
|
||||
expect(ios["--color-drawer"]).toBe("#000000");
|
||||
expect(ios["--color-thread-canvas"]).toBe("#0a0a0a");
|
||||
}
|
||||
|
||||
@@ -48,5 +48,6 @@ export function getMobileThemeRuntimeVariables(
|
||||
...variables,
|
||||
"--color-header": frame,
|
||||
"--color-header-foreground": variables["--color-drawer-foreground"],
|
||||
"--color-drawer": variables["--color-screen"],
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user