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(setup): draw Vibey's plan in the story's skeleton language (#2712)

Maxf2fa8dba7ad1
diff --git a/ui/e2e/onboarding-fidelity/lineup.spec.ts b/ui/e2e/onboarding-fidelity/lineup.spec.ts
index 47be2c8f9..0a51d58f6 100644
--- a/ui/e2e/onboarding-fidelity/lineup.spec.ts
+++ b/ui/e2e/onboarding-fidelity/lineup.spec.ts
@@ -3,7 +3,7 @@
// models never has the shell's aside drawn over it while the action stays where every
// screen puts it. Hermetic: every read is answered here and every write is refused.
import { expect, test, type Page } from '@playwright/test';
-import { PHASES, freezeAt, openOnboarding, openSetup, serveProduct } from './support';
+import { PHASES, VIEWPORTS, freezeAt, openOnboarding, openSetup, serveProduct, size } from './support';
import { CONTRACT_VERSION } from '../../src/components/settings/models/types';
const LINEUP = ['vibey', 'claude', 'codex', 'opencode'];
@@ -97,6 +97,56 @@ test('the lineup stands the built-in assistant first, on the reference tracks of
await expect(page.locator('.setup-destination').first()).toContainText('Built-in');
});
+/**
+ * The coordinator's card draws its plan in the same language as the work the other cards
+ * show, and no card's work is cut off by the box it is drawn in. Every row is checked
+ * against every clipping box between it and its card, the card included, so a row that
+ * reaches past a clipped skeleton fails here however the skeleton is laid out.
+ */
+for (const viewport of VIEWPORTS) {
+ test(`${size(viewport)}: the plan wears each assistant's mark and every card's work is drawn whole`, async ({ page }) => {
+ await page.setViewportSize(viewport);
+ const denied = await serveProduct(page);
+ await openOnboarding(page, { lang: 'zh' });
+ await freezeAt(page, PHASES['tests-running']);
+
+ // One plan row per assistant the coordinator hands a part to, in the lineup's order,
+ // each wearing the mark that assistant's own card wears — and no type to truncate.
+ const marks = await page.locator('.onboarding-collaboration-card').evaluateAll((cards) => {
+ const mark = (node: Element | null) => node?.querySelector('svg path')?.getAttribute('d') ?? null;
+ const plan = [...cards[0].querySelectorAll('.onboarding-handoff-row')];
+ return {
+ plan: plan.map((row) => mark(row.querySelector('.onboarding-handoff-mark'))),
+ cards: cards.slice(1).map((card) => mark(card.querySelector('.onboarding-card-logo'))),
+ text: plan.map((row) => row.textContent?.trim() ?? ''),
+ };
+ });
+ expect(marks.plan).toEqual(marks.cards);
+ expect(marks.plan.every(Boolean)).toBe(true);
+ expect(marks.text.every((text) => text === '')).toBe(true);
+
+ const clipped = await page.locator('.onboarding-collaboration-card').evaluateAll((cards) => cards.flatMap((card) =>
+ [...card.querySelectorAll('.onboarding-skeleton > *')].flatMap((row, index) => {
+ const box = row.getBoundingClientRect();
+ const cuts: string[] = [];
+ for (let node = row.parentElement; node; node = node.parentElement) {
+ const style = getComputedStyle(node);
+ const edge = node.getBoundingClientRect();
+ const inner = {
+ left: edge.left + parseFloat(style.borderLeftWidth), right: edge.right - parseFloat(style.borderRightWidth),
+ top: edge.top + parseFloat(style.borderTopWidth), bottom: edge.bottom - parseFloat(style.borderBottomWidth),
+ };
+ if (style.overflowX !== 'visible' && (box.left < inner.left - 0.5 || box.right > inner.right + 0.5)) cuts.push('x');
+ if (style.overflowY !== 'visible' && (box.top < inner.top - 0.5 || box.bottom > inner.bottom + 0.5)) cuts.push('y');
+ if (node === card) break;
+ }
+ return cuts.length ? [`${card.getAttribute('data-backend')} row ${index + 1}: ${cuts.join('')}`] : [];
+ })));
+ expect(clipped).toEqual([]);
+ expect(denied).toEqual([]);
+ });
+}
+
/**
* The caption is a row of the assistants' own grid and OpenCode asks for its permission in
* its own card, so nothing is drawn over a card at any band; every band reserves both and
diff --git a/ui/src/components/onboarding/CollaborationStory.tsx b/ui/src/components/onboarding/CollaborationStory.tsx
index 2a7a9721f..3952e75ea 100644
--- a/ui/src/components/onboarding/CollaborationStory.tsx
+++ b/ui/src/components/onboarding/CollaborationStory.tsx
@@ -1,5 +1,5 @@
import { useEffect, useId, useLayoutEffect, useRef, useState } from 'react';
-import { ArrowRight, Check, CodeXml, ListChecks, ScanEye, Split, type LucideIcon } from 'lucide-react';
+import { Check, CodeXml, ListChecks, ScanEye, Split, type LucideIcon } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { getBackendUiMeta } from '@/lib/agentBackends';
import { BackendIcon } from '../visual';
@@ -76,6 +76,8 @@ const CODE_BARS: [number, number][] = [[24.3, 30.4], [18.1, 43.3], [29.2, 23], [
/** The review reads a diff: the second line removed, the two after it added. */
const REVIEW_DIFF: Partial<Record<number, 'removed' | 'added'>> = { 1: 'removed', 2: 'added', 3: 'added' };
const TEST_BARS = [73.2, 61.6, 82.3, 54.5];
+/** One task line per assistant the coordinator hands a part to, in `ASSISTANT_ORDER`. */
+const HANDOFF_BARS = [68.4, 52.7, 76.1];
function CodeRows({ written, diff }: { written: number; diff?: typeof REVIEW_DIFF }) {
return (
@@ -96,16 +98,17 @@ function CodeRows({ written, diff }: { written: number; diff?: typeof REVIEW_DIF
}
function Skeleton({ work, active, done, written }: { work: StoryWork; active: boolean; done: boolean; written: number }) {
- const { t } = useTranslation();
if (work === 'handoffs') {
- // One row per assistant the coordinator hands a part to, revealed as it plans.
+ // One row per assistant the coordinator hands a part to, revealed as it plans: the
+ // assistant's mark — the one its own card wears — beside its task as a skeleton line,
+ // in the same drawn language as the work the other cards show. The step and the name
+ // are already each card's role and title, so the plan does not restate them in type.
return (
<div className="onboarding-skeleton onboarding-skeleton-handoffs">
{ASSISTANT_ORDER.map((backend, index) => (
<div key={backend} className={`onboarding-handoff-row onboarding-write-line ${written > index * 2 ? 'onboarding-write-visible' : ''}`}>
- <span className="onboarding-handoff-step">{t(`onboarding.story.${backend}.step`)}</span>
- <ArrowRight size={12} strokeWidth={1.8} className="onboarding-handoff-arrow" />
- <span className="onboarding-handoff-name">{getBackendUiMeta(backend).label}</span>
+ <span className="onboarding-handoff-mark"><BackendIcon backend={backend} size={14} variant="brand" aria-hidden="true" /></span>
+ <Bar width={HANDOFF_BARS[index]} />
</div>
))}
</div>
diff --git a/ui/src/components/onboarding/onboarding.css b/ui/src/components/onboarding/onboarding.css
index 46d58697d..a1d8d38f3 100644
--- a/ui/src/components/onboarding/onboarding.css
+++ b/ui/src/components/onboarding/onboarding.css
@@ -767,7 +767,11 @@
transition: clip-path 100ms ease-out, opacity 80ms ease-out;
}
.onboarding-write-visible { opacity: 1; clip-path: inset(0 0 0 0); }
-.onboarding-skeleton { flex: 1; min-height: 0; padding-top: calc(17 * var(--ob-u)); position: relative; overflow: hidden; }
+/* The skeleton clips only across, which is what keeps the working sweep inside it. Its
+ rows are design units under tier-authored chrome, so at the large reading the last
+ test row reaches a pixel past the box; the card's own bottom inset is where that
+ pixel lands, instead of being cut off the row. */
+.onboarding-skeleton { flex: 1; min-height: 0; padding-top: calc(17 * var(--ob-u)); position: relative; overflow-x: clip; }
.onboarding-bar {
display: block;
height: calc(6 * var(--ob-u));
@@ -787,24 +791,22 @@
}
@keyframes onboarding-shimmer { to { transform: translateX(110%); } }
-/* The coordinator's plan: one row per assistant it hands a part to — the step, an
- arrow, and the assistant's name — 26 tall on a 6 gap, 10 below the status line. */
-.onboarding-skeleton-handoffs { display: flex; flex-direction: column; gap: calc(6 * var(--ob-u)); padding-top: calc(10 * var(--ob-u)); }
-.onboarding-handoff-row {
- display: flex;
- align-items: center;
- gap: calc(8 * var(--ob-u));
- min-height: calc(26 * var(--ob-u));
- padding: 0 calc(10 * var(--ob-u));
- border-radius: 8px;
- background: var(--ob-well);
- border: 1px solid var(--ob-divider);
- font-size: var(--ob-cap-fs);
- white-space: nowrap;
-}
-.onboarding-handoff-step { min-width: calc(48 * var(--ob-u)); color: var(--muted); }
-.onboarding-handoff-arrow { flex-shrink: 0; color: var(--mint-ink); }
-.onboarding-handoff-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--foreground); }
+/* The coordinator's plan, drawn like the other cards' work rather than as type: one
+ row per assistant it hands a part to — that assistant's mark, then its task as a
+ skeleton line — on the tests card's 23 pitch with each row's centre on a test row's,
+ so the two lists read as one line across the diagram. A mark needs two units more
+ than a checkbox to stay legible, so its row starts one higher. The rows are in
+ design units, so the plan scales with the card, as the code and the tests do. */
+.onboarding-skeleton-handoffs { display: flex; flex-direction: column; gap: calc(9 * var(--ob-u)); padding-top: calc(16 * var(--ob-u)); }
+.onboarding-handoff-row { display: flex; align-items: center; gap: calc(9 * var(--ob-u)); height: calc(14 * var(--ob-u)); }
+/* The mark is geometry, so its size is a design unit and wins over the inline size
+ `BackendIcon` writes on its span, as the identity logo's does. */
+.onboarding-handoff-mark, .onboarding-handoff-mark > span {
+ width: calc(14 * var(--ob-u)) !important;
+ height: calc(14 * var(--ob-u)) !important;
+}
+.onboarding-handoff-mark { flex-shrink: 0; display: grid; place-items: center; }
+.onboarding-handoff-mark svg { width: 100%; height: 100%; display: block; }
/* u3bGM: six 11-tall rows on a 16 pitch, 14 below the box top — and, like the document,
14 left under the last one. The row is 11 because that is what its line number
@@ -817,8 +819,10 @@
.onboarding-bar-violet { background: var(--ob-code-violet); }
/* The reviewer reads a diff rather than writing one: the code is there from the start,
a removed line and two added ones are tinted across the row, and the working card's
- sweep is what reads as the review passing over it. */
-.onboarding-skeleton-review .onboarding-code-row { margin: 0 calc(-4 * var(--ob-u)); padding: 0 calc(4 * var(--ob-u)); border-radius: 3px; }
+ sweep is what reads as the review passing over it. The tint spans the row and no
+ further, as design_desktop.pen draws it: an outdent past the skeleton is only cut
+ square by the skeleton's clip. */
+.onboarding-skeleton-review .onboarding-code-row { border-radius: 3px; }
.onboarding-code-row[data-diff="removed"] { background: var(--ob-diff-removed); }
.onboarding-code-row[data-diff="added"] { background: var(--ob-diff-added); }
diff --git a/ui/src/i18n/en.json b/ui/src/i18n/en.json
index 7dcdfb516..bbdfd7598 100644
--- a/ui/src/i18n/en.json
+++ b/ui/src/i18n/en.json
@@ -5636,19 +5636,16 @@
},
"claude": {
"role": "Developer",
- "step": "Build",
"working": "Writing code",
"complete": "Implementation ready"
},
"codex": {
"role": "Reviewer",
- "step": "Review",
"working": "Reviewing the change",
"complete": "Review passed"
},
"opencode": {
"role": "Tester",
- "step": "Test",
"working": "Running tests",
"complete": "All tests passed"
}
diff --git a/ui/src/i18n/zh.json b/ui/src/i18n/zh.json
index 64e3dca4e..ff81da902 100644
--- a/ui/src/i18n/zh.json
+++ b/ui/src/i18n/zh.json
@@ -5636,19 +5636,16 @@
},
"claude": {
"role": "开发",
- "step": "开发",
"working": "编写功能代码",
"complete": "功能代码已就绪"
},
"codex": {
"role": "评审",
- "step": "评审",
"working": "评审代码改动",
"complete": "评审通过"
},
"opencode": {
"role": "测试",
- "step": "测试",
"working": "执行测试用例",
"complete": "测试全部通过"
}