Skip to content

Commit 9115588

Browse files
[verified] fix(desktop): extend sidebar substrate behind Thread Rail
Signed-off-by: Empire Operating <[email protected]>
1 parent e5229a7 commit 9115588

4 files changed

Lines changed: 46 additions & 2 deletions

File tree

‎desktop/src/app/AppHuddleShell.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as React from "react";
22
import { AppHuddleBar } from "@/app/AppHuddleBar";
3+
import { appHuddleSurfaceClassName } from "@/app/appHuddleSurfaceLayout";
34
import * as BuzzTheme from "@/app/BuzzThemeSurfaces";
45
import { HuddleProvider, useHuddle } from "@/features/huddle";
56
import { HUDDLE_SHORTCUT_EVENT } from "@/shared/lib/keyboard-shortcuts";
@@ -81,7 +82,7 @@ export function AppHuddleShell({
8182
/>
8283
<div
8384
className={cn(
84-
"buzz-huddle-app-surface z-10 flex min-h-0 flex-row overflow-hidden bg-background",
85+
appHuddleSurfaceClassName(isRoom),
8586
isDrawerOpen &&
8687
(isRoom
8788
? "buzz-huddle-app-surface-room-open"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import assert from "node:assert/strict";
2+
import test from "node:test";
3+
4+
import { appHuddleSurfaceClassName } from "./appHuddleSurfaceLayout.ts";
5+
6+
test("normal app surface extends the sidebar substrate behind inset panels", () => {
7+
const className = appHuddleSurfaceClassName(false);
8+
assert.match(className, /\bbg-sidebar\b/);
9+
assert.doesNotMatch(className, /\bbg-background\b/);
10+
});
11+
12+
test("dedicated Huddle room keeps its content background", () => {
13+
const className = appHuddleSurfaceClassName(true);
14+
assert.match(className, /\bbg-background\b/);
15+
assert.doesNotMatch(className, /\bbg-sidebar\b/);
16+
});
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export function appHuddleSurfaceClassName(isRoom: boolean): string {
2+
return [
3+
"buzz-huddle-app-surface z-10 flex min-h-0 flex-row overflow-hidden",
4+
isRoom ? "bg-background" : "bg-sidebar",
5+
].join(" ");
6+
}

‎desktop/tests/e2e/thread-rail.spec.ts‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,22 @@ test("pins a canonical thread, switches it from the collapsible rail, and unpins
6565
const appSidebarLayer = document.querySelector<HTMLElement>(
6666
'[data-testid="app-sidebar-layer"]',
6767
);
68+
const appSurface = document.querySelector<HTMLElement>(
69+
".buzz-huddle-app-surface",
70+
);
71+
const sidebarSurface = document.querySelector<HTMLElement>(
72+
'[data-sidebar="sidebar"]',
73+
);
6874
const contentElement = document.querySelector<HTMLElement>(
6975
"[data-buzz-content-surface]:not([data-buzz-content-unframed])",
7076
);
71-
if (!railElement || !appSidebarLayer || !contentElement) {
77+
if (
78+
!railElement ||
79+
!appSidebarLayer ||
80+
!appSurface ||
81+
!sidebarSurface ||
82+
!contentElement
83+
) {
7284
throw new Error(
7385
"Thread Rail, rail column, app layer, or framed content surface unavailable",
7486
);
@@ -77,6 +89,8 @@ test("pins a canonical thread, switches it from the collapsible rail, and unpins
7789
const contentRect = contentElement.getBoundingClientRect();
7890
const railStyle = getComputedStyle(railElement);
7991
const appSidebarLayerStyle = getComputedStyle(appSidebarLayer);
92+
const appSurfaceStyle = getComputedStyle(appSurface);
93+
const sidebarSurfaceStyle = getComputedStyle(sidebarSurface);
8094
const contentStyle = getComputedStyle(contentElement);
8195
return {
8296
railTop: Math.round(railRect.top),
@@ -89,6 +103,9 @@ test("pins a canonical thread, switches it from the collapsible rail, and unpins
89103
hasRailColumn: Boolean(railColumnElement),
90104
appSidebarLayerBackground: appSidebarLayerStyle.backgroundColor,
91105
appSidebarLayerBackgroundImage: appSidebarLayerStyle.backgroundImage,
106+
appSurfaceBackground: appSurfaceStyle.backgroundColor,
107+
appSurfaceBackgroundImage: appSurfaceStyle.backgroundImage,
108+
sidebarSurfaceBackground: sidebarSurfaceStyle.backgroundColor,
92109
contentBackground: contentStyle.backgroundColor,
93110
railClipPath: railStyle.clipPath,
94111
};
@@ -102,6 +119,10 @@ test("pins a canonical thread, switches it from the collapsible rail, and unpins
102119
expect(paneGeometry.hasRailColumn).toBe(false);
103120
expect(paneGeometry.appSidebarLayerBackground).toBe("rgba(0, 0, 0, 0)");
104121
expect(paneGeometry.appSidebarLayerBackgroundImage).toBe("none");
122+
expect(paneGeometry.appSurfaceBackground).toBe(
123+
paneGeometry.sidebarSurfaceBackground,
124+
);
125+
expect(paneGeometry.appSurfaceBackgroundImage).toBe("none");
105126
expect(paneGeometry.railClipPath).toBe("none");
106127
const entry = rail.getByTestId(`thread-rail-entry-${root.id}`);
107128
await expect(entry).toHaveAttribute("aria-current", "page");

0 commit comments

Comments
 (0)