Skip to content

Commit 12391bd

Browse files
gsimoneclaude
andauthored
feat(web): show project favicon in new-thread project picker (#10790)
Co-authored-by: Claude Fable 5.1 <[email protected]>
1 parent 4664c57 commit 12391bd

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

‎apps/web/src/components/chat/DraftHeroHeadline.tsx‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
} from "~/sidebarProjectGrouping";
1616
import { useProjects, useThreadShells } from "~/state/entities";
1717
import { useEnvironments, usePrimaryEnvironmentId } from "~/state/environments";
18+
import { ProjectFavicon } from "../ProjectFavicon";
1819
import { sortLogicalProjectsForSidebar } from "../Sidebar.logic";
1920
import {
2021
Menu,
@@ -114,11 +115,14 @@ export function DraftHeroHeadline({
114115
render={
115116
<MenuTrigger
116117
aria-label={hasResolvedProject ? "Change project" : "Choose a project"}
117-
className="pointer-events-auto inline-block max-w-64 truncate border-foreground/60 border-b border-dotted align-baseline text-foreground transition-colors hover:border-foreground/80 focus-visible:rounded-sm focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring"
118+
className="pointer-events-auto inline-flex max-w-64 items-center gap-2 border-foreground/60 border-b border-dotted align-baseline text-foreground transition-colors hover:border-foreground/80 focus-visible:rounded-sm focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring"
118119
/>
119120
}
120121
>
121-
{activeProjectDisplayName ?? "Choose a project"}
122+
{activeProjectGroup ? (
123+
<ProjectFavicon project={activeProjectGroup} className="size-6 shrink-0 sm:size-7" />
124+
) : null}
125+
<span className="min-w-0 truncate">{activeProjectDisplayName ?? "Choose a project"}</span>
122126
</TooltipTrigger>
123127
{activeProjectDisplayName ? (
124128
<TooltipPopup side="top" className="max-w-80">
@@ -164,7 +168,13 @@ export function DraftHeroHeadline({
164168
>
165169
{projectPickerEntries.map(({ group }) => {
166170
return (
167-
<MenuRadioItem key={group.projectKey} value={group.projectKey} closeOnClick>
171+
<MenuRadioItem
172+
key={group.projectKey}
173+
value={group.projectKey}
174+
closeOnClick
175+
className="[&>span:last-child]:flex [&>span:last-child]:min-w-0 [&>span:last-child]:items-center [&>span:last-child]:gap-2"
176+
>
177+
<ProjectFavicon project={group} className="size-4 shrink-0" />
168178
<Tooltip>
169179
<TooltipTrigger render={<span className="block min-w-0 truncate" />}>
170180
{group.displayName}

0 commit comments

Comments
 (0)