Skip to content

Commit 26ba3a9

Browse files
authored
improvement(docs): simplify workflow lightbox and retire migration artifacts (#9496)
* improvement(docs): inspect workflows on canvas and retire migration artifacts * improvement(docs): simplify expanded workflows to an interactive canvas * fix(docs): remove unused preview block export * chore(docs): drop retired export from unused baseline
1 parent e56bf3d commit 26ba3a9

96 files changed

Lines changed: 195 additions & 89431 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitattributes‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,3 @@ Dockerfile* text eol=lf
4141
*.ttf binary
4242
*.eot binary
4343
*.pdf binary
44-
45-
apps/docs/migration/report.json linguist-generated=true
46-
apps/docs/migration/verification/** linguist-generated=true

‎.github/workflows/docs-negotiation.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ jobs:
171171
DOCS_HEADER_REPORT_PATH: ${{ github.workspace }}/apps/docs/test-results/docs-headers.json
172172
DOCS_NAVIGATION_REPORT_PATH: ${{ github.workspace }}/apps/docs/test-results/navigation/docs.json
173173
DOCS_GENERATORS_REPORT_PATH: ${{ github.workspace }}/apps/docs/test-results/generators/report.json
174-
DOCS_MIGRATION_REPORT_PATH: ${{ github.workspace }}/apps/docs/test-results/migration.json
174+
DOCS_COMPATIBILITY_REPORT_PATH: ${{ github.workspace }}/apps/docs/test-results/compatibility.json
175175
DOCS_SAMPLES_REPORT_PATH: ${{ github.workspace }}/apps/docs/test-results/samples/report.json
176176
DOCS_SAMPLES_SYNTAX_LANGUAGES: javascript,python,bash,go,java,csharp
177177
DOCS_SAMPLES_HTTP_BASE_URL: http://127.0.0.1:3001
@@ -195,7 +195,7 @@ jobs:
195195
run: bun run --cwd apps/docs scripts/test-generators-e2e.ts
196196
- name: Verify preserved routes, anchors and examples
197197
if: always() && steps.build.outcome == 'success'
198-
run: bun run --cwd apps/docs content:verify-migration
198+
run: bun run --cwd apps/docs content:verify-compatibility
199199
- name: Verify native header edge cases
200200
if: always() && steps.build.outcome == 'success'
201201
run: bun run --cwd apps/docs test:headers:e2e

‎apps/docs/ARCHITECTURE.md‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Sim owns the content catalog, page rendering, navigation, search, and machine in
77
| Location | Responsibility |
88
| --- | --- |
99
| `content/docs/` | Authored MDX, navigation metadata, and generated content regions |
10-
| `scripts/compile-content.ts` | Build orchestration, validation, cache, and migration report |
10+
| `scripts/compile-content.ts` | Build orchestration, validation, cache, and compatibility verification |
1111
| `lib/content/` | Typed catalog, MDX compilation, Markdown serialization, navigation, and OpenAPI projection |
1212
| `.content/` | Ignored generated catalog and individually loadable compiled page modules |
1313
| `components/docs/` | Shared design tokens, shell, navigation, page framing, search, and API reference |
@@ -17,7 +17,7 @@ Sim owns the content catalog, page rendering, navigation, search, and machine in
1717
| `lib/http/`, `app/api/` | Bounded public discovery, page retrieval, and MCP adapters |
1818
| `app/[[...slug]]/page.tsx` | Thin catalog-backed page, metadata, and static-parameter adapter |
1919
| `app/design-system/` | Local component gallery, excluded from indexing |
20-
| `migration/` | Baseline inventory, design-system specification, parity matrix, and migration results |
20+
| `scripts/fixtures/content-baseline.json` | Frozen compatibility inventory for public routes, anchors, examples, and assets |
2121

2222
`app/` follows the App Router's file conventions. The root layout owns the persistent shell: navbar, sidebar, footer, search, and mobile navigation. Client navigation reads the current pathname without remounting the sidebar's scroll container. Only navigation metadata is shared with the client; document bodies and the complete catalog stay on the server. The single catch-all route loads that page's server-compiled MDX or specification reference into the shared article and page frame, which owns its responsive outline. Ordinary content does not create a React route or duplicate a layout. Promised route parameters and the Metadata API follow the installed Next.js 16 documentation.
2323

@@ -29,11 +29,11 @@ Sim owns the content catalog, page rendering, navigation, search, and machine in
2929
4. Use ordinary Markdown and shared components. MDX imports must be named imports registered in `lib/content/compile.ts`. Unknown modules, components, metadata, duplicate routes/anchors, broken internal links, or missing local media fail compilation with source context.
3030
5. Run `bun run --cwd apps/docs content:generate`, inspect the affected page and Markdown, and run the applicable repository gates.
3131

32-
The compiler records source hashes, heading IDs, code-fence hashes and media references. Run `content:verify-migration` to enforce preservation against the frozen replacement baseline and regenerate `migration/report.json`. Ordinary builds validate current content without loading the historical inventory or rewriting the migration report, allowing intentional prose and code updates. The compiler serializes every tab and disclosure into meaningful Markdown, including workflow configuration and outputs. The introductory paragraph is hidden in HTML only when it exactly repeats the page description; machine-readable prose remains intact.
32+
The compiler records source hashes, heading IDs, code-fence hashes and media references. Run `content:verify-compatibility` to enforce preservation against `scripts/fixtures/content-baseline.json` and write `test-results/compatibility.json` (or `DOCS_COMPATIBILITY_REPORT_PATH`). The frozen fixture retains its original source provenance and must not be regenerated from the implementation under test to silence a failure. Review intentional public-contract changes explicitly. Ordinary builds validate current content without loading this inventory or writing a compatibility report. The compiler serializes every tab and disclosure into meaningful Markdown, including workflow configuration and outputs. The introductory paragraph is hidden in HTML only when it exactly repeats the page description; machine-readable prose remains intact.
3333

3434
## Extend the component library
3535

36-
Shared dimensions, tokens, component ownership, and intentional differences from platform components are documented in `migration/design-system.md`.
36+
Shared dimensions, tokens, component ownership, and intentional differences from platform components are documented in `DESIGN_SYSTEM.md`.
3737

3838
Keep reusable chrome in `components/docs/` and reusable reading components in `components/ui/`. Export Markdown element mappings from `getMDXComponents()` rather than styling each page. A new MDX component also needs an explicit compiler allowlist entry and a meaningful serializer in `lib/content/markdown.ts`. Add its states to `/design-system` and inspect its keyboard, touch, light and dark behavior.
3939

@@ -47,7 +47,9 @@ Keep platform screenshots and original integration logos in `public/static/` wit
4747

4848
The compiler converts local screenshot sources into Next.js static image imports after extracting their original Markdown URLs. Static imports give changed assets new content-addressed URLs. The shared image component supplies responsive sizes for each frame variant; Next serves a small set of WebP widths at quality 90 for interface text and 75 for scenery. The original loads when the media viewer opens. Backgrounds use the same hashed assets in both views. Legacy public asset URLs remain available; mutable filenames do not receive immutable caching.
4949

50-
Product contracts remain authoritative for OpenAPI. Run `bun run generate:openapi` after changing their owners; the docs compiler projects operations from all registered specifications. CLI, MCP operations, integration content, and marked Agent streaming regions retain their existing generators listed in `EDITORIAL_GUIDE.md`. Do not hand-edit generated regions. Request examples are inert and never execute an API call or accept credentials.
50+
Product contracts remain authoritative for OpenAPI. Run `bun run generate:openapi` after changing their owners; the docs compiler projects operations from all registered specifications. CLI, MCP operations, integration content, and marked Agent streaming regions retain their existing generators listed in `EDITORIAL_GUIDE.md`. Do not hand-edit generated regions. Request examples are inert and never execute an API call or accept credentials. Specifications own authentication alternatives, media types, named examples, response headers, callbacks, defaults, and deprecation. Schema-derived samples are labeled as examples. Multipart examples must let the client set the boundary.
51+
52+
Keep existing API heading aliases (`authorization`, `parameters-path`, `parameters-query`, `parameters-header`, `parameters-cookie`, `request-body`, `response-body`, and `callbacks`) when changing the reference layout. Local JSON pointers preserve sibling properties, and recursive references remain explicit in both HTML and Markdown.
5153

5254
The agent docs manifest continues to publish existing `.mdx` paths and its deliberate corpus exclusions. Run `bun run check:docs-manifest`, `bun run check:agent-stream-docs`, `bun run check:cli-docs`, `bun run check:openapi`, and `bun run check:docs` after relevant changes.
5355

@@ -65,8 +67,8 @@ The implementation was checked against the installed Next.js 16.4.1 docs and cur
6567

6668
## Review and rollback
6769

68-
Review the migration report first, then the library gallery and representative pages, then the HTTP/browser reports. Run a production build without embedding credentials to verify the local fallback. Production search index publication remains a separate deployment step and must pass its freshness check.
70+
Review the compatibility report, library gallery, representative pages, and HTTP/browser reports. Run a production build without embedding credentials to verify the local fallback. Production search index publication remains a separate deployment step and must pass its freshness check.
6971

70-
This change preserves the docs workspace, origin, deployment identity, product generators, and content paths. Restoring the previous docs deployment requires no schema migration or product-data rollback. Search publication changes `docs_embeddings` separately: before publishing, back up that table and record its paired docs deployment and source revision. Rollback must hold queued publishers, restore the paired deployment and index, and check freshness and citations from the restored source. The workflow does not create this backup automatically and checks out current `main`; ordinary dispatch cannot select an older publisher. Keep the PR in draft until the visual and behavior evidence has been reviewed.
72+
Search publication changes `docs_embeddings` separately: before publishing, back up that table and record its paired docs deployment and source revision. Rollback must hold queued publishers, restore the paired deployment and index, and check freshness and citations from the restored source. The workflow does not create this backup automatically and checks out current `main`; ordinary dispatch cannot select an older publisher.
7173

72-
The requested move to `https://sim.ai/docs` requires a coordinated path-aware build and infrastructure cutover. See [the domain migration plan](migration/domain-move.md); the current build remains on `docs.sim.ai` until that work is verified.
74+
The requested move to `https://sim.ai/docs` requires a coordinated path-aware build and infrastructure cutover. See [the domain migration plan](DOMAIN_MOVE.md); the current build remains on `docs.sim.ai` until that work is verified.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Disclosures use a 16px chevron, 8px label gap, a 38px desktop summary (44px touc
6969
| Open navigation rows | `components/ui/cards.tsx` |
7070
| CLI command grids | `components/ui/command-table.tsx` |
7171
| Canonical provider marks | `components/ui/integration-icon.tsx` |
72-
| Original workflow graph/configuration | `components/workflow-preview/workflow-preview.tsx`, `block-inspector.tsx` |
72+
| Original workflow graph | `components/workflow-preview/workflow-preview.tsx` |
7373
| Complete nested workflow results, copy, download | `components/workflow-preview/output-bundle.tsx` |
7474
| Real component/state gallery | `components/docs/gallery.tsx` |
7575

‎apps/docs/DOMAIN_MOVE.md‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Moving docs to a path prefix
2+
3+
The site currently targets `docs.sim.ai`. A move to `sim.ai/docs` is separate infrastructure work, not completed by the docs redesign. Changing `NEXT_PUBLIC_DOCS_URL` alone is insufficient.
4+
5+
## Required changes
6+
7+
- Build Next.js with `basePath: '/docs'`; an asset prefix alone does not mount the app. Keep canonical catalog IDs such as `/introduction` independent of the public prefix.
8+
- Centralize public URLs for native links, images, client fetches, fonts, canonicals, metadata, sitemap, Markdown, discovery, and MCP. Next links receive the configured base path; root-relative `new URL` inputs discard it.
9+
- Route `/docs` and `/docs/*` before platform redirects and authentication. Preserve method, body, query, RSC parameters, content negotiation, and response headers. Use a stable upstream alias distinct from the redirected old hostname to avoid loops.
10+
- Strip platform cookies and authorization before forwarding to public docs; do not relay upstream `Set-Cookie` headers.
11+
- Update platform/landing consumers and search citations together. Retain agent VFS identities and `.mdx` compatibility; reuse vectors when only citation URLs change.
12+
- Advertise the prefixed sitemap in the destination origin's root `robots.txt`; a nested robots file does not govern the origin.
13+
14+
## Verify before cutover
15+
16+
Run corpus, assets, navigation, content negotiation, search, and official MCP-client suites through the actual prefixed routing layer. The existing harnesses use root-relative paths and do not by themselves prove prefix support.
17+
18+
Verify HTML, Markdown, JSON, discovery, static assets, optimizer images, fonts, RSC navigation, direct fragments, unknown-page 404s, and MCP POST requests. Exercise mixed Accept values and both request orders to rule out representation-cache contamination. Every public URL must contain exactly one prefix.
19+
20+
Only then redirect the old hostname with a path/query-preserving 308 and verify existing client methods, bodies, and browser fragment inheritance. Do not redirect the upstream alias. No routing cutover or rollback rehearsal is implied by repository CI.
21+
22+
## Rollback
23+
24+
Record the source revision, docs deployment, routing revision, upstream alias, and a restorable search-index backup before cutover. Hold publishers while restoring paired routing, deployment, and index state; repeat citation and credential-isolation checks.
25+
26+
A 308 may be cached. Keep a known-good build available at the new destination for clients retaining the redirect; redirecting the new destination back can create a loop. Rehearse rollback in isolation before changing production routing. See [search publication operations](MACHINE_ACCESS.md#search-index-operations).

‎apps/docs/MACHINE_ACCESS.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,11 @@ bun run test:search:postgres:e2e
102102
```
103103

104104
Then stop the container using the ID returned by `docker run`; `--rm` removes its temporary data. Successful vector generation and provider ranking still require separate verification with an embedding provider. The local suite makes no paid provider calls.
105+
106+
## Release verification and rollback
107+
108+
Repository CI proves the exercised HTTP, browser, generator, database, and deterministic provider contracts. It does not establish real-provider relevance, production CDN cache separation, field performance, native Safari behavior, or screen-reader usability. Verify those boundaries against the intended release; historical redesign measurements are retained in Git rather than treated as current readiness evidence.
109+
110+
Before publishing, independently verify that the serving docs deployment matches the publisher source and record a restorable index backup. The manual workflow records that attestation but does not make the backup. On rollback, hold queued publishers, restore the paired docs deployment and index, then check Markdown, search reads, and citations with the matching source. A legacy deployment cannot be certified by a freshness checker it did not ship. Historical rollback requires a separately reviewed procedure because ordinary publication dispatch targets current `main`.
111+
112+
The planned path-prefix move has its own [cutover and rollback requirements](DOMAIN_MOVE.md). Do not infer that it is complete from the redesign's successful CI.

‎apps/docs/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Sim documentation
22

3-
The documentation site uses Next.js, a build-time MDX content catalog, and the shared Sim docs component library. Read the [editorial guide](EDITORIAL_GUIDE.md) before changing copy or page organization. The [architecture and authoring guide](migration/content.md) explains content ownership, reusable components, assets, and generated references. The [copy audit](COPY_AUDIT.md) records the complete page inventory, accuracy corrections, and validation.
3+
The documentation site uses Next.js, a build-time MDX content catalog, and the shared Sim docs component library. Read the [editorial guide](EDITORIAL_GUIDE.md) before changing copy or page organization. The [architecture and authoring guide](ARCHITECTURE.md) explains content ownership, reusable components, assets, and generated references. The [copy audit](COPY_AUDIT.md) records the complete page inventory, accuracy corrections, and validation.
44

55
## Develop
66

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
'use client'
2+
3+
import type { ReactNode } from 'react'
4+
import * as Dialog from '@radix-ui/react-dialog'
5+
import { X } from '@sim/emcn/icons'
6+
import { cn } from '@/components/docs/classnames'
7+
import { docsControlClass, docsDialogClass } from '@/components/docs/primitives'
8+
9+
interface LightboxProps {
10+
trigger: ReactNode
11+
title: string
12+
description: string
13+
children: ReactNode
14+
open?: boolean
15+
onOpenChange?: (open: boolean) => void
16+
}
17+
18+
/** Shared modal geometry and keyboard behavior for documentation media. */
19+
export function Lightbox({
20+
trigger,
21+
title,
22+
description,
23+
children,
24+
open,
25+
onOpenChange,
26+
}: LightboxProps) {
27+
return (
28+
<Dialog.Root open={open} onOpenChange={onOpenChange}>
29+
<Dialog.Trigger asChild>{trigger}</Dialog.Trigger>
30+
<Dialog.Portal>
31+
<Dialog.Overlay className='docs-portal fixed inset-0 z-50 bg-[var(--docs-media-scrim)] backdrop-blur-[var(--docs-backdrop-blur)]' />
32+
<Dialog.Content
33+
className={cn(
34+
docsDialogClass,
35+
'fixed inset-3 z-50 flex flex-col overflow-hidden p-4 sm:inset-8'
36+
)}
37+
>
38+
<div className='flex shrink-0 items-center justify-between gap-4 pb-3'>
39+
<Dialog.Title className='text-docs-table'>{title}</Dialog.Title>
40+
<Dialog.Close className={docsControlClass} aria-label='Close media viewer'>
41+
<X className='size-4' />
42+
</Dialog.Close>
43+
</div>
44+
<Dialog.Description className='sr-only'>{description}</Dialog.Description>
45+
{children}
46+
</Dialog.Content>
47+
</Dialog.Portal>
48+
</Dialog.Root>
49+
)
50+
}

0 commit comments

Comments
 (0)