Skip to content

Commit d16bddb

Browse files
committed
fix(sidebar): keep a scoped project's own icon color in the header
Wraps the trigger favicon like main did so the menu button's direct-child svg rule cannot recolor a project's fallback icon. Also types the search field ref as a RefObject, since the popup anchor needs one, and drops the header group's now unused gap.
1 parent 7a84fd6 commit d16bddb

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

‎apps/web/src/components/Sidebar.tsx‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4311,7 +4311,7 @@ export default function Sidebar() {
43114311
fixedHeader={
43124312
// Lifted above the stage backdrop, whose fade bleeds below the
43134313
// header and would otherwise paint across the search row's outline.
4314-
<SidebarGroup className="relative z-[1] gap-1 p-[var(--sidebar-content-inset)]">
4314+
<SidebarGroup className="relative z-[1] p-[var(--sidebar-content-inset)]">
43154315
<SidebarThreadHeader
43164316
searchFieldRef={headerSearchRef}
43174317
hasProjects={projectGroups.length > 0}
@@ -4352,7 +4352,11 @@ export default function Sidebar() {
43524352
}
43534353
>
43544354
{scopedProjectGroup ? (
4355-
<ProjectFavicon project={scopedProjectGroup} className="size-4" />
4355+
// Wrapped so the button's direct-child svg color rule cannot override
4356+
// a project's own icon color.
4357+
<span className="flex shrink-0">
4358+
<ProjectFavicon project={scopedProjectGroup} className="size-4" />
4359+
</span>
43564360
) : (
43574361
<FolderIcon className="size-4" />
43584362
)}

‎apps/web/src/components/sidebar/SidebarThreadHeader.tsx‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
type KeyboardEvent as ReactKeyboardEvent,
1717
type MouseEvent as ReactMouseEvent,
1818
type ReactNode,
19-
type Ref,
2019
type RefObject,
2120
} from "react";
2221

@@ -28,7 +27,7 @@ import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
2827

2928
export interface SidebarThreadHeaderProps {
3029
/** Lands on the search field so a popup can anchor to its width. */
31-
searchFieldRef?: Ref<HTMLDivElement>;
30+
searchFieldRef?: RefObject<HTMLDivElement | null>;
3231
/** Without projects there is nothing to scope, so those controls stay out. */
3332
hasProjects: boolean;
3433
/** The project scope combobox, rendered as the first icon of the group. */

0 commit comments

Comments
 (0)