Skip to content

docs: theme diagrams and make shared content SDK-aware#324

Merged
pratyush618 merged 11 commits into
masterfrom
docs/sdk-aware-diagrams
Jun 28, 2026
Merged

docs: theme diagrams and make shared content SDK-aware#324
pratyush618 merged 11 commits into
masterfrom
docs/sdk-aware-diagrams

Conversation

@pratyush618

@pratyush618 pratyush618 commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

Curates the docs-site diagrams to the brand theme and makes the shared sections (architecture, resources) and the landing page follow the selected SDK — built so adding Java/Go later is a one-entry change.

What changed

  • SDK registry (app/lib/sdk-registry.ts) — single source of truth. SDK_IDS/SDK_PROFILES drive the Sdk type, nav trees, sidebar switcher, MDX code tabs, the no-flash boot script, and the landing hero. No more scattered "python"/"node" literals.
  • Central Mermaid theming (app/lib/mermaid-theme.ts)applyDiagramTheme() strips author classDefs and injects one brand-aligned, dark/light-aware semantic palette (with aliases for every legacy class name). Charts now only name states (A:::failed). All inline classDefs removed from MDX; the one stray fenced ```mermaid block converted to <Mermaid>.
  • SDK-aware shared content — architecture diagrams (ArchitectureStack, WorkerDispatch, ResourcePipeline) and shared prose adapt to the selected SDK via no-flash atoms (<SdkName/> <SdkLang/> <SdkBinding/> <SdkSwap/>, ship-all-variants + CSS hide). Applied across architecture/* and resources/{faq,comparison}.
  • Hero linked to SDKHERO_PANES keyed by Sdk; clicking a code-snippet tab sets the global SDK, so the hero copy, install/quickstart links and docs sidebar all follow. "Soon" tabs are data-driven.
  • Nav link fixSiteNav and the landing CTA hardcoded /python/... (e.g. "API" → /python/api-reference even under Node); they now prefix the active SDK like the footer.
  • Footer version — derived from the latest CHANGELOG.md release via sync-changelog.mjs → generated app/lib/version.ts, instead of a hardcoded v0.16.
  • Polish — removed the stray traveling dot from the "result written back to the store" data-flow diagram.

Adding a new SDK (java/go)

One SDK_PROFILES entry + SDK_IDS append, its content/docs/<id>/ tree, and a per-SDK branch in the two architecture-diagram content maps. Everything else derives automatically.

Verification

pnpm typecheck ✓ · pnpm lint ✓ · pnpm build ✓ (prerenders all routes). Diagram theming and SDK-switching confirmed via headless-Chrome screenshots/DOM dumps (dark mode + Python/Node).

Out of scope (flagged, not fabricated)

  • resources/changelog.mdx — auto-generated, intentionally unified across SDKs.
  • resources/comparison.mdx Celery/RQ tables and resources/faq.mdx Django/Flask Q&As remain Python-ecosystem content; accurate Node equivalents (BullMQ, Express) are net-new authoring.

Summary by CodeRabbit

  • New Features
    • Docs and landing pages now adapt across SDKs with SDK-aware labels, links, and swapped examples/snippets.
    • Architecture and worker diagrams now render SDK-specific UI content.
  • Bug Fixes
    • SDK switching and routing now derive the active SDK from a registry and keep links/hrefs consistent.
    • Mermaid rendering now applies shared theme tokens for consistent light/dark output.
  • Documentation
    • Updated architecture, worker-pool, resources, serialization, workflows, FAQ, comparison, and examples to be SDK-aware.
    • Footer now shows the current app version dynamically.
  • Chores
    • Mermaid diagrams were standardized to use a shared diagram wrapper/theme preprocessing.

One SDK_PROFILES/SDK_IDS source drives the Sdk type, nav, sidebar, MDX tabs and the no-flash boot script, so adding a language is one entry.
applyDiagramTheme() strips author classDefs and injects a brand-aligned, dark/light-aware semantic palette; charts only name states. All inline classDefs dropped.
Architecture diagrams + shared prose adapt to the selected SDK via SdkName/SdkLang/SdkBinding/SdkSwap no-flash atoms.
SiteNav LINKS and the landing CTA hardcoded /python/...; they now prefix the active SDK like the footer, so e.g. API points to /node/api-reference under Node.
sync-changelog.mjs now emits app/lib/version.ts from the latest CHANGELOG.md release; the footer reads it instead of a hardcoded v0.16.
@github-actions github-actions Bot added the docs label Jun 28, 2026
@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3cf4d45a-71be-4923-b0b4-cda181ff7c85

📥 Commits

Reviewing files that changed from the base of the PR and between f708543 and 3dd357a.

📒 Files selected for processing (2)
  • docs/app/components/landing/hero.tsx
  • docs/content/docs/node/guides/workflows/fan-out.mdx
✅ Files skipped from review due to trivial changes (1)
  • docs/content/docs/node/guides/workflows/fan-out.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/app/components/landing/hero.tsx

📝 Walkthrough

Walkthrough

Adds a shared SDK registry and version generator, then updates docs navigation, landing UI, Mermaid theming, SDK-aware text/diagram components, and architecture/resources content to render Python and Node variants from shared SDK data.

Changes

SDK Registry and Docs SDK-Awareness

Layer / File(s) Summary
SDK registry and version sync
docs/app/lib/sdk-registry.ts, docs/app/lib/sdk-store.ts, docs/app/lib/index.ts, docs/app/lib/version.ts, scripts/sync-changelog.mjs
Adds the shared SDK registry, updates the SDK store to use it, re-exports the registry, and generates VERSION from the changelog sync script.
Mermaid theming and diagram cleanup
docs/app/lib/mermaid-theme.ts, docs/app/components/mermaid.tsx, docs/content/docs/node/guides/workflows/*, docs/content/docs/python/guides/workflows/*, docs/content/docs/node/more/examples/data-pipeline.mdx
Adds shared Mermaid theme helpers, refactors the renderer to use them, and removes inline Mermaid class styling from workflow diagrams.
SDK text atoms and diagram snippets
docs/app/components/sdk-text.tsx, docs/app/components/mdx/index.tsx, docs/app/components/mdx/sdk.tsx, docs/app/components/diagrams/arch-stack.tsx, docs/app/components/diagrams/worker-fork.tsx
Adds SDK-aware text components, registers them for MDX, updates SDK tab labels, and rewrites diagram text to swap Python and Node variants.
Registry-driven navigation and bootstrap
docs/app/lib/nav.ts, docs/app/components/ui/site-nav.tsx, docs/app/root.tsx, docs/app/components/docs/sidebar.tsx
Builds navigation from SDK profiles, generalizes SDK path handling, and updates the site nav, root SDK bootstrap, and sidebar labels to use registry data.
Landing page and SDK-aware docs content
docs/app/lib/landing-content.ts, docs/app/components/landing/hero.tsx, docs/app/components/landing/sections.tsx, docs/app/components/landing/footer.tsx, docs/app/styles/landing.css, docs/content/docs/architecture/*, docs/content/docs/resources/*
Updates landing data and hero rendering to use SDK profiles, changes the quickstart route to follow the active SDK, removes the landing spark animation, and rewrites architecture/resources documentation with SDK-generic placeholders and SDK-specific sections.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • ByteVeda/taskito#273: Updates the same diagram components that this PR extends with SDK-aware labels and body swaps.
  • ByteVeda/taskito#275: Also changes docs navigation and route construction away from hardcoded SDK-prefixed paths.
  • ByteVeda/taskito#295: Shares the changelog sync path and version generation flow that this PR expands.

Poem

🐇 I hopped through registries, neat and bright,
New SDK swaps made the docs dance right.
Mermaid themes now twinkle in line,
And version numbers bloom just fine.
Hop-hop, the docs now feel divine!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 55.88% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: Mermaid diagram theming and SDK-aware shared docs content.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/sdk-aware-diagrams

Comment @coderabbitai help to get the list of available commands.

Comment thread docs/app/root.tsx Fixed
@pratyush618 pratyush618 changed the title docs: SDK-aware shared content + themed diagrams docs: theme diagrams and make shared content SDK-aware Jun 28, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
docs/app/root.tsx (1)

31-34: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Serialize DEFAULT_SDK the same way as SDK_IDS.

The whitelist logic is fine, but embedding DEFAULT_SDK inside quoted JS is still fragile if an SDK id ever contains '. Using JSON.stringify(DEFAULT_SDK) in both spots keeps the bootstrap syntactically safe and should also quiet the CodeQL warning on Line 34.

Proposed change
-const SDK_INIT = `(function(){try{var ids=${JSON.stringify([...SDK_IDS])},def='${DEFAULT_SDK}';var u=new URLSearchParams(location.search).get('sdk');var s=ids.indexOf(u)>=0?u:(localStorage.getItem('taskito-sdk')||def);if(ids.indexOf(s)<0){s=def;}document.documentElement.setAttribute('data-sdk',s);}catch(e){document.documentElement.setAttribute('data-sdk','${DEFAULT_SDK}');}})();`;
+const SDK_INIT = `(function(){try{var ids=${JSON.stringify([...SDK_IDS])},def=${JSON.stringify(DEFAULT_SDK)};var u=new URLSearchParams(location.search).get('sdk');var s=ids.indexOf(u)>=0?u:(localStorage.getItem('taskito-sdk')||def);if(ids.indexOf(s)<0){s=def;}document.documentElement.setAttribute('data-sdk',s);}catch(e){document.documentElement.setAttribute('data-sdk',${JSON.stringify(DEFAULT_SDK)});}})();`;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/app/root.tsx` around lines 31 - 34, The SDK bootstrap string in SDK_INIT
embeds DEFAULT_SDK as a raw quoted JS literal, which is fragile if an id
contains a quote. Update the SDK_INIT construction in root.tsx to serialize
DEFAULT_SDK the same way as SDK_IDS, using JSON.stringify(DEFAULT_SDK) for both
the fallback assignment and the catch block so the generated script stays
syntactically safe and CodeQL is satisfied.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/app/components/landing/hero.tsx`:
- Around line 85-98: The hero SDK selector in hero.tsx only updates a visual
class, so the active selection is not exposed to assistive tech. Update the
buttons rendered from HERO_PANES in the selector to include pressed/selection
state, using the existing sdk and setSdk logic in the same map. At minimum add
aria-pressed to the active button, or apply full tablist/tab semantics if you
want the snippet panel announced as a tabset.

In `@docs/content/docs/node/guides/workflows/fan-out.mdx`:
- Around line 11-19: The fan-in step is named inconsistently across the fan-out
example, which makes it unclear whether the docs refer to one node or multiple
different nodes. Update the Mermaid diagram and the surrounding walkthrough in
the fan-out guide to use a single consistent step name, and align the references
in the example text and any later mention of the same node so they all match the
same symbol (for example, the fan-in node currently shown as aggregate, collect,
or summarize).

---

Nitpick comments:
In `@docs/app/root.tsx`:
- Around line 31-34: The SDK bootstrap string in SDK_INIT embeds DEFAULT_SDK as
a raw quoted JS literal, which is fragile if an id contains a quote. Update the
SDK_INIT construction in root.tsx to serialize DEFAULT_SDK the same way as
SDK_IDS, using JSON.stringify(DEFAULT_SDK) for both the fallback assignment and
the catch block so the generated script stays syntactically safe and CodeQL is
satisfied.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a9c43db2-0372-497c-b94e-aa58abc464dd

📥 Commits

Reviewing files that changed from the base of the PR and between 486a880 and b6b6137.

📒 Files selected for processing (39)
  • docs/app/components/diagrams/arch-stack.tsx
  • docs/app/components/diagrams/worker-fork.tsx
  • docs/app/components/docs/sidebar.tsx
  • docs/app/components/landing/footer.tsx
  • docs/app/components/landing/hero.tsx
  • docs/app/components/landing/sections.tsx
  • docs/app/components/mdx/index.tsx
  • docs/app/components/mdx/sdk.tsx
  • docs/app/components/mermaid.tsx
  • docs/app/components/sdk-text.tsx
  • docs/app/components/ui/site-nav.tsx
  • docs/app/lib/index.ts
  • docs/app/lib/landing-content.ts
  • docs/app/lib/mermaid-theme.ts
  • docs/app/lib/nav.ts
  • docs/app/lib/sdk-registry.ts
  • docs/app/lib/sdk-store.ts
  • docs/app/lib/version.ts
  • docs/app/root.tsx
  • docs/app/styles/landing.css
  • docs/content/docs/architecture/index.mdx
  • docs/content/docs/architecture/overview.mdx
  • docs/content/docs/architecture/resources.mdx
  • docs/content/docs/architecture/serialization.mdx
  • docs/content/docs/architecture/worker-pool.mdx
  • docs/content/docs/node/guides/workflows/conditions.mdx
  • docs/content/docs/node/guides/workflows/fan-out.mdx
  • docs/content/docs/node/guides/workflows/gates.mdx
  • docs/content/docs/node/guides/workflows/saga.mdx
  • docs/content/docs/node/guides/workflows/sub-workflows.mdx
  • docs/content/docs/node/more/examples/data-pipeline.mdx
  • docs/content/docs/python/guides/workflows/building.mdx
  • docs/content/docs/python/guides/workflows/caching.mdx
  • docs/content/docs/python/guides/workflows/conditions.mdx
  • docs/content/docs/python/guides/workflows/fan-out.mdx
  • docs/content/docs/python/guides/workflows/gates.mdx
  • docs/content/docs/resources/comparison.mdx
  • docs/content/docs/resources/faq.mdx
  • scripts/sync-changelog.mjs
💤 Files with no reviewable changes (2)
  • docs/content/docs/python/guides/workflows/building.mdx
  • docs/app/styles/landing.css

Comment thread docs/app/components/landing/hero.tsx
Comment thread docs/content/docs/node/guides/workflows/fan-out.mdx
Pass the registry id list as an inert data-sdk-config attribute and parse it in a static bootstrap, instead of interpolating values into the script (CodeQL code-construction).
@pratyush618 pratyush618 merged commit 5176752 into master Jun 28, 2026
15 checks passed
@pratyush618 pratyush618 deleted the docs/sdk-aware-diagrams branch June 28, 2026 11:08
@coderabbitai coderabbitai Bot mentioned this pull request Jul 7, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants