Skip to content

Commit 2323466

Browse files
committed
fix(web): keep project filter separate from search
1 parent 074bc84 commit 2323466

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

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

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
* The sidebar header: one row holding search, project scope and new thread.
33
*
44
* Search owns the row's text and spans it. Project scope collapses to an icon
5-
* at the trailing edge of the search surface, ahead of new-project and
6-
* new-thread.
5+
* that sits with new-project and new-thread as a segmented group at the end.
76
* The scope icon swaps to the project favicon while a project is selected,
87
* so the header still names the scope after the row that showed it is gone.
98
*
@@ -31,7 +30,7 @@ export interface SidebarThreadHeaderProps {
3130
searchFieldRef?: RefObject<HTMLDivElement | null>;
3231
/** Without projects there is nothing to scope, so those controls stay out. */
3332
hasProjects: boolean;
34-
/** The project scope combobox, rendered inside the search surface. */
33+
/** The project scope combobox, rendered as the first icon of the group. */
3534
projectScope: ReactNode;
3635
onNewProject: () => void;
3736
/** Receives the click so Shift+click can skip the project picker. */
@@ -83,7 +82,7 @@ export function SidebarThreadHeader({
8382
<div className="flex items-center gap-1">
8483
<div
8584
ref={searchFieldRef}
86-
className="flex h-8 min-w-0 flex-1 items-center gap-2 rounded-md bg-sidebar-row-hover/60 px-2 py-1.5 text-sm font-medium text-sidebar-muted-foreground hover:bg-sidebar-row-hover hover:text-sidebar-foreground focus-within:bg-sidebar-row-hover"
85+
className="flex h-8 min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-sidebar-muted-foreground hover:bg-sidebar-row-hover hover:text-sidebar-foreground"
8786
>
8887
<SearchIcon className="size-4 shrink-0 text-[var(--sidebar-icon-color)]" />
8988
<Input
@@ -122,15 +121,18 @@ export function SidebarThreadHeader({
122121
<XIcon className="size-3" />
123122
</Button>
124123
) : null}
125-
{hasProjects ? projectScope : null}
126124
</div>
127-
{/* These actions stay outside the search surface and carry their own
128-
hover states. */}
125+
{/* Unfilled like the search field beside it: the buttons carry their own
126+
hover states, and a background well reads far louder on themed
127+
palettes than on the base light and dark ones. */}
129128
<div className="flex shrink-0 items-center">
130129
{hasProjects ? (
131-
<SidebarHeaderIconButton label="New project" onClick={onNewProject}>
132-
<FolderPlusIcon />
133-
</SidebarHeaderIconButton>
130+
<>
131+
{projectScope}
132+
<SidebarHeaderIconButton label="New project" onClick={onNewProject}>
133+
<FolderPlusIcon />
134+
</SidebarHeaderIconButton>
135+
</>
134136
) : null}
135137
<SidebarHeaderIconButton
136138
label="New thread"

0 commit comments

Comments
 (0)