Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
fix(ui): match the attach icon to the mic in composers (MUL-9264) (#10602)
Jiayuan Zhang8fc629ee136f
diff --git a/apps/storybook/src/comment-box/parts.tsx b/apps/storybook/src/comment-box/parts.tsxindex e708b973ec..bd688affe8 100644--- a/apps/storybook/src/comment-box/parts.tsx+++ b/apps/storybook/src/comment-box/parts.tsx@@ -155,7 +155,7 @@ export function AttachButton({ small = false, className }: { small?: boolean; clconst { t } = useCopy();return (<IconButton label={t(TEXT.attach)} size={small ? "icon-xs" : "icon-sm"} className={cn("text-muted-foreground", className)}>- <Paperclip className={small ? "size-3.5" : "size-4"} />+ <Paperclip className={small ? "size-3.5" : undefined} /></IconButton>);}diff --git a/packages/ui/components/common/file-upload-button.tsx b/packages/ui/components/common/file-upload-button.tsxindex 63dd1a1d8b..68d2395772 100644--- a/packages/ui/components/common/file-upload-button.tsx+++ b/packages/ui/components/common/file-upload-button.tsx@@ -33,9 +33,11 @@ function FileUploadButton({for (const file of files) onSelect(file);};- // `size-*`, not `h-* w-*`: the icon button's own `[&_svg:not([class*='size-'])]`- // rule would otherwise override it (icon-xs forces 12px).- const iconSize = size === "sm" ? "size-3.5" : "size-4";+ // The default size takes the button's own icon size so it matches the+ // composer's other icon buttons (the mic). `sm` needs `size-*`, not+ // `h-* w-*`: the button's `[&_svg:not([class*='size-'])]` rule would+ // otherwise override it (icon-xs forces 12px).+ const iconSize = size === "sm" ? "size-3.5" : undefined;const buttonSize = size === "sm" ? "icon-xs" : "icon-sm";return (diff --git a/packages/views/modals/create-issue.test.tsx b/packages/views/modals/create-issue.test.tsxindex 8585e38d44..b8efbaf48b 100644--- a/packages/views/modals/create-issue.test.tsx+++ b/packages/views/modals/create-issue.test.tsx@@ -836,10 +836,10 @@ describe("CreateIssueModal", () => {}));});- it("uses the same compact attachment control as agent mode", () => {+ it("uses the same attachment control as agent mode, sized to match the mic", () => {renderModal(<CreateIssueModal onClose={vi.fn()} />);- expect(screen.getByRole("button", { name: "Upload file" })).toHaveAttribute("data-size", "sm");+ expect(screen.getByRole("button", { name: "Upload file" })).not.toHaveAttribute("data-size");});it("shows success feedback with a direct path to the new issue", async () => {diff --git a/packages/views/modals/create-issue.tsx b/packages/views/modals/create-issue.tsxindex 904986a7cd..d37d55e86d 100644--- a/packages/views/modals/create-issue.tsx+++ b/packages/views/modals/create-issue.tsx@@ -1512,7 +1512,6 @@ export function ManualCreatePanel({<div className="grid grid-cols-[auto_1fr] items-center gap-x-2 gap-y-2.5 border-t px-4 py-3 shrink-0 sm:flex sm:flex-wrap"><div className="flex min-h-7 items-center gap-2 sm:mr-auto"><FileUploadButton- size="sm"multipleonSelect={(file) => descEditorRef.current?.uploadFile(file)}/>diff --git a/packages/views/modals/quick-create-issue.test.tsx b/packages/views/modals/quick-create-issue.test.tsxindex 54c26852e1..52ac577f10 100644--- a/packages/views/modals/quick-create-issue.test.tsx+++ b/packages/views/modals/quick-create-issue.test.tsx@@ -1353,7 +1353,7 @@ describe("AgentCreatePanel", () => {expect(create.parentElement).toBe(footer);expect(keepOpen.parentElement?.parentElement).toBe(footer);expect(attach.parentElement?.parentElement).toBe(footer);- expect(attach).toHaveAttribute("data-size", "sm");+ expect(attach).not.toHaveAttribute("data-size");});});});diff --git a/packages/views/modals/quick-create-issue.tsx b/packages/views/modals/quick-create-issue.tsxindex a1517e3422..5b45c94c09 100644--- a/packages/views/modals/quick-create-issue.tsx+++ b/packages/views/modals/quick-create-issue.tsx@@ -953,7 +953,6 @@ export function AgentCreatePanel({own queue entry, so queueing a second one is safe and waitingfor the first to land just to attach the next is busywork. */}<FileUploadButton- size="sm"multipleonSelect={(file) => editorRef.current?.uploadFile(file)}/>