Skip to content

armgit / avibe

Public Imported from GitHub
0

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.

fix(ui): center single-line queued message text (#2055)

Call White3994d18df8bf
diff --git a/ui/e2e/queue-attachments/fixture.tsx b/ui/e2e/queue-attachments/fixture.tsx
index 7bd93b23d..09e23ff1a 100644
--- a/ui/e2e/queue-attachments/fixture.tsx
+++ b/ui/e2e/queue-attachments/fixture.tsx
@@ -68,6 +68,12 @@ const LONG_IMAGE = 'q3-2026-customer-onboarding-migration-runbook-screenshot-fin
const QUEUE: WorkbenchMessage[] = [
queued('q-text', 'A queued message with no files at all'),
+ queued(
+ 'q-long-text',
+ 'A queued message that becomes a long readable paragraph when expanded so its row actions stay beside the first visible line while the text continues below. '.repeat(
+ 4,
+ ),
+ ),
queued('q-image', '', [media('med_1', 'annotation-region.png')]),
queued('q-mixed', 'Compare these against the spec', FIVE),
queued('q-broken', '', [media('med_broken', 'console-log.png')]),
diff --git a/ui/e2e/queue-attachments/previews.spec.ts b/ui/e2e/queue-attachments/previews.spec.ts
index f58ee5074..4df3df7b8 100644
--- a/ui/e2e/queue-attachments/previews.spec.ts
+++ b/ui/e2e/queue-attachments/previews.spec.ts
@@ -44,6 +44,7 @@ const LONG_IMAGE = 'q3-2026-customer-onboarding-migration-runbook-screenshot-fin
// is what keeps the image-only rows — which have no text of their own — reachable.
const ORDER = [
'q-text',
+ 'q-long-text',
'q-image',
'q-mixed',
'q-broken',
@@ -139,6 +140,33 @@ test('a queued image is visible, 20px, centred, and costs the row no height', as
.toBeGreaterThan(0);
});
+test('a single-line queued message is vertically centred in its row', async ({ page }) => {
+ const queuedRow = await boxOf(row(page, 'q-text'), 'the text-only row');
+ const text = await boxOf(row(page, 'q-text').locator('div[role="button"]'), 'the queued message text');
+ const rowCentre = queuedRow.y + queuedRow.height / 2;
+ const textCentre = text.y + text.height / 2;
+
+ await expect(row(page, 'q-text')).toHaveCSS('align-items', 'center');
+ expect(Math.abs(textCentre - rowCentre)).toBeLessThanOrEqual(1);
+});
+
+test('expanded rows keep short text centred and actions at the first line', async ({ page }) => {
+ const shortRow = row(page, 'q-text');
+ await activate(page, shortRow.locator('div[role="button"]'));
+ const shortRowBox = await boxOf(shortRow, 'the expanded short row');
+ const shortTextBox = await boxOf(shortRow.locator('div[role="button"]'), 'the expanded short text');
+ expect(Math.abs(shortTextBox.y + shortTextBox.height / 2 - (shortRowBox.y + shortRowBox.height / 2))).toBeLessThanOrEqual(1);
+
+ const longRow = row(page, 'q-long-text');
+ await activate(page, longRow.locator('div[role="button"]'));
+ const longRowBox = await boxOf(longRow, 'the expanded long row');
+ const removeBox = await boxOf(
+ longRow.getByRole('button', { name: 'Remove from queue' }),
+ 'the expanded long row action',
+ );
+ expect(Math.abs(removeBox.y - (longRowBox.y + 6))).toBeLessThanOrEqual(1);
+});
+
test('an image-only queued message still says what it is', async ({ page }) => {
await expect(row(page, 'q-image')).toContainText('annotation-region.png');
});
diff --git a/ui/src/components/workbench/ChatPage.tsx b/ui/src/components/workbench/ChatPage.tsx
index 9161874dd..b43b6542d 100644
--- a/ui/src/components/workbench/ChatPage.tsx
+++ b/ui/src/components/workbench/ChatPage.tsx
@@ -3103,11 +3103,13 @@ export const QueueRow: React.FC<{
count: attachments.length - 1,
})
: named.name || t('chat.queue.attachments.untitled'));
+ const hasExpandedContent = expanded || attachmentsOpen;
return (
<div
data-queue-row="true"
className={clsx(
- 'relative flex items-start gap-2 px-2.5 py-1.5 transition-[background-color,box-shadow,border-radius] hover:z-10 hover:rounded-lg hover:bg-surface-1 hover:ring-1 hover:ring-border focus-within:z-10 focus-within:rounded-lg focus-within:bg-surface-1 focus-within:ring-1 focus-within:ring-border motion-reduce:transition-none',
+ 'relative flex gap-2 px-2.5 py-1.5 transition-[background-color,box-shadow,border-radius] hover:z-10 hover:rounded-lg hover:bg-surface-1 hover:ring-1 hover:ring-border focus-within:z-10 focus-within:rounded-lg focus-within:bg-surface-1 focus-within:ring-1 focus-within:ring-border motion-reduce:transition-none',
+ hasExpandedContent ? 'items-start' : 'items-center',
// Wrapping is enabled only while the remainder is disclosed. A collapsed
// row therefore cannot wrap at any width — the one thing that could make
// it taller than a text-only row is off unless the reader asked for it.
@@ -3127,8 +3129,8 @@ export const QueueRow: React.FC<{
}}
aria-expanded={expanded}
className={clsx(
- 'min-w-0 flex-1 cursor-pointer select-text text-left text-[12px] text-foreground',
- expanded ? 'whitespace-pre-wrap break-words' : 'truncate',
+ 'min-w-0 flex-1 cursor-pointer select-text text-left text-[12px] leading-6 text-foreground',
+ expanded ? 'self-center whitespace-pre-wrap break-words' : 'truncate',
)}
>
{annotationView && (