Skip to content

Commit 873489c

Browse files
authored
fix(docs): simplify selection and verify media interactions (#9493)
* fix(docs): simplify selection and verify media interactions * fix(docs): wait for actionable lightbox backdrop in e2e
1 parent 7027fd5 commit 873489c

5 files changed

Lines changed: 25 additions & 11 deletions

File tree

‎apps/docs/components/docs/navigation.tsx‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ function NavigationItem({ node, pathname, onNavigate }: NavigationItemProps) {
6868
<div
6969
className={cn(
7070
'group/branch flex min-h-[30px] items-center rounded-lg transition-colors hover:bg-[var(--docs-hover)] active:bg-[var(--docs-pressed)]',
71-
isCurrent &&
72-
'bg-[var(--docs-selected)] shadow-[var(--docs-current-edge)] hover:bg-[var(--docs-selected-hover)]'
71+
isCurrent && 'bg-[var(--docs-selected)] hover:bg-[var(--docs-selected-hover)]'
7372
)}
7473
>
7574
<Link

‎apps/docs/components/docs/tokens.css‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
--docs-hover: rgb(10 10 10 / 6%);
4646
--docs-selected: rgb(0 0 0 / 8%);
4747
--docs-selected-hover: var(--docs-selected);
48-
--docs-current-edge: none;
4948
--docs-pressed: rgb(0 0 0 / 12%);
5049
--docs-link: #0066cc;
5150
--docs-prose-link: var(--docs-link);
@@ -134,7 +133,6 @@
134133
--docs-hover: #2b2b2b;
135134
--docs-selected: #333;
136135
--docs-selected-hover: var(--docs-pressed);
137-
--docs-current-edge: inset 2px 0 0 var(--docs-boundary);
138136
--docs-pressed: #3a3a3a;
139137
--docs-link: #8abeff;
140138
--docs-prose-link: var(--docs-heading);

‎apps/docs/migration/design-system.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Three-column reading begins at 1280px. At 1024–1279px the TOC becomes a compac
2222
| Code | Geist Mono | 13 / 22px | 400 | normal |
2323
| Keyboard | Geist | 11 / 14px | 400 | normal |
2424

25-
Marketing calls to action use variable weight 450, matching the landing page. Heading weight remains 500; selection in the sidebar uses a neutral surface and, in dark mode, a 2px inset left edge without changing text color or weight.
25+
Marketing calls to action use variable weight 450, matching the landing page. Heading weight remains 500; selection in the sidebar uses a neutral surface in both themes without changing text color or weight. Keyboard focus retains its separate outline.
2626

2727
The header keeps weight 400 in every navigation state at the user's request, matching the landing navigation and preventing label widths from shifting. Current-section ink changes without changing geometry. The shared wordmark uses the landing's visible SVG overflow and optical offset; header and footer links do not initiate native drag operations. Root vertical overscroll is disabled while normal page and contained reference scrolling remain available.
2828

‎apps/docs/scripts/test-navigation-e2e.ts‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,8 @@ try {
543543
path: join(directory, `image-${scene.variant}-${width}.png`),
544544
animations: 'disabled',
545545
})
546-
await figure.getByRole('button').click()
546+
const trigger = figure.getByRole('button')
547+
await trigger.click()
547548
const viewer = page.getByRole('dialog')
548549
await expect(viewer.getByRole('img')).toBeVisible()
549550
await expect
@@ -589,6 +590,19 @@ try {
589590
})
590591
await page.keyboard.press('Escape')
591592
await expect(viewer).toHaveCount(0)
593+
await expect(trigger).toBeFocused()
594+
await trigger.press('Enter')
595+
await expect(viewer).toBeVisible()
596+
await page
597+
.locator('.docs-portal[data-state="open"][aria-hidden="true"]')
598+
.click({ position: { x: 1, y: 1 } })
599+
await expect(viewer).toHaveCount(0)
600+
await expect(trigger).toBeFocused()
601+
await trigger.press('Enter')
602+
await expect(viewer).toBeVisible()
603+
await viewer.getByRole('button', { name: 'Close media viewer', exact: true }).click()
604+
await expect(viewer).toHaveCount(0)
605+
await expect(trigger).toBeFocused()
592606
} finally {
593607
await page.close()
594608
}

‎apps/docs/scripts/test-search-postgres-e2e.ts‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -400,16 +400,19 @@ async function verifyDatabase() {
400400
await check(
401401
'Citation-only changes are stale and repair without replacing embeddings',
402402
async () => {
403+
const citations = await sql<
404+
Array<{ chunk_id: string; source_link: string; embedding: string }>
405+
>`SELECT chunk_id, source_link, embedding::text FROM docs_embeddings WHERE source_document = ${page.sourcePath} ORDER BY chunk_id`
406+
assert(citations.length > 0)
403407
await sql`UPDATE docs_embeddings SET source_link = 'https://old.example/introduction' WHERE source_document = ${page.sourcePath}`
404408
assert.equal((await index('check', 'citation-stale', ['/introduction'])).exitCode, 1)
405409
const repaired = await index('publish', 'citation-repaired', ['/introduction'])
406410
assert.equal(repaired.exitCode, 0)
407411
assert.deepEqual(await fingerprint(), fresh)
408-
const [row] = await sql<
409-
Array<{ source_link: string; embedding: string }>
410-
>`SELECT source_link, embedding::text FROM docs_embeddings WHERE source_document = ${page.sourcePath}`
411-
assert.equal(row?.source_link, 'https://docs.sim.ai/introduction')
412-
assert.equal(row?.embedding, vector)
412+
const repairedCitations = await sql<
413+
Array<{ chunk_id: string; source_link: string; embedding: string }>
414+
>`SELECT chunk_id, source_link, embedding::text FROM docs_embeddings WHERE source_document = ${page.sourcePath} ORDER BY chunk_id`
415+
assert.deepEqual(repairedCitations, citations)
413416
assert.equal((await index('check', 'citation-fresh', ['/introduction'])).exitCode, 0)
414417
}
415418
)

0 commit comments

Comments
 (0)