authorgravatar for me@pixp.ccAlex <me@pixp.cc> 2026-10-11 11:29:41-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-10-11 11:29:41-07:00
log80cd57585d7e5ca19c9a495bb34cf3bda8b5d872
tree5d98fc6d18dbcf7ad2a9d4fd23c10be232306a5d
parentb9bf60907fb6eef292da7f19d464a5b16f82ee6b
signature Signed by PGP key B5690EEEBB952194

fix(mobile): separate unfolded thread list from header (#13088)


3 files changed, 23 insertions(+), 5 deletions(-)

apps/mobile/src/lib/mobileTheme.test.ts+20-3
......@@ -158,6 +158,21 @@ describe("mobile themes", () => {
158158 }
159159 });
160160
161 it.each(MOBILE_THEME_IDS)("keeps %s sidebar text readable on Android", (themeId) => {
162 for (const appearance of ["light", "dark"] as const) {
163 const variables = getMobileThemeRuntimeVariables(themeId, appearance, "android");
164 for (const foreground of [
165 "--color-drawer-foreground",
166 "--color-drawer-foreground-muted",
167 ] as const) {
168 expect(
169 contrastRatio(variables[foreground], variables["--color-drawer"]),
170 `${appearance}: ${foreground}`,
171 ).toBeGreaterThanOrEqual(4.5);
172 }
173 }
174 });
175
161176 it("applies palette overrides on top of the selected built-in theme", () => {
162177 const variables = getMobileThemeVariables("ocean", "dark", {
163178 "--color-primary": "#123456",
......@@ -182,9 +197,11 @@ describe("mobile themes", () => {
182197 runtime[platform === "android" ? "--color-header" : "--color-drawer"],
183198 runtime["--color-screen"],
184199 );
185 expect(relativeLuminance(sidebar)).toBeLessThan(
186 relativeLuminance(runtime["--color-thread-canvas"]),
187 );
200 if (platform === "ios") {
201 expect(relativeLuminance(sidebar)).toBeLessThan(
202 relativeLuminance(runtime["--color-thread-canvas"]),
203 );
204 }
188205 expect(contrastRatio(chrome, runtime["--color-screen"])).toBeGreaterThanOrEqual(1.06);
189206 const foregroundRoles =
190207 platform === "android"
apps/mobile/src/lib/mobileThemeVariables.test.ts+2-2
......@@ -24,7 +24,7 @@ describe("mobile theme runtime variables", () => {
2424 });
2525
2626 it.each(MOBILE_THEME_IDS)(
27 "keeps %s colors on Android with an opaque Material frame",
27 "uses a screen-colored %s sidebar beneath an opaque Android frame",
2828 (themeId) => {
2929 for (const appearance of ["light", "dark"] as const) {
3030 const base = getMobileThemeVariables(
......@@ -43,6 +43,7 @@ describe("mobile theme runtime variables", () => {
4343 1,
4444 ),
4545 "--color-header-foreground": base["--color-drawer-foreground"],
46 "--color-drawer": base["--color-screen"],
4647 });
4748 expect(android["--color-header"]).toMatch(/^rgba\(\d+, \d+, \d+, 1\)$/);
4849 }
......@@ -76,7 +77,6 @@ describe("mobile theme runtime variables", () => {
7677 expect(ios["--color-header-foreground"]).toBe(ios["--color-drawer-foreground"]);
7778 } else {
7879 expect(ios).toEqual(getMobileThemeVariables("t3-code", appearance));
79 expect(ios["--color-drawer"]).toBe(android["--color-drawer"]);
8080 expect(ios["--color-drawer"]).toBe("#000000");
8181 expect(ios["--color-thread-canvas"]).toBe("#0a0a0a");
8282 }
apps/mobile/src/lib/mobileThemeVariables.ts+1
......@@ -48,5 +48,6 @@ export function getMobileThemeRuntimeVariables(
4848 ...variables,
4949 "--color-header": frame,
5050 "--color-header-foreground": variables["--color-drawer-foreground"],
51 "--color-drawer": variables["--color-screen"],
5152 };
5253}