Skip to content

Commit 2676575

Browse files
authored
improvement(docs): standardize copy and responsive navigation (#9020)
* docs: standardize copy and page organization * docs: preserve tab spacing and qualify output limits * docs: align responsive navigation and preserve readable content * docs: link the scoped tab component in agent guidance * docs: preserve procedural details and correct reference examples * docs: record final review and preserve accessible provider bookmarks * chore(docs): finish ship review and update audit evidence * fix(docs): correct review findings and tablet header alignment * fix(docs): polish API controls and inline code * fix(docs): announce API picker selections * fix(docs): expose checked API picker choices * test(ui): align single-choice picker locators
1 parent 04f2b17 commit 2676575

391 files changed

Lines changed: 27808 additions & 19774 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.

‎apps/docs/AGENTS.md‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Documentation guidelines
2+
3+
Read [EDITORIAL_GUIDE.md](EDITORIAL_GUIDE.md) before editing documentation. It defines the voice, terminology, page types, section order, and component choices. [COPY_AUDIT.md](COPY_AUDIT.md) records the complete audit and material source qualifications; keep new conclusions evidence-based.
4+
5+
## Copy and accuracy
6+
7+
- Read the complete original page before rewriting. Preserve useful prerequisites, syntax, examples, permissions, defaults, limits, failure consequences, and recovery instructions. Move repeated detail only after its canonical owner contains it and the local link works.
8+
- Verify consequential behavior against its current implementation. Use primary documentation for external procedures. Distinguish repository defaults from deployed settings, Cloud from self-hosting, and accepted operations from completed work.
9+
- Keep Chat content delivery separate from ordinary UI, API-key, MCP, and workflow access. A saved write can have a withheld result; do not imply that a display failure undoes the write.
10+
- Use concise, concrete prose and sentence-case headings. Remove repetition and decorative components without making required information sparse. Honor the editing scope; shared components and assets may still serve excluded pages.
11+
12+
## Sources and generation
13+
14+
- Edit generated API and CLI prose at its owner, then use the generation commands in the editorial guide. Do not hand-edit generated specifications, reference pages, or marked generated regions.
15+
- Preserve page URLs, operation IDs, method/path pairs, command options, authentication, and schema behavior. Validate copyable request bodies against the canonical input contracts.
16+
- Check inbound heading anchors from the entire docs site and application before renaming them. Use native explicit tab triggers for provider bookmarks, with `aria-controls` matching panel IDs; preserve the reciprocal `aria-labelledby` relationship and avoid duplicate element IDs.
17+
18+
## Layout and components
19+
20+
- Use existing Sim tokens and EMCN chrome. Keep styling local to the component; do not add global CSS overrides or custom colors for one page.
21+
- Use [the authored tab components](components/ui/tabs.tsx). Mixed prose/code panels retain padding; a single code fence can fill its frame. Preserve native selection, keyboard behavior, and intentional code/table scrolling.
22+
- Page spacing belongs to the page container. The navbar, TOC, and sidebar must agree on breakpoints and reserved row heights. Use the shared section order and route matching in `lib/navigation.ts`.
23+
- Inspect mobile, tablet, desktop, and breakpoint boundaries. Check 320px and 390px widths, both sides of 640px, 768px, 1024px, and 1280px, plus a wide desktop. Verify headings clear sticky chrome, drawers remain reachable, touch targets are usable, and prose does not overflow. Restore temporary viewport and theme changes after QA.
24+
25+
## Verification
26+
27+
Compile the affected MDX, check internal links and preserved anchors, run the required repository gates, and inspect the production build. Validate all affected tabs and navigation states, rather than only their default panels. Record exact scope and limitations; a successful build does not prove an external provider setup or live Cloud configuration.
28+
29+
<!-- BEGIN:nextjs-agent-rules -->
30+
31+
## This is NOT the Next.js you know
32+
33+
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices.
34+
35+
This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.
36+
37+
<!-- END:nextjs-agent-rules -->

‎apps/docs/COPY_AUDIT.md‎

Lines changed: 712 additions & 0 deletions
Large diffs are not rendered by default.

‎apps/docs/EDITORIAL_GUIDE.md‎

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Documentation editorial guide
2+
3+
Use this guide with [Sim's product language](../../.claude/rules/constitution.md). Documentation explains how the current product works. Each page should help a reader complete a task, understand a decision, or look up a contract.
4+
5+
## Voice and terminology
6+
7+
- Lead with one or two sentences explaining the task or behavior. Use active voice, short sentences, concrete examples, and imperative steps.
8+
- Remove promotional adjectives, repeated introductions, generic benefits, and unsupported guarantees. Prefer “Deploy the workflow” to “Unlock the power of automation.”
9+
- Name the actor when access matters: member, workspace Admin, organization owner, personal API-key caller, or workspace API key. A workspace role, OAuth scope, resource grant, and permission-group restriction are different controls.
10+
- Use **Sim** for the conversational agent, **Chat** for its surface, and **workflow builder** for the visual editor. Workflow terminology is appropriate when documenting the Workflows module. Preserve literal command names, protocol identifiers, environment keys, and compatibility fields.
11+
- Use sentence case for titles, descriptions, headings, navigation labels, and API summaries. Preserve product names and acronyms such as API, MCP, OAuth, and SSO. Define unfamiliar terms on introductory pages.
12+
- Match visible UI labels exactly and format them in **bold**. Format commands, paths, fields, statuses, and literal values as `code`. Keep code examples copyable.
13+
- Use KiB, MiB, and GiB for limits defined in powers of 1024. Identify whether a number is a default, a hard limit, a configurable setting, or an illustrative example.
14+
15+
## Page organization
16+
17+
Use the order appropriate to the page. These are ordering rules, not a requirement to add empty sections.
18+
19+
| Page type | Order |
20+
| --- | --- |
21+
| Overview | Purpose → when to use it and supported capabilities → shortest path to use → important boundaries → related docs |
22+
| Task guide | Result → actual prerequisites → numbered steps with examples at the relevant step → verify the result → limits or troubleshooting → related docs |
23+
| Concept | Purpose or decision → behavior and example → boundaries and edge cases → related docs |
24+
| Block reference | Purpose → minimum working example → settings and inputs → outputs → behavior, limits, and errors → distinct additional examples → related docs |
25+
| Operator guide | Deployment scope → prerequisites → supported setup → verification → operational and security consequences → troubleshooting or reference → related docs |
26+
| Command or API reference | Purpose and access → invocation or request example → inputs and defaults → outputs and statuses → consequences, errors, and limits → related references |
27+
28+
Group large references by resource and lifecycle. Keep comprehensive machine references when they serve a separate lookup purpose. Keep prerequisites before the action they govern and destructive consequences before the command or control that triggers them.
29+
30+
Prefer concrete headings such as “Create a connection,” “Outputs,” or “Handle failed requests” over “Overview,” “Advanced features,” and “Best practices.” End onward navigation under **Related docs**, after substantive content.
31+
32+
## Preserve useful information
33+
34+
Shorten by removing repetition and organizing facts. There is no universal word limit.
35+
36+
Keep exact syntax, required fields, permissions, defaults, unsupported cases, resource limits, billing behavior, security boundaries, failure effects, and recovery procedures. Distinguish Cloud from self-hosted deployments and billing-enabled behavior from billing-disabled behavior. Distinguish drafts from deployed versions and an accepted operation from completed background work.
37+
38+
Verify claims against the current owning implementation and visible controls. Use current primary documentation for external services. A repository default does not prove the live hosted configuration. If sources disagree, qualify the statement and record the unresolved conflict in the audit rather than choosing an unsupported guarantee.
39+
40+
Give repeated detail one canonical owner:
41+
42+
| Detail | Canonical owner |
43+
| --- | --- |
44+
| Setup requirements and procedures | The relevant task or operator guide |
45+
| Feature behavior, outputs, and limits | The feature or block reference |
46+
| Roles, resource grants, and membership | Permissions and the specific resource guide |
47+
| Permission-group resolution | Enterprise permission groups |
48+
| Effective retention and cleanup | Enterprise data retention |
49+
| Credits, metering, and billing distinctions | Costs |
50+
| API authentication and envelopes | API getting started and authentication |
51+
| Streaming frames and protocol | Workflow streaming guide |
52+
| CLI options and command consequences | Generated command reference |
53+
54+
A link replaces repeated detail only after the owner contains it. Keep a concise prerequisite or consequence at the point where the reader needs it.
55+
56+
## Components and media
57+
58+
- Fold useful FAQ answers into the section they explain. Keep a separate FAQ only for questions that cannot be organized coherently elsewhere.
59+
- Use a callout for a specific prerequisite or a non-obvious security, data-loss, or operational risk that deserves interruption. Use ordinary prose or a table for normal explanation. Keep important limits visible.
60+
- Use Markdown lists and tables for simple procedures and reference data. Use tabs for distinct configurations and Steps for substantial sequential procedures.
61+
- Match inline code to Sim Chat: normal-weight monospace text, tight padding, and the existing borderless filled surface tokens. Scope the treatment to prose code; preserve fenced examples, API route bars, schema controls, and selector labels.
62+
- Use shared `ChipSelect` controls for API response and request-example pickers, with accessible names that include the current value, checked radio semantics for single choices, and menus aligned to their triggers. Keep docs pickers nonmodal so they do not hide lazily hydrating siblings. Keep response headings free of inherited extra margins. Scope dependency filter styling to `data-object-search-input`, including schema popovers portaled to the body; focus stays inside the field, and touch fields retain the shared target and text sizes.
63+
- Import authored tabs from `@/components/ui/tabs`. Mixed panels retain a content inset; only a single code fence fills the frame. Keep long tab lists horizontally scrollable and long prose references wrapped. For bookmarked panels, use explicit native `TabsList`/`TabsTrigger` controls with `aria-controls` matching each panel ID; changing a panel ID alone leaves the generated control pointing at a nonexistent element.
64+
- Keep a screenshot when it locates a difficult control or shows a meaningful result. Keep a video when motion explains behavior that text or a static example cannot. Remove decorative, redundant, misleading, or non-rendering media.
65+
- Inspect media before describing it as stale. Uninspected remote media is unverified; it may still be removed when the written procedure fully covers its purpose. Do not fabricate replacement captures.
66+
- Remove imports, components, preview definitions, local styling, and assets made unused by an edit after checking all consumers, including integration pages.
67+
68+
## Links and generated sources
69+
70+
Preserve page paths and stable operation IDs. Before renaming a heading, check inbound links from all docs and application code. Preserve a referenced anchor with a custom heading ID such as `## New heading [#existing-anchor]`. Check links from integration pages even when their copy is outside the editing scope.
71+
72+
Edit generated prose at its owner, then regenerate:
73+
74+
| Output | Owner | Command from the repository root |
75+
| --- | --- | --- |
76+
| OpenAPI documents and operation pages | `apps/sim/lib/api/contracts/v2/**`, OpenAPI metadata, and `scripts/openapi/generator.ts` | `bun run generate:openapi` |
77+
| CLI API inputs | Generated OpenAPI and CLI contract overrides | `bun run generate:cli-api` |
78+
| CLI reference pages and navigation | Command tree, CLI metadata, and `scripts/generate-cli-docs.ts` | `bun run generate:cli-docs` |
79+
| MCP operation catalog | Authorized operation definitions and generated OpenAPI | `bun run generate:mcp-operations` |
80+
| v2 route table | Canonical route definitions | `bun run generate:v2-route-table` |
81+
| Marked Agent streaming table | Streaming protocol metadata and `scripts/sync-agent-stream-docs.ts` | `bun run generate:agent-stream-docs` |
82+
83+
Do not hand-edit generated pages, JSON specifications, or marked generated regions. Preserve all argument, option, schema, authentication, and confirmation detail. CLI descriptions also feed command discovery; run the existing search-ranking checks after changing help copy. Validate rendered request examples against their canonical input contracts; schema validity alone may still leave a semantic error such as an invalid serialized workflow.
84+
85+
## Review checklist
86+
87+
Read the complete page and its examples. Check every useful fact against the original before cutting or moving it. Confirm the opening, order, terminology, headings, and component choices follow this guide. Compile MDX, check internal links and anchors, regenerate affected references, and inspect representative rendered pages on desktop and a narrow viewport. Run the repository's required validation gates for source changes.

‎apps/docs/README.md‎

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
1-
# docs
1+
# Sim documentation
22

3-
This is a Next.js application generated with
4-
[Create Fumadocs](https://github.com/fuma-nama/fumadocs).
3+
The documentation site uses Next.js and Fumadocs. Read the [editorial guide](EDITORIAL_GUIDE.md) before changing copy or page organization. The [copy audit](COPY_AUDIT.md) records the complete page inventory, accuracy corrections, and validation.
54

6-
Run development server:
5+
## Develop
6+
7+
From this directory:
78

89
```bash
910
bun run dev
1011
```
1112

12-
Open http://localhost:3000 with your browser to see the result.
13+
Open `http://localhost:3001`. Build the site with `bun run build` and run the built server with `bun run start`.
14+
15+
## Content owners
16+
17+
- Authored pages and navigation: `content/docs/**` and each section's `meta.json`.
18+
- API operation pages: generated `openapi*.json`, owned by `apps/sim/lib/api/contracts/v2/**` and `scripts/openapi/generator.ts`.
19+
- CLI reference pages: generated from the command tree by `scripts/generate-cli-docs.ts`.
20+
- Interactive workflow examples: `components/workflow-preview/**`.
21+
- Local media: `public/static/**`. Videos resolved through `getAssetUrl` may be hosted remotely.
1322

14-
## Learn More
23+
Use the owner and generation commands listed in the editorial guide. Do not hand-edit generated reference pages. The build also generates `llms-full.txt` from the current content.
1524

16-
To learn more about Next.js and Fumadocs, take a look at the following
17-
resources:
25+
## Validate
1826

19-
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js
20-
features and API.
21-
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
22-
- [Fumadocs](https://fumadocs.vercel.app) - learn about Fumadocs
23-
- [Bun Documentation](https://bun.sh/docs) - learn about Bun features and API
27+
From the repository root, run the required lint, type, audit, and test gates in the development guidelines. From this directory, `bun run type-check` compiles MDX and checks the docs workspace, and `bun run build` validates the production site. Inspect affected page types on desktop and a narrow viewport, and check internal links and existing anchors after heading changes.

0 commit comments

Comments
 (0)