The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
refactor(desktop): share the composer's floating pill treatment
Brooklyn Nicholsona09ad04653f6
diff --git a/apps/desktop/src/app/chat/composer/micro-actions.tsx b/apps/desktop/src/app/chat/composer/micro-actions.tsxindex 6f8cc77ad56..65e3729eada 100644--- a/apps/desktop/src/app/chat/composer/micro-actions.tsx+++ b/apps/desktop/src/app/chat/composer/micro-actions.tsx@@ -1,5 +1,6 @@import { memo, useState } from 'react'+import { composerFloatingPill } from '@/components/chat/composer-dock'import { Codicon } from '@/components/ui/codicon'import { useSessionSlice } from '@/lib/use-session-slice'import { cn } from '@/lib/utils'@@ -7,11 +8,9 @@ import { $composerActionsBySession, type ComposerAction } from '@/store/composerimport { notifyError } from '@/store/notifications'/**- * Floating pill — the treatment the thread's jump/approval button uses for a- * control that sits over scrolling content: full radius, hairline border, the- * shared composer fill behind a blur so thread text never bleeds through.- * Sized against the composer's own control height so a row of pills lines up- * with the chrome it floats above.+ * Floating pill — the shared treatment for a control that sits over the+ * composer (`composerFloatingPill`), plus this strip's own width cap and+ * disabled state.** NEVER `pointer-events-none`, not even when disabled. The pop-out drag region* is an `absolute` sibling behind these pills, so a pill that stops taking@@ -19,10 +18,8 @@ import { notifyError } from '@/store/notifications'* becomes a grab handle that floats the composer.*/const PILL = cn(- 'inline-flex h-(--composer-control-size) max-w-56 shrink-0 cursor-pointer items-center gap-1.5 rounded-full px-2.5',- 'border border-border/65 bg-(--composer-fill) backdrop-blur-[0.75rem] [-webkit-backdrop-filter:blur(0.75rem)]',- 'text-xs font-normal text-(--ui-text-secondary) transition-colors',- 'hover:bg-(--chrome-action-hover) hover:text-foreground',+ composerFloatingPill,+ 'max-w-56','disabled:cursor-default disabled:opacity-50 disabled:hover:bg-(--composer-fill)','focus-visible:outline-none focus-visible:ring-[0.1875rem] focus-visible:ring-ring/50')diff --git a/apps/desktop/src/components/chat/composer-dock.ts b/apps/desktop/src/components/chat/composer-dock.tsindex 88db91d2dac..3d2a045b712 100644--- a/apps/desktop/src/components/chat/composer-dock.ts+++ b/apps/desktop/src/components/chat/composer-dock.ts@@ -34,6 +34,23 @@ export const composerPanelCard = cn(composerSurfaceGlass)+/**+ * A quiet control floating over composer content — the micro-action pills above+ * the surface, the Open affordance on a hovered link inside it. Full radius,+ * hairline border, the composer's own fill behind a blur so the text underneath+ * never shows through. Sized against the composer's control height so a pill+ * lines up with the chrome it floats above.+ *+ * Skin and size only; the call site owns position, width caps, and disabled+ * state.+ */+export const composerFloatingPill = cn(+ 'inline-flex h-(--composer-control-size) shrink-0 cursor-pointer items-center gap-1.5 rounded-full px-2.5',+ 'border border-border/65 bg-(--composer-fill) backdrop-blur-[0.75rem] [-webkit-backdrop-filter:blur(0.75rem)]',+ 'text-xs font-normal text-(--ui-text-secondary) transition-colors',+ 'hover:bg-(--chrome-action-hover) hover:text-foreground'+)+/*** Shared grid for the chrome-free floating strips that bracket the composer —* the micro-action pills above the surface and the `composer.underside` slot