Skip to content

Commit 7a4e2cb

Browse files
committed
fix(web): prevent composer project pill overlap
Constrain the project picker to its allocated toolbar width and let only the project name shrink. This keeps the project and model controls separated while preserving the full name in the tooltip.
1 parent c079b62 commit 7a4e2cb

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

apps/web/src/components/composer/project-picker-parts.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function ProjectPickerTrigger({
4444
aria-haspopup="menu"
4545
aria-label="Choose project"
4646
className={cn(
47-
"group/button relative isolate inline-flex h-8 min-w-0 shrink-0 cursor-pointer select-none items-center justify-center gap-1.5 overflow-hidden whitespace-nowrap rounded-full bg-background px-2.5 font-medium text-secondary-foreground text-sm transition duration-200 hover:bg-accent/70 hover:text-accent-foreground focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:ring-offset-1 active:scale-[0.99] disabled:pointer-events-none disabled:opacity-50 max-[340px]:max-w-[92px] max-[340px]:gap-1 max-[340px]:px-2 [&_svg]:pointer-events-none [&_svg]:shrink-0",
47+
"group/button relative isolate inline-flex h-8 w-full min-w-0 cursor-pointer select-none items-center justify-center gap-1.5 overflow-hidden whitespace-nowrap rounded-full bg-background px-2.5 font-medium text-secondary-foreground text-sm transition duration-200 hover:bg-accent/70 hover:text-accent-foreground focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:ring-offset-1 active:scale-[0.99] disabled:pointer-events-none disabled:opacity-50 max-[340px]:max-w-[92px] max-[340px]:gap-1 max-[340px]:px-2 [&_svg]:pointer-events-none [&_svg]:shrink-0",
4848
compact ? "max-w-[160px]" : "max-w-[220px]",
4949
)}
5050
data-variant={variant}
@@ -55,7 +55,7 @@ export function ProjectPickerTrigger({
5555
type="button"
5656
>
5757
<ProjectFolderIcon className="size-3.5 shrink-0 text-muted-foreground" />
58-
<span className="min-w-0 max-w-full truncate font-medium text-xs">
58+
<span className="min-w-0 flex-1 truncate font-medium text-xs">
5959
{selectedProject?.name ?? "Choose project"}
6060
</span>
6161
</button>

apps/web/src/components/composer/project-picker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function ProjectPicker({
2525
}) {
2626
const controller = useProjectPickerController({ onSelect, selectedProject });
2727
return (
28-
<div className="relative min-w-0" ref={controller.meta.menuRef}>
28+
<div className="relative min-w-0 max-w-full" ref={controller.meta.menuRef}>
2929
<ProjectPickerTrigger
3030
compact={compact}
3131
controller={controller}

0 commit comments

Comments
 (0)