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(onboarding): share content-sized rows on narrow screens (#2038)

Call White8f09a61b03b7
diff --git a/docs/plans/onboarding-narrow-card-rows.md b/docs/plans/onboarding-narrow-card-rows.md
new file mode 100644
index 000000000..b8c2b7a34
--- /dev/null
+++ b/docs/plans/onboarding-narrow-card-rows.md
@@ -0,0 +1,91 @@
+# Shared onboarding card rows on narrow screens
+
+## Contract
+
+At supported narrow widths, the three collaboration cards share their status,
+skeleton and identity row boundaries. Every English/Chinese status and identity
+remains readable through the authored animation phases, without truncation,
+smaller type or changes to the copy. Desktop geometry, wire anchors, animation
+timing and backend/setup behavior stay unchanged.
+
+## Cause and boundary
+
+The cards currently use independent flex columns. At 320px in Linux Chromium,
+the OpenCode status wraps to four 13px lines. Its icon row plus gap and caption
+requires 70px, whereas the other cards stop at their 62px minimum. A minimum
+height is not a shared row-size contract; raising that constant would still
+depend on font metrics and translated content.
+
+Let the existing card grid own three shared rows below the existing 768px
+desktop boundary. Each card consumes those rows through CSS subgrid. Explicit
+max-content status and identity tracks follow the largest content requirement;
+the existing skeleton absorbs the remaining height. Preserve the existing
+design minimums and all desktop rules. No JavaScript measurement, new state,
+dependency or text change.
+
+Keep the card's inner column shrinkable and allow an overlong status word to
+wrap within it. The later "Implementation ready" phase exposed why checking
+only each label's own scroll size is insufficient: an intrinsically sized row
+can extend beyond the card and be clipped by the card instead. The consumer
+test must check row containment inside the card as well as label containment.
+
+Run the same narrow contract in WebKit too. Its automatic track sizing honored
+the identity's 44px minimum but let the stacked labels extend beyond that row;
+explicit content-sized outer tracks express the intended sizing in both
+engines. Keep this browser project limited to the narrow geometry contract.
+
+## Validation-owner scope decision
+
+Full-suite verification also exposed a pre-existing race in the same browser
+harness's CSS-animation sampler, including at the unchanged 1200px desktop
+layout. Two runs observed one-frame drift in the strict pause comparison.
+A read-only Linux Chromium probe captured `playState="paused"` while
+`pending=true`: the shimmer moved from 216.584ms to 233.284ms when `ready`
+resolved, then remained stable. The other two probe samples had already
+settled and did not move.
+
+The bounded correction belongs to the test sampler: await each selected
+animation's existing `ready` promise before reading its timeline. Keep the
+strict paused/running, elapsed-time and resume assertions unchanged. Do not
+change production animation behavior, add sleeps/retries, or relax tolerances.
+
+## Verification
+
+- Reproduce the unchanged 320px English case in Linux Chromium.
+- Extend the existing real-Wizard browser geometry test across all authored
+ phases, both languages, and the narrow breakpoint.
+- Check shared status/identity boundaries, complete labels and containment.
+- Run the full onboarding browser suite, focused component tests, UI lint,
+ fixture typecheck and production build.
+- Use a task-owned temporary test directory in the existing local Incus
+ instance. The full worktree runner requires platform credentials, which this
+ hermetic UI change does not need. Do not change the persistent master source,
+ service, configuration, or real platform/provider connections.
+
+## Known by design
+
+- This does not redesign the approved desktop diagram or change its animation.
+- This is a rendered layout contract, not a new authentication/setup scenario.
+- Browser evidence must name the engine/platform actually exercised. Do not
+ claim arbitrary translations or unbounded text fit inside a fixed diagram.
+- Merge and deployment require their own authorization.
+
+## Results
+
+- Unchanged base `a8df6b5bb` reproduced the 320px English failure in isolated
+ Linux Chromium: status heights differed by 8px.
+- Final Linux Chromium onboarding suite: **82 passed**, including desktop
+ geometry, motion, themes, connections and the expanded narrow contract.
+- Final macOS WebKit narrow matrix: **10 passed**. The matrix covers 320,
+ 375, 390, 767 and 768px, English/Chinese, and all seven authored phases.
+- Focused component/timeline unit tests: **16 passed**. UI lint baseline,
+ changed-file ESLint, fixture typecheck, theme/catalog validation, production
+ build and diff checks passed.
+- The initial row-containment and WebKit failures were retained as diagnostic
+ evidence and fixed before opening the PR. No assertions were removed or
+ relaxed; no real provider/platform calls were made.
+- The four browser/product input files in the Linux temporary directory were
+ SHA-256-equal to the corresponding task-worktree files.
+- Exact-head Codex review and the complete GitHub lint workflow remain required
+ before delivery as merge-ready. No merge, master deployment or restart is
+ included in this change.
diff --git a/ui/e2e/onboarding-fidelity/geometry.spec.ts b/ui/e2e/onboarding-fidelity/geometry.spec.ts
index eb5a68597..cee0ec604 100644
--- a/ui/e2e/onboarding-fidelity/geometry.spec.ts
+++ b/ui/e2e/onboarding-fidelity/geometry.spec.ts
@@ -360,37 +360,66 @@ test.describe('capped fluid width', () => {
* that do, and no label clipped or truncated to make that true.
*/
test.describe('narrow identity alignment', () => {
- for (const viewport of [{ width: 320, height: 568 }, { width: 390, height: 844 }, { width: 768, height: 1024 }]) {
+ for (const viewport of [
+ { width: 320, height: 568 },
+ { width: 375, height: 667 },
+ { width: 390, height: 844 },
+ { width: 767, height: 1024 },
+ { width: 768, height: 1024 },
+ ]) {
for (const lang of ['en', 'zh'] as const) {
test(`${size(viewport)} ${lang} keeps the three cards on one grid`, async ({ page }, info) => {
await page.setViewportSize(viewport);
const denied = await serveProduct(page);
await openOnboarding(page, { lang });
- await freezeAt(page, PHASES['codex-working']);
-
- const statuses = await boxes(page, '.onboarding-story-status');
- const identities = await boxes(page, '.onboarding-story-identity');
- expect([statuses.length, identities.length]).toEqual([3, 3]);
- // The header row and the separator above the footer are the two lines the eye
- // reads across the three cards, so both have to be one line, not three.
- expect(spread(statuses.map((one) => one.y))).toBeLessThanOrEqual(1);
- expect(spread(statuses.map((one) => one.height))).toBeLessThanOrEqual(1);
- expect(spread(identities.map((one) => one.y))).toBeLessThanOrEqual(1);
- expect(spread(identities.map((one) => one.height))).toBeLessThanOrEqual(1);
-
- // Alignment must not have been bought by cutting the labels: every name, role
- // and caption is fully inside its own box, with no ellipsis doing the fitting.
- const clipped = await page.locator(
- '.onboarding-story-identity strong, .onboarding-story-identity > span:last-child, .onboarding-status-text',
- ).evaluateAll((nodes) => nodes
- .filter((node) => {
- const style = getComputedStyle(node);
- return node.scrollWidth > node.clientWidth + 1
- || node.scrollHeight > node.clientHeight + 1
- || style.textOverflow === 'ellipsis';
- })
- .map((node) => node.textContent?.trim() ?? ''));
- expect(clipped).toEqual([]);
+ await page.evaluate(() => document.fonts.ready);
+ let previous = 0;
+ for (const [phase, elapsed] of Object.entries(PHASES)) {
+ await test.step(phase, async () => {
+ // freezeAt advances the clock; these phase offsets are absolute.
+ await freezeAt(page, elapsed - previous);
+ previous = elapsed;
+ const statuses = await boxes(page, '.onboarding-story-status');
+ const skeletons = await boxes(page, '.onboarding-skeleton');
+ const identities = await boxes(page, '.onboarding-story-identity');
+ const cards = await boxes(page, '.onboarding-collaboration-card');
+ expect([statuses.length, identities.length]).toEqual([3, 3]);
+ // The header and footer boundaries belong to the row, not to whichever
+ // caption happens to be short enough at this point in the animation.
+ for (const row of [statuses, skeletons, identities]) {
+ expect(spread(row.map((one) => one.y))).toBeLessThanOrEqual(1);
+ expect(spread(row.map((one) => one.height))).toBeLessThanOrEqual(1);
+ }
+ for (let index = 0; index < cards.length; index++) {
+ for (const row of [statuses, skeletons, identities]) {
+ expect(row[index].x).toBeGreaterThanOrEqual(cards[index].x);
+ expect(row[index].x + row[index].width).toBeLessThanOrEqual(cards[index].x + cards[index].width);
+ }
+ expect(skeletons[index].height).toBeGreaterThan(0);
+ expect(statuses[index].y + statuses[index].height).toBeLessThanOrEqual(skeletons[index].y + 1);
+ expect(skeletons[index].y + skeletons[index].height).toBeLessThanOrEqual(identities[index].y + 1);
+ expect(identities[index].y + identities[index].height).toBeLessThanOrEqual(cards[index].y + cards[index].height);
+ }
+
+ // Equal rows must not be bought with clipping, truncation or overflow
+ // into an adjacent row/card. Check the actual visible label boxes.
+ const clipped = await page.locator(
+ '.onboarding-story-identity strong, .onboarding-story-identity > span:last-child, .onboarding-status-text',
+ ).evaluateAll((nodes) => nodes
+ .filter((node) => {
+ const style = getComputedStyle(node);
+ const label = node.getBoundingClientRect();
+ const row = node.closest('.onboarding-story-status, .onboarding-story-identity')!.getBoundingClientRect();
+ return node.scrollWidth > node.clientWidth + 1
+ || node.scrollHeight > node.clientHeight + 1
+ || style.textOverflow === 'ellipsis'
+ || label.left < row.left - 1 || label.right > row.right + 1
+ || label.top < row.top - 1 || label.bottom > row.bottom + 1;
+ })
+ .map((node) => node.textContent?.trim() ?? ''));
+ expect(clipped).toEqual([]);
+ });
+ }
// …and the labels are still the product's own words at a readable size.
const names = await page.locator('.onboarding-story-identity strong').allInnerTexts();
expect(names.map((name) => name.replace(/\s+/g, ' ').trim())).toEqual(['Claude Code', 'Codex', 'OpenCode']);
diff --git a/ui/e2e/onboarding-fidelity/support.ts b/ui/e2e/onboarding-fidelity/support.ts
index 9e248f108..2321c0dbc 100644
--- a/ui/e2e/onboarding-fidelity/support.ts
+++ b/ui/e2e/onboarding-fidelity/support.ts
@@ -173,19 +173,23 @@ export async function settleEffects(page: Page, at = 1000) {
* that `animation-play-state` can hold.
*/
export function cssEffects(page: Page) {
- return page.evaluate(() => document.getAnimations()
- .filter((animation) => {
+ return page.evaluate(async () => {
+ const animations = document.getAnimations().filter((animation) => {
if (!('animationName' in animation)) return false;
// The onboarding's own motion, which is the whole of what its lifecycle owns.
const target = (animation.effect as KeyframeEffect | null)?.target ?? null;
return !!target?.closest('.onboarding-shell');
- })
- .map((animation) => ({
+ });
+ // playState can already say "paused" while the pause task is still pending.
+ // Sample the committed timeline, not its one-frame-early hold time.
+ await Promise.all(animations.map((animation) => animation.ready));
+ return animations.map((animation) => ({
name: String((animation as unknown as { animationName: string }).animationName),
state: animation.playState,
at: Math.round(Number(animation.currentTime ?? 0)),
}))
- .sort((left, right) => `${left.name}${left.at}`.localeCompare(`${right.name}${right.at}`)));
+ .sort((left, right) => `${left.name}${left.at}`.localeCompare(`${right.name}${right.at}`));
+ });
}
/** Simulates the tab going to the background, which no Playwright API does directly. */
diff --git a/ui/playwright.onboarding-fidelity.config.ts b/ui/playwright.onboarding-fidelity.config.ts
index 493d98919..49551fef0 100644
--- a/ui/playwright.onboarding-fidelity.config.ts
+++ b/ui/playwright.onboarding-fidelity.config.ts
@@ -14,5 +14,12 @@ export default defineConfig({
env: { VIBE_UI_BACKEND: 'http://127.0.0.1:9' },
url: 'http://127.0.0.1:5212/e2e/onboarding-fidelity/fixture.html',
},
- projects: [{ name: 'chromium', use: { ...devices['Desktop Chrome'] } }],
+ projects: [
+ { name: 'chromium', use: { ...devices['Desktop Chrome'] } },
+ {
+ name: 'webkit-narrow',
+ grep: /narrow identity alignment/,
+ use: { ...devices['Desktop Safari'] },
+ },
+ ],
});
diff --git a/ui/src/components/onboarding/onboarding.css b/ui/src/components/onboarding/onboarding.css
index 8b4117574..8a3195f05 100644
--- a/ui/src/components/onboarding/onboarding.css
+++ b/ui/src/components/onboarding/onboarding.css
@@ -526,8 +526,18 @@
/* Tablet portrait and below: the caption moves under the icon row so a full label
wraps instead of shrinking to an unreadable size. */
@media (max-width: 767px) {
+ /* One row owner for all three cards: a wrapped caption must grow its peers'
+ status rows too. Independent flex columns only aligned while every label
+ fit the same minimum height. Keep the skeleton as the flexible middle row. */
+ .onboarding-collaboration-cards { grid-template-rows: max-content minmax(0, 1fr) max-content; }
+ .onboarding-collaboration-card {
+ display: grid;
+ grid-row: 1 / -1;
+ grid-template-columns: minmax(0, 1fr);
+ grid-template-rows: subgrid;
+ }
.onboarding-story-status { flex-wrap: wrap; row-gap: 4px; min-height: 32px; align-content: flex-start; }
- .onboarding-status-text { order: 3; width: 100%; white-space: normal; font-size: 11px; line-height: 13px; }
+ .onboarding-status-text { order: 3; width: 100%; white-space: normal; overflow-wrap: anywhere; font-size: 11px; line-height: 13px; }
.onboarding-story-identity { flex-wrap: wrap; gap: 6px; }
.onboarding-story-identity > span:last-child { margin-left: 0; width: 100%; }
.onboarding-assistant-main { flex-wrap: wrap; }