Skip to content

feat: tasteful concept-link policy in the API reference (events + first-occurrence dedup)#1210

Open
dawnho wants to merge 4 commits into
mainfrom
fix/strip-boilerplate-concept-links-events
Open

feat: tasteful concept-link policy in the API reference (events + first-occurrence dedup)#1210
dawnho wants to merge 4 commits into
mainfrom
fix/strip-boilerplate-concept-links-events

Conversation

@dawnho

@dawnho dawnho commented Jul 1, 2026

Copy link
Copy Markdown
Member

Summary

Generic concept nouns — workspace, connected account, device, Connect Webview, action attempt, client session, webhook — were linked to their core-concept pages on nearly every shared property, so the same link repeated dozens of times per page (workspace ~285×, connected account ~187× across the API reference). This is the docs-rendering half of a tasteful policy for these links; the root-cause source cleanup is seamapi/seam-connect#16179.

Governing principle: a concept link is a teaching aid — worth the most on first encounter, noise on repetition and on mechanical foreign-key fields.

Two behaviors (in mintlify-codegen/concept-links.ts)

  • Event pages → concept links stripped entirely (stripConceptLinks), on prose only, at render time. Advanced audience + maximum repetition (every event re-declares the shared props). Example payloads are left byte-for-byte intact.
  • Every other API pagefirst-occurrence-per-page dedup (dedupeConceptLinks, new Phase H): keep the first link to each concept, unwrap the rest. Skips fenced code blocks so example JSON is untouched.

What's preserved

  • Anchored / sub-path links (e.g. .../connect-webviews/customizing-connect-webviews#..., .../devices/managed-and-unmanaged-devices) — an anchor or deeper path carries real context.
  • All contextual links (thermostat set-points, credential guides, ISO-8601).

Impact

  • Event pages: 214 links removed across 21 pages (276 → 62).
  • Object pages: first-occurrence dedup removes 25 of 36 concept links across 7 pages, keeping one per concept.

Relationship to the source fix

seamapi/seam-connect#16179 removes the foreign-key concept links at the source of truth (public-types/models), which flows to @seamapi/types@seamapi/blueprint → these docs on the next dependency bump — and also cleans SDK type docstrings. This PR delivers the policy to the live docs now, and the first-occurrence dedup remains the durable home for the per-page rule (which can't be expressed in a per-field source description).

Verification

  • npm run generate:mintlify regenerated cleanly; typecheck, eslint, prettier --check all pass.
  • Event pages: 0 concept links remaining. Object pages: first link per concept kept, contextual/anchored links preserved.

🤖 Generated with Claude Code

Event documentation pages re-declare shared properties (workspace_id,
connected_account_id, device_id, ...) on every event, and each carried the
same generic concept-page link from upstream @seamapi/types descriptions —
workspace linked ~100x per page, connected account ~70x. These repeat links
add noise without aiding comprehension.

Add stripBoilerplateConceptLinks() in the event codegen to unwrap links to the
seven generic core-concept/developer-tools pages, leaving the link text intact.
Applied to event/property prose only (never the JSON example payloads, which
must echo descriptions verbatim). Anchored and sub-path links (e.g.
workspaces#sandbox-workspaces, devices/managed-and-unmanaged-devices) and all
contextual links (thermostat set-points, credential guides, ISO-8601) are kept.

Removes 214 boilerplate links across 21 event pages (276 -> 62).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dawnho dawnho requested a review from a team as a code owner July 1, 2026 22:47
@mintlify

mintlify Bot commented Jul 1, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
seam 🟢 Ready View Preview Jul 1, 2026, 11:04 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Extend the concept-link policy beyond event pages. Consolidate the logic into a
shared `concept-links.ts` module and add a codegen phase that, on every
non-event API page, keeps the first link to each generic concept (workspace,
connected account, device, ...) and unwraps every later occurrence to plain
text. A concept link teaches on first encounter; repeating it on every shared
property is noise.

- `concept-links.ts`: shared `BOILERPLATE_CONCEPT_PATHS`, `stripConceptLinks`
  (event pages, unwrap all), `dedupeConceptLinks` (other pages, keep first).
  The dedup skips fenced code blocks so example JSON payloads are untouched.
- `events.ts`: reuse `stripConceptLinks` instead of a local copy.
- `generate.ts`: run the dedup after canonicalization (Phase H).

Anchored/sub-path links (e.g. `.../connect-webviews/customizing-...#...`) are
left intact — only bare generic concept links are deduped. Removes 25 of 36
concept links across 7 object pages while preserving all contextual links.

The root-cause cleanup of the foreign-key concept links lives upstream in
seam-connect (seamapi/seam-connect#16179); this is the docs-rendering half.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dawnho dawnho changed the title feat: strip boilerplate concept links from event pages feat: tasteful concept-link policy in the API reference (events + first-occurrence dedup) Jul 1, 2026
dawnho added 2 commits July 1, 2026 18:18
…-concept-links-events

# Conflicts:
#	mintlify-docs/api/client_sessions/object.mdx
…917.0)

Regenerate object/event pages on the merged tree so the concept-link policy
(event strip + first-occurrence dedup) is applied on top of the 1.917.0 type
bump and the object-page TOC removal from main. openapi.json is left as main's
(the concept-link changes only affect .mdx).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant