Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions apps/app/src/components/sidebar/sidebarRowClasses.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,10 @@ describe("sidebar selected thread styling", () => {
);
expect(CONTEXT_SELECTION_SURFACE_CLASS).toBe("bg-state-active");
});

it("marks the row for an opaque backing surface when it becomes sticky", () => {
expect(SIDEBAR_ROW_SELECTED_STATE_CLASS).toContain(
"bb-sidebar-selected-row",
);
});
});
2 changes: 1 addition & 1 deletion apps/app/src/components/sidebar/sidebarRowClasses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const SIDEBAR_ROW_STATIC_STATE_CLASS =
"text-sidebar-foreground/85 dark:text-sidebar-foreground";

export const SIDEBAR_ROW_SELECTED_STATE_CLASS =
`${CONTEXT_SELECTION_SURFACE_CLASS} text-sidebar-foreground`;
`${CONTEXT_SELECTION_SURFACE_CLASS} bb-sidebar-selected-row text-sidebar-foreground`;

export const SIDEBAR_MORE_ACTION_TRIGGER_CLASS =
"relative m-1 h-5 w-5 after:absolute after:left-1/2 after:top-1/2 after:h-7 after:w-7 after:-translate-x-1/2 after:-translate-y-1/2 after:content-[''] max-md:pointer-coarse:m-0 max-md:pointer-coarse:h-9 max-md:pointer-coarse:w-9 max-md:pointer-coarse:after:hidden";
Expand Down
10 changes: 10 additions & 0 deletions apps/app/src/components/ui/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,16 @@
height: var(--bb-sidebar-sticky-tier-shield-bottom-height, 0);
}

/* The shared active-context surface is translucent so it can tint tabs and
other content surfaces. A sticky sidebar row needs an opaque sidebar layer
beneath that tint, or scrolled descendant text paints through the row. */
[data-sidebar-sticky-stack]
[data-sidebar-sticky-tier].bb-sidebar-selected-row {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 slopcop/review — This selector leaves the same bleed path for open-in-split sticky rows.

The other split-pane row uses bg-sidebar-accent/50 in ThreadRow.tsx.

Tailwind Merge removes bg-sidebar when it merges that class into SidebarStickyTier. The row stays translucent, but it does not receive this marker.

A child name can still paint through that sticky row after a scroll. Please give that state an opaque backing too.

background-image:
linear-gradient(var(--state-active), var(--state-active)),
linear-gradient(var(--sidebar), var(--sidebar));
}

.bb-sidebar-hover-actions {
pointer-events: none;
opacity: 0;
Expand Down
13 changes: 13 additions & 0 deletions apps/app/src/components/ui/theme.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,19 @@ function contrastRatio(foreground: OklchColor, background: OklchColor): number {
}

describe("theme.css neutral ramp", () => {
it("backs selected sticky sidebar rows with an opaque sidebar layer", () => {
const rule = css.match(
/\[data-sidebar-sticky-tier\]\.bb-sidebar-selected-row\s*\{([^}]*)\}/s,
)?.[1];

expect(rule).toContain(
"linear-gradient(var(--state-active), var(--state-active))",
);
expect(rule).toContain(
"linear-gradient(var(--sidebar), var(--sidebar))",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 slopcop/review — These separate checks do not protect the required layer order.

The test still passes if a change swaps the layers. That swap puts the opaque sidebar above the active tint.

Please check the complete ordered background-image value. This check will then protect both the opaque backing and the visible selection.

);
});

for (const mode of MODES) {
describe(mode, () => {
const block = modeBlock(mode);
Expand Down
Loading