Skip to content

Commit 0525755

Browse files
[verified] fix(desktop): compact the pinned thread rail
Signed-off-by: Empire Operating <[email protected]>
1 parent 275226f commit 0525755

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎desktop/src/features/channels/threadRailLayout.test.mjs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,21 @@ test("isThreadRailVisible hides the rail at and below the desktop breakpoint", (
1616
assert.equal(isThreadRailVisible(601, 0), false);
1717
});
1818

19-
test("Thread Rail uses one native rounded surface at the content bounds", () => {
19+
test("Thread Rail paints a compact rounded card capped at the content bounds", () => {
2020
for (const collapsed of [false, true]) {
2121
const className = threadRailShellClassName(collapsed);
2222

2323
assert.match(className, /mt-px/);
2424
assert.match(className, /mb-2/);
25-
assert.match(className, /h-\[calc\(100%-0\.5625rem\)\]/);
25+
assert.match(className, /max-h-\[calc\(100%-0\.5625rem\)\]/);
2626
assert.match(className, /self-start/);
2727
assert.match(className, /rounded-2xl/);
2828
assert.match(className, /overflow-hidden/);
2929
assert.match(className, /bg-background(?!\/)/);
3030
assert.match(className, /shadow-content-edge/);
3131
assert.match(className, /ring-border\/30/);
3232
assert.match(className, /ring-inset/);
33+
assert.doesNotMatch(className, /(?<!max-)h-\[calc\(100%-0\.5625rem\)\]/);
3334
assert.doesNotMatch(className, /clip-path/);
3435
assert.doesNotMatch(className, /self-stretch/);
3536
assert.doesNotMatch(className, /\bmy-2\b/);

‎desktop/src/features/channels/threadRailLayout.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export const THREAD_RAIL_DESKTOP_BREAKPOINT_PX = 600;
22

33
export function threadRailShellClassName(_collapsed: boolean): string {
44
return [
5-
"hidden mb-2 mr-2 mt-px h-[calc(100%-0.5625rem)] min-h-0 shrink-0 self-start overflow-hidden rounded-2xl bg-background shadow-content-edge ring-1 ring-border/30 ring-inset",
5+
"hidden mb-2 mr-2 mt-px max-h-[calc(100%-0.5625rem)] min-h-0 shrink-0 self-start overflow-hidden rounded-2xl bg-background shadow-content-edge ring-1 ring-border/30 ring-inset",
66
"min-[601px]:flex min-[601px]:flex-col",
77
].join(" ");
88
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ test("pins a canonical thread, switches it from the collapsible rail, and unpins
8383
});
8484
expect(paneGeometry).toMatchObject({
8585
railTop: paneGeometry.contentTop,
86-
railBottom: paneGeometry.contentBottom,
8786
railRadius: paneGeometry.contentRadius,
8887
railBackground: paneGeometry.contentBackground,
8988
});
89+
expect(paneGeometry.railBottom).toBeLessThan(paneGeometry.contentBottom);
9090
expect(paneGeometry.railClipPath).toBe("none");
9191
const entry = rail.getByTestId(`thread-rail-entry-${root.id}`);
9292
await expect(entry).toHaveAttribute("aria-current", "page");

0 commit comments

Comments
 (0)