From edc6cc007dd7cc1564529eb4525cedcfed3eba84 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Mon, 27 Jul 2026 18:11:40 -0700 Subject: [PATCH] fix(new-workspace): center agent selection in create dialog (#11020) * fix(new-workspace): center agent selection in create dialog Pin the Agent combobox mark to 14px, drop residual button padding, and use a full-width min-w-0 trigger so icon, label, and chevron align with Project/Name in the new worktree dialog. * fix(new-workspace): optically align agent picker content * fix(new-workspace): center selected agent content --- .../components/NewWorkspaceComposerCard.tsx | 6 +- .../components/agent/AgentCombobox.test.tsx | 40 +++++++++++++ .../src/components/agent/AgentCombobox.tsx | 57 ++++++++++++------- 3 files changed, 82 insertions(+), 21 deletions(-) diff --git a/src/renderer/src/components/NewWorkspaceComposerCard.tsx b/src/renderer/src/components/NewWorkspaceComposerCard.tsx index 062714ff6..0fdcc3459 100644 --- a/src/renderer/src/components/NewWorkspaceComposerCard.tsx +++ b/src/renderer/src/components/NewWorkspaceComposerCard.tsx @@ -1421,7 +1421,7 @@ export default function NewWorkspaceComposerCard({ -
+
diff --git a/src/renderer/src/components/agent/AgentCombobox.test.tsx b/src/renderer/src/components/agent/AgentCombobox.test.tsx index a5c3e205e..4ef8f7a65 100644 --- a/src/renderer/src/components/agent/AgentCombobox.test.tsx +++ b/src/renderer/src/components/agent/AgentCombobox.test.tsx @@ -21,6 +21,46 @@ describe('AgentCombobox', () => { expect(markup).toContain('flex-1') }) + it('centers the selected agent mark and label inside a full-width form trigger', () => { + const markup = renderToStaticMarkup( + + ) + + expect(markup).toContain('Codex') + expect(markup).not.toContain('!min-w-[260px]') + expect(markup).toContain('min-w-0 w-full') + expect(markup).toContain('leading-none') + expect(markup).toContain('size-3.5 shrink-0') + expect(markup).not.toContain('translate-y') + // Why: React HTML-escapes `[`/`&` in class strings during static markup. + expect(markup).toContain('size-3.5!') + }) + + it('uses the same centered 14px layout for every agent mark', () => { + for (const agent of AGENT_CATALOG) { + const markup = renderToStaticMarkup( + + ) + + expect(markup).toContain(agent.label) + expect(markup).toContain('size-3.5 shrink-0') + expect(markup).not.toContain('translate-y') + expect(markup).toContain('width="14"') + expect(markup).toContain('height="14"') + } + }) + it('supports an Agent-only empty state without presenting a blank terminal', () => { const markup = renderToStaticMarkup( + + {icon} + + {label} + + ) +} + function renderItem({ key, itemValue, @@ -86,11 +103,10 @@ function renderItem({ onSelect={onSelect} className="items-center gap-2 px-3 py-1.5" > - - - {icon} - {label} - + + ) if (!onSetDefault) { @@ -268,7 +284,9 @@ export default function AgentCombobox({ ) return ( -
+ // Why: min-w-0 lets full-width form rows shrink; plain flex+items-center left the + // trigger free to overflow its dialog column and look misaligned with Project/Name. +