diff --git a/ui/src/components/task-chat/ComposerRunSettingsPicker.test.tsx b/ui/src/components/task-chat/ComposerRunSettingsPicker.test.tsx index e09a165b4c..3185f1d905 100644 --- a/ui/src/components/task-chat/ComposerRunSettingsPicker.test.tsx +++ b/ui/src/components/task-chat/ComposerRunSettingsPicker.test.tsx @@ -55,6 +55,21 @@ afterEach(() => { }); describe("composer assignee picker", () => { + it("lets the assignee and model use the available composer width", () => { + render(vi.fn(), vi.fn()); + const trigger = container!.querySelector('[data-testid="task-chat-composer-assignee"]'); + const assignee = trigger!.querySelector('[data-testid="task-chat-composer-assignee-label"]'); + const model = trigger!.querySelector('[data-testid="task-chat-composer-model-label"]'); + + expect(trigger?.className).toContain("max-w-full"); + expect(trigger?.className).not.toContain("max-w-64"); + expect(assignee?.className).toContain("min-w-0"); + expect(assignee?.className).not.toContain("max-w-24"); + expect(model?.className).toContain("min-w-0"); + expect(assignee?.className).toContain("truncate"); + expect(model?.className).toContain("truncate"); + }); + it("finds assignees by their displayed role and harness", async () => { render(vi.fn(), vi.fn()); await click("Select assignee, model and effort"); diff --git a/ui/src/components/task-chat/ComposerRunSettingsPicker.tsx b/ui/src/components/task-chat/ComposerRunSettingsPicker.tsx index f3b6025126..63f42235d2 100644 --- a/ui/src/components/task-chat/ComposerRunSettingsPicker.tsx +++ b/ui/src/components/task-chat/ComposerRunSettingsPicker.tsx @@ -167,10 +167,10 @@ export function ComposerRunSettingsPicker({ const reset = () => onSettingsChange(DEFAULT_COMPOSER_RUN_SETTINGS); const closeButton = mobile ? : null; const trigger = ; diff --git a/ui/storybook/prototypes/composer-model-picker/fixtures.ts b/ui/storybook/prototypes/composer-model-picker/fixtures.ts index c194f2b773..2ea83b9771 100644 --- a/ui/storybook/prototypes/composer-model-picker/fixtures.ts +++ b/ui/storybook/prototypes/composer-model-picker/fixtures.ts @@ -86,6 +86,9 @@ export const composerAgents: ComposerAgent[] = [ { id: "kimi-code/kimi-for-coding", label: "K2.8 Preview" }, { id: "kimi-code/k3", label: "K3" }, ], manualPattern: "kimi-code/model" }, + { id: "long-labels", name: "Alexandra Engineering Coordinator", role: "Engineering", harness: "Codex", adapterType: "codex_local", defaultModel: "gpt-5.6-sol", models: [ + { id: "gpt-5.6-sol", label: "GPT-5.6 Sol Extended Context Preview", detail: "Agent default" }, + ], manualPattern: "Model ID, e.g. gpt-5.6-sol" }, ]; /** Share the capsule-avatar palettes used by the agent persona stories. */ diff --git a/ui/storybook/stories/composer-model-picker.stories.tsx b/ui/storybook/stories/composer-model-picker.stories.tsx index dbe7cf8c05..391eddb75c 100644 --- a/ui/storybook/stories/composer-model-picker.stories.tsx +++ b/ui/storybook/stories/composer-model-picker.stories.tsx @@ -414,3 +414,27 @@ export const ProductionIntermediateWidthPlan: Story = { await expect(screen.getByTestId("composer-model-popover")).toBeVisible(); }, }; + +export const ProductionLongLabelsWide: Story = { + name: "25 · Long labels with available space", + render: () => , + play: async ({ canvasElement }) => { + const screen = within(canvasElement.ownerDocument.body); + const assignee = screen.getByTestId("task-chat-composer-assignee-label"); + const model = screen.getByTestId("task-chat-composer-model-label"); + await expect(assignee.scrollWidth).toBeLessThanOrEqual(assignee.clientWidth); + await expect(model.scrollWidth).toBeLessThanOrEqual(model.clientWidth); + }, +}; + +export const ProductionLongLabelsConstrained: Story = { + name: "25b · Long labels constrained by Plan mode", + render: () => , + play: async ({ canvasElement }) => { + const screen = within(canvasElement.ownerDocument.body); + const assignee = screen.getByTestId("task-chat-composer-assignee-label"); + const model = screen.getByTestId("task-chat-composer-model-label"); + await expect(assignee.scrollWidth > assignee.clientWidth || model.scrollWidth > model.clientWidth).toBe(true); + await expect(screen.getByRole("button", { name: "Remove Plan mode" })).toBeVisible(); + }, +};