authorgravatar for 118054752+extoci@users.noreply.github.comExotic <118054752+extoci@users.noreply.github.com> 2026-08-12 02:57:10+03:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-08-11 19:57:10-04:00
log560d4a4560ddb5f42c8f8e0e35fa7827c0e46f80
tree1e7bb160b15359b7d36c98924af5c99ad1ae8e65
parent52e5a75a872289040df85621d7a82ea9cba05182
signature Signed by PGP key B5690EEEBB952194

fix(web): keep sidebar wordmark visible at minimum width (#6246)


2 files changed, 23 insertions(+), 4 deletions(-)

apps/web/src/components/threadSidebarWidth.test.ts+21
......@@ -1,3 +1,6 @@
1// @effect-diagnostics nodeBuiltinImport:off - Regression coverage compares shipped CSS with the sidebar width contract.
2import * as NodeFS from "node:fs";
3
14import { describe, expect, it } from "vite-plus/test";
25
36import {
......@@ -31,4 +34,22 @@ describe("thread sidebar width", () => {
3134 it("keeps the sidebar minimum when the whole layout is narrower than its minimums", () => {
3235 expect(resolveInitialThreadSidebarWidth(900, 700)).toBe(THREAD_SIDEBAR_MIN_WIDTH);
3336 });
37
38 it("shows the desktop wordmark across the sidebar's full legal width range", () => {
39 const sidebarStyles = NodeFS.readFileSync(new URL("../index.css", import.meta.url), "utf8");
40 const desktopHeaderStyles = sidebarStyles.slice(
41 sidebarStyles.indexOf("@media (min-width: 48rem)"),
42 sidebarStyles.indexOf("/* Stage-channel sidebar art"),
43 );
44 const stageLabelThreshold = desktopHeaderStyles.match(
45 /@container sidebar-header \(min-width: ([\d.]+)rem\) \{\s*\.sidebar-brand-stage \{\s*display: inline-flex;/,
46 )?.[1];
47
48 expect(sidebarStyles).toMatch(/\.sidebar-brand \{\s*display: none;/);
49 expect(desktopHeaderStyles).toMatch(
50 /@media \(min-width: 48rem\) \{\s*\.sidebar-brand \{\s*display: flex;/,
51 );
52 expect(THREAD_SIDEBAR_MIN_WIDTH).toBe(13 * 16);
53 expect(Number(stageLabelThreshold) * 16).toBeGreaterThan(THREAD_SIDEBAR_MIN_WIDTH);
54 });
3455});
apps/web/src/index.css+2-4
......@@ -340,10 +340,8 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil
340340 }
341341
342342 @media (min-width: 48rem) {
343 @container sidebar-header (min-width: 13.5rem) {
344 .sidebar-brand {
345 display: flex;
346 }
343 .sidebar-brand {
344 display: flex;
347345 }
348346
349347 @container sidebar-header (min-width: 15.75rem) {