|
2 | 2 | * The sidebar header: one row holding search, project scope and new thread. |
3 | 3 | * |
4 | 4 | * 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. |
7 | 6 | * The scope icon swaps to the project favicon while a project is selected, |
8 | 7 | * so the header still names the scope after the row that showed it is gone. |
9 | 8 | * |
@@ -31,7 +30,7 @@ export interface SidebarThreadHeaderProps { |
31 | 30 | searchFieldRef?: RefObject<HTMLDivElement | null>; |
32 | 31 | /** Without projects there is nothing to scope, so those controls stay out. */ |
33 | 32 | 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. */ |
35 | 34 | projectScope: ReactNode; |
36 | 35 | onNewProject: () => void; |
37 | 36 | /** Receives the click so Shift+click can skip the project picker. */ |
@@ -83,7 +82,7 @@ export function SidebarThreadHeader({ |
83 | 82 | <div className="flex items-center gap-1"> |
84 | 83 | <div |
85 | 84 | 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" |
87 | 86 | > |
88 | 87 | <SearchIcon className="size-4 shrink-0 text-[var(--sidebar-icon-color)]" /> |
89 | 88 | <Input |
@@ -122,15 +121,18 @@ export function SidebarThreadHeader({ |
122 | 121 | <XIcon className="size-3" /> |
123 | 122 | </Button> |
124 | 123 | ) : null} |
125 | | - {hasProjects ? projectScope : null} |
126 | 124 | </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. */} |
129 | 128 | <div className="flex shrink-0 items-center"> |
130 | 129 | {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 | + </> |
134 | 136 | ) : null} |
135 | 137 | <SidebarHeaderIconButton |
136 | 138 | label="New thread" |
|
0 commit comments