feat(web): show project favicon in new-thread project picker (#10790)
Co-authored-by: Claude Fable 5.1 <[email protected]>
This commit is contained in:
1 parent
4664c572a7
commit
12391bd0d3
1 file changed
+13
-3
@@ -15,6 +15,7 @@ import {
|
||||
} from "~/sidebarProjectGrouping";
|
||||
import { useProjects, useThreadShells } from "~/state/entities";
|
||||
import { useEnvironments, usePrimaryEnvironmentId } from "~/state/environments";
|
||||
import { ProjectFavicon } from "../ProjectFavicon";
|
||||
import { sortLogicalProjectsForSidebar } from "../Sidebar.logic";
|
||||
import {
|
||||
Menu,
|
||||
@@ -114,11 +115,14 @@ export function DraftHeroHeadline({
|
||||
render={
|
||||
<MenuTrigger
|
||||
aria-label={hasResolvedProject ? "Change project" : "Choose a project"}
|
||||
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"
|
||||
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"
|
||||
/>
|
||||
}
|
||||
>
|
||||
{activeProjectDisplayName ?? "Choose a project"}
|
||||
{activeProjectGroup ? (
|
||||
<ProjectFavicon project={activeProjectGroup} className="size-6 shrink-0 sm:size-7" />
|
||||
) : null}
|
||||
<span className="min-w-0 truncate">{activeProjectDisplayName ?? "Choose a project"}</span>
|
||||
</TooltipTrigger>
|
||||
{activeProjectDisplayName ? (
|
||||
<TooltipPopup side="top" className="max-w-80">
|
||||
@@ -164,7 +168,13 @@ export function DraftHeroHeadline({
|
||||
>
|
||||
{projectPickerEntries.map(({ group }) => {
|
||||
return (
|
||||
<MenuRadioItem key={group.projectKey} value={group.projectKey} closeOnClick>
|
||||
<MenuRadioItem
|
||||
key={group.projectKey}
|
||||
value={group.projectKey}
|
||||
closeOnClick
|
||||
className="[&>span:last-child]:flex [&>span:last-child]:min-w-0 [&>span:last-child]:items-center [&>span:last-child]:gap-2"
|
||||
>
|
||||
<ProjectFavicon project={group} className="size-4 shrink-0" />
|
||||
<Tooltip>
|
||||
<TooltipTrigger render={<span className="block min-w-0 truncate" />}>
|
||||
{group.displayName}
|
||||
|
||||
Reference in new issue
Block a user