Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.
Python agentagent-osaiai-agentsai-partnerchatopsclaudeclaude-codecodexdevtoolsdiscord-botlark-botllmlocal-firstlong-term-memoryopencodeslack-botvibe-codingvibeywechat
fix(chat): keep the Agent's name whole on a crowded composer row (#3001)
Call White14c9456e7f94
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.ymlindex d9d8e51e6..4a79cd22e 100644--- a/.github/workflows/lint.yml+++ b/.github/workflows/lint.yml@@ -203,7 +203,7 @@ jobs:npm run test:inbox-returnnpm run test:home-medianpm run test:badge-triggers- npm run test:workbench-general -- sidebar-floating.spec.ts desktop-window-chrome.spec.ts skills-dialog.spec.ts+ npm run test:workbench-general -- sidebar-floating.spec.ts desktop-window-chrome.spec.ts composer-route-trigger.spec.ts skills-dialog.spec.tsnpm run test:voice-shortcutnpm run test:chat-interactionsnpm run test:chat-selectiondiff --git a/ui/e2e/workbench-general/composer-route-trigger.spec.ts b/ui/e2e/workbench-general/composer-route-trigger.spec.tsnew file mode 100644index 000000000..59a88f26f--- /dev/null+++ b/ui/e2e/workbench-general/composer-route-trigger.spec.ts@@ -0,0 +1,144 @@+import { expect, test, type Locator, type Page } from '@playwright/test';+import { open, serveProduct } from './support';++// The composer's route trigger names who answers the next message. When the+// action row runs short — a phone with Queue and Stop showing beside Voice —+// detail gives way before the Agent: the effort first, then the model, each+// either whole or gone. The Agent's name is never cut.++const SESSION_ID = 'route-trigger-fixture';+const EFFORTS = ['low', 'medium', 'high', 'xhigh'].map((value) => ({ value, label: value }));++async function serveChat(page: Page, { running, agentName = 'pm-claude' }: { running: boolean; agentName?: string }) {+ const denied = await serveProduct(page);+ const session = {+ id: SESSION_ID, scope_id: 'fixture', project_id: 'proj-1', title: 'Route trigger',+ agent_id: 'agt-pm', agent_name: agentName, agent_backend: 'claude', model: 'claude-opus-4-7',+ reasoning_effort: 'xhigh', status: 'active', agent_status: running ? 'running' : 'idle', pinned: false,+ workdir: '/fixture/work', native_session_id: 'native-1', metadata: {},+ created_at: '2026-10-26T00:00:00Z', updated_at: '2026-10-26T00:00:00Z',+ };+ const turnState = {+ in_flight: running, foreground: running ? 'running' : 'idle', native_turn_started: running,+ pending_input_count: 0, background_activities: [], pending_activity_output_count: 0, connection: 'connected',+ };+ const agents = [{ id: 'agt-pm', name: agentName, backend: 'claude', enabled: true, model: 'claude-opus-4-7', reasoning_effort: 'xhigh' }];+ await page.route(`**/api/sessions/${SESSION_ID}/bootstrap`, (route) => route.fulfill({ json: {+ session, capabilities: { can_chat: true }, agents, default_agent_name: agentName, config: { ui: {} },+ messages: [], queued: [], next_after_id: null, next_before_id: null,+ draft: { text: '', updated_at: null }, turn_state: turnState,+ } }));+ await page.route(`**/api/sessions/${SESSION_ID}`, (route) => route.fulfill({ json: session }));+ await page.route(`**/api/sessions/${SESSION_ID}/queue`, (route) => route.fulfill({ json: [] }));+ await page.route(`**/api/sessions/${SESSION_ID}/turn-state`, (route) => route.fulfill({ json: turnState }));+ await page.route(`**/api/sessions/${SESSION_ID}/activity**`, (route) => route.fulfill({ json: { groups: [] } }));+ await page.route(`**/api/inbox/${SESSION_ID}/read`, (route) => route.fulfill({ json: { ok: true } }));+ await page.route('**/api/asr/status', (route) => route.fulfill({ json: { available: true } }));+ // The closed trigger names the model by its catalog label.+ await page.route('**/api/models/agents/**', (route) => route.fulfill({ json: { ok: false } }));+ await page.route('**/api/claude/models', (route) => route.fulfill({ json: {+ ok: true,+ models: ['claude-opus-4-7', 'claude-sonnet-4-6'],+ model_labels: { 'claude-opus-4-7': 'Claude Opus 4.7', 'claude-sonnet-4-6': 'Claude Sonnet 4.6' },+ reasoning_options: { 'claude-opus-4-7': EFFORTS, 'claude-sonnet-4-6': EFFORTS },+ } }));+ return denied;+}++type Box = { x: number; y: number; width: number; height: number };+const inside = (inner: Box, outer: Box) =>+ inner.x >= outer.x - 0.5 && inner.x + inner.width <= outer.x + outer.width + 0.5+ && inner.y >= outer.y - 0.5 && inner.y + inner.height <= outer.y + outer.height + 0.5;++/** Which detail parts show on the trigger's one visible line; fails on a part shown only in part. */+async function shownDetails(parts: Locator): Promise<string[]> {+ const clip = (await parts.boundingBox())!;+ const shown: string[] = [];+ for (const detail of await parts.locator('[data-route-detail]').all()) {+ const box = (await detail.boundingBox())!;+ const name = (await detail.getAttribute('data-route-detail'))!;+ if (box.y >= clip.y + clip.height - 0.5) continue; // wrapped onto the clipped line+ expect(inside(box, clip), `${name} is shown whole`).toBe(true);+ shown.push(name);+ }+ return shown;+}++const agentOf = (parts: Locator) => parts.locator(':scope > span:not([data-route-detail])');++/** The Agent outranks detail: its start is always shown, and it is cut only once no detail is left. */+async function expectAgentFirst(parts: Locator, name = 'pm-claude') {+ const agent = agentOf(parts);+ await expect(agent).toHaveText(name);+ expect(inside((await agent.boundingBox())!, (await parts.boundingBox())!)).toBe(true);+ const cut = await agent.evaluate((node) => node.scrollWidth > node.clientWidth);+ if (cut) expect(await shownDetails(parts)).toEqual([]);+ return cut;+}++async function expectAgentWhole(parts: Locator, name = 'pm-claude') {+ const agent = agentOf(parts);+ await expect(agent).toHaveText(name);+ expect(await agent.evaluate((node) => node.scrollWidth <= node.clientWidth)).toBe(true);+ expect(inside((await agent.boundingBox())!, (await parts.boundingBox())!)).toBe(true);+}++for (const width of [320, 390]) {+ test(`a ${width}px phone with Queue and Stop drops detail whole before touching the Agent's name`, async ({ page }) => {+ const denied = await serveChat(page, { running: true });+ await page.setViewportSize({ width, height: 760 });+ await open(page, `/chat/${SESSION_ID}`);+ await expect(page.getByRole('button', { name: 'Stop', exact: true })).toBeVisible();+ await page.locator('main [contenteditable="true"]').last().click();+ await page.keyboard.type('Run the next step after this one');+ await expect(page.getByRole('button', { name: 'Send to queue', exact: true })).toBeVisible();++ const trigger = page.locator('main').getByRole('button', { name: /pm-claude/ });+ const parts = trigger.locator('[data-route-trigger-parts]');+ await expectAgentFirst(parts);+ // A phone this size holds a short name whole; 320px is left to font metrics.+ if (width >= 390) await expectAgentWhole(parts);+ const shown = await shownDetails(parts);+ // Detail leaves in order: the effort never outlasts the model.+ expect(shown.includes('effort') ? shown.includes('model') : true).toBe(true);+ // The trigger shares the row without covering its neighbours.+ const triggerBox = (await trigger.boundingBox())!;+ const voiceBox = (await page.getByRole('button', { name: 'Voice input', exact: true }).boundingBox())!;+ expect(triggerBox.x + triggerBox.width).toBeLessThanOrEqual(voiceBox.x + 0.5);+ await page.screenshot({ path: `e2e/.artifacts/workbench-general/shots/composer-route-trigger-${width}.png` });+ expect(denied).toEqual([]);+ });+}++test('a roomy row shows the Agent, model and effort together', async ({ page }) => {+ const denied = await serveChat(page, { running: false });+ await page.setViewportSize({ width: 1200, height: 800 });+ await open(page, `/chat/${SESSION_ID}`);+ const parts = page.locator('main').getByRole('button', { name: /pm-claude/ }).locator('[data-route-trigger-parts]');+ await expect(parts.locator('[data-route-detail="model"]')).toHaveText('Claude Opus 4.7');+ await expectAgentWhole(parts);+ expect(await shownDetails(parts)).toEqual(['model', 'effort']);+ expect(denied).toEqual([]);+});++test('a name wider than a crowded phone row keeps its beginning and ends in an ellipsis', async ({ page }) => {+ const name = 'pm-claude-research-lead';+ const denied = await serveChat(page, { running: true, agentName: name });+ await page.setViewportSize({ width: 320, height: 760 });+ await open(page, `/chat/${SESSION_ID}`);+ await expect(page.getByRole('button', { name: 'Stop', exact: true })).toBeVisible();+ await page.locator('main [contenteditable="true"]').last().click();+ await page.keyboard.type('Run the next step after this one');+ await expect(page.getByRole('button', { name: 'Send to queue', exact: true })).toBeVisible();++ const parts = page.locator('main').getByRole('button', { name: new RegExp(name) }).locator('[data-route-trigger-parts]');+ const agent = agentOf(parts);+ await expect(agent).toHaveText(name);+ // The label fits the line it holds, so its start is never clipped away.+ expect(inside((await agent.boundingBox())!, (await parts.boundingBox())!)).toBe(true);+ expect(await agent.evaluate((node) => getComputedStyle(node).textOverflow)).toBe('ellipsis');+ expect(await agent.evaluate((node) => node.scrollWidth > node.clientWidth)).toBe(true);+ expect(await shownDetails(parts)).toEqual([]);+ await page.screenshot({ path: 'e2e/.artifacts/workbench-general/shots/composer-route-trigger-long-name.png' });+ expect(denied).toEqual([]);+});diff --git a/ui/src/components/workbench/AgentRoutePicker.tsx b/ui/src/components/workbench/AgentRoutePicker.tsxindex 03a466238..01330257e 100644--- a/ui/src/components/workbench/AgentRoutePicker.tsx+++ b/ui/src/components/workbench/AgentRoutePicker.tsx@@ -449,28 +449,62 @@ export const AgentRoutePicker: React.FC<AgentRoutePickerProps> = ({{getBackendUiMeta(backend).label}</span>)}- {/* The composer's quiet trigger names who answers; whether that Agent is- inherited from the default is the menu's Agent row to say. */}- <span className="truncate font-semibold text-foreground">{compact ? agentLabel : triggerLabel}</span>- {currentModel && (- <>- <span className="text-muted">·</span>- <span- className="truncate font-mono text-[10px] text-muted"- title={currentModelLabel !== currentModel ? currentModel : undefined}- >- {currentModelLabel}- </span>- </>- )}- {currentEffort && (+ {compact ? (+ /* The composer's quiet trigger names who answers; whether that Agent is+ inherited from the default is the menu's Agent row to say. When the+ action row runs short (a phone with Queue and Stop showing), detail+ gives way before the Agent: effort first, then the model. Each detail+ part that no longer fits wraps onto a second line this one-line box+ clips, so a detail is either whole or gone — never an ellipsis. */+ <span+ data-route-trigger-parts=""+ className="flex h-5 min-w-0 flex-wrap content-start items-center justify-end gap-x-1.5 overflow-hidden"+ >+ {/* The name keeps its line: detail wraps away first, and only a name+ wider than the whole row, or than 10rem, ends in an ellipsis. */}+ <span className="h-5 min-w-0 max-w-40 truncate font-semibold leading-5 text-foreground">{agentLabel}</span>+ {currentModel && (+ <span+ data-route-detail="model"+ className="h-5 shrink-0 whitespace-nowrap font-mono text-[10px] leading-5 text-muted before:mr-1.5 before:font-sans before:content-['·']"+ title={currentModelLabel !== currentModel ? currentModel : undefined}+ >+ {currentModelLabel}+ </span>+ )}+ {currentEffort && (+ <span+ data-route-detail="effort"+ className="h-5 shrink-0 whitespace-nowrap text-[10px] capitalize leading-5 text-muted before:mr-1.5 before:content-['·']"+ >+ {t(`chat.picker.effortOptions.${currentEffort}`, { defaultValue: currentEffort })}+ </span>+ )}+ </span>+ ) : (<>- <span className="text-muted">·</span>- {/* Localize via the same key the column uses so the closed trigger- doesn't show raw low/max in zh builds; unknown falls back to raw. */}- <span className="shrink-0 text-[10px] capitalize text-muted">- {t(`chat.picker.effortOptions.${currentEffort}`, { defaultValue: currentEffort })}- </span>+ <span className="truncate font-semibold text-foreground">{triggerLabel}</span>+ {currentModel && (+ <>+ <span className="text-muted">·</span>+ <span+ className="truncate font-mono text-[10px] text-muted"+ title={currentModelLabel !== currentModel ? currentModel : undefined}+ >+ {currentModelLabel}+ </span>+ </>+ )}+ {currentEffort && (+ <>+ <span className="text-muted">·</span>+ {/* Localize via the same key the column uses so the closed trigger+ doesn't show raw low/max in zh builds; unknown falls back to raw. */}+ <span className="shrink-0 text-[10px] capitalize text-muted">+ {t(`chat.picker.effortOptions.${currentEffort}`, { defaultValue: currentEffort })}+ </span>+ </>+ )}</>)}{/* In-flight feedback replaces the chevron rather than greying the menu: