= ({
* hide and reorder via CSS. The pill is invisible
* when there's no overflow but still occupies
* layout space, preventing measurement flicker. */}
- {workspace && workspaceAgent && chatId && (
-
-
-
- )}
{allBadges.map((badge, i) => {
const isOverflow = overflowCount > 0 && i >= visibleCount;
+ if (
+ badge === workspacePillBadge &&
+ workspace &&
+ workspaceAgent &&
+ chatId
+ ) {
+ return (
+
+
+
+ );
+ }
return (
= ({
role="combobox"
type="button"
variant="subtle"
+ // min-w floor: ~8ch of the label plus 3.125rem of fixed chrome
+ // stay visible before truncation kicks in.
className={cn(
- "h-7 min-w-0 shrink justify-start gap-1 rounded-full border-0 bg-surface-secondary px-2 py-0.5 text-xs font-medium shadow-none transition-colors hover:bg-surface-tertiary hover:text-content-primary focus:ring-0 focus-visible:ring-2 focus-visible:ring-content-link [&>svg]:!size-3.5 [&>svg]:p-0 [&>svg]:shrink-0 [&>svg]:transition [&>svg]:hover:text-content-primary [&>img]:!size-3 [&>img]:!p-0",
+ "h-7 min-w-[calc(8ch_+_3.125rem)] shrink justify-start gap-1 rounded-full border-0 bg-surface-secondary px-2 py-0.5 text-xs font-medium shadow-none transition-colors hover:bg-surface-tertiary hover:text-content-primary focus:ring-0 focus-visible:ring-2 focus-visible:ring-content-link [&>svg]:!size-3.5 [&>svg]:p-0 [&>svg]:shrink-0 [&>svg]:transition [&>svg]:hover:text-content-primary [&>img]:!size-3 [&>img]:!p-0",
className,
)}
onTouchStart={onTriggerTouchStart}
@@ -196,11 +198,9 @@ export const ModelSelector: FC = ({
contentClassName,
)}
onOpenAutoFocus={(event) => {
- // On touch devices, auto-focusing the search input pops the
- // software keyboard as soon as the picker opens, hiding the
- // model list behind it. Only keep the WAI-ARIA combobox
- // focus-into-input behavior for fine pointers (keyboard and
- // mouse users on desktop).
+ // Touch devices auto-focus search on open, and the software
+ // keyboard hides the model list. Keep the WAI-ARIA combobox
+ // focus-into-input behavior for fine pointers only.
if (matchMedia("(pointer: coarse)").matches) {
event.preventDefault();
}
diff --git a/site/src/pages/AgentsPage/components/WorkspacePill.tsx b/site/src/pages/AgentsPage/components/WorkspacePill.tsx
index c72851e8835..fb3eb8131b7 100644
--- a/site/src/pages/AgentsPage/components/WorkspacePill.tsx
+++ b/site/src/pages/AgentsPage/components/WorkspacePill.tsx
@@ -126,7 +126,10 @@ export const WorkspacePill: FC = ({
}
}}
>
-
+ {/* Floor of ~8ch of name + 3.125rem chrome (padding, status icon,
+ * gaps, chevron). Below the floor the overflow system moves the
+ * pill into the +N popover instead of shrinking it further. */}
+
setTooltipOpen(v && !open)}
@@ -137,29 +140,22 @@ export const WorkspacePill: FC = ({
type="button"
aria-label={`${workspace.name} workspace menu`}
className={cn(
- "inline-flex min-w-0 cursor-pointer items-center justify-center gap-1 rounded-full border-0 bg-transparent p-0 text-xs font-medium text-content-secondary transition-colors hover:bg-surface-tertiary hover:text-content-primary",
- "size-7 md:size-auto md:max-w-[200px] md:justify-start md:px-2 md:py-0.5",
+ "inline-flex min-w-0 cursor-pointer items-center justify-start gap-1 rounded-full border-0 bg-transparent p-0 text-xs font-medium text-content-secondary transition-colors hover:bg-surface-tertiary hover:text-content-primary",
+ "h-7 w-full max-w-[200px] px-2 py-0.5",
)}
>
-
-
- {workspace.name}
-
+
+ {workspace.name}
-
- {statusLabel}
-
+ {statusLabel}