docs: theme diagrams and make shared content SDK-aware#324
Conversation
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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds 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. ChangesSDK Registry and Docs SDK-Awareness
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
docs/app/root.tsx (1)
31-34: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winSerialize
DEFAULT_SDKthe same way asSDK_IDS.The whitelist logic is fine, but embedding
DEFAULT_SDKinside quoted JS is still fragile if an SDK id ever contains'. UsingJSON.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
📒 Files selected for processing (39)
docs/app/components/diagrams/arch-stack.tsxdocs/app/components/diagrams/worker-fork.tsxdocs/app/components/docs/sidebar.tsxdocs/app/components/landing/footer.tsxdocs/app/components/landing/hero.tsxdocs/app/components/landing/sections.tsxdocs/app/components/mdx/index.tsxdocs/app/components/mdx/sdk.tsxdocs/app/components/mermaid.tsxdocs/app/components/sdk-text.tsxdocs/app/components/ui/site-nav.tsxdocs/app/lib/index.tsdocs/app/lib/landing-content.tsdocs/app/lib/mermaid-theme.tsdocs/app/lib/nav.tsdocs/app/lib/sdk-registry.tsdocs/app/lib/sdk-store.tsdocs/app/lib/version.tsdocs/app/root.tsxdocs/app/styles/landing.cssdocs/content/docs/architecture/index.mdxdocs/content/docs/architecture/overview.mdxdocs/content/docs/architecture/resources.mdxdocs/content/docs/architecture/serialization.mdxdocs/content/docs/architecture/worker-pool.mdxdocs/content/docs/node/guides/workflows/conditions.mdxdocs/content/docs/node/guides/workflows/fan-out.mdxdocs/content/docs/node/guides/workflows/gates.mdxdocs/content/docs/node/guides/workflows/saga.mdxdocs/content/docs/node/guides/workflows/sub-workflows.mdxdocs/content/docs/node/more/examples/data-pipeline.mdxdocs/content/docs/python/guides/workflows/building.mdxdocs/content/docs/python/guides/workflows/caching.mdxdocs/content/docs/python/guides/workflows/conditions.mdxdocs/content/docs/python/guides/workflows/fan-out.mdxdocs/content/docs/python/guides/workflows/gates.mdxdocs/content/docs/resources/comparison.mdxdocs/content/docs/resources/faq.mdxscripts/sync-changelog.mjs
💤 Files with no reviewable changes (2)
- docs/content/docs/python/guides/workflows/building.mdx
- docs/app/styles/landing.css
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).
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
app/lib/sdk-registry.ts) — single source of truth.SDK_IDS/SDK_PROFILESdrive theSdktype, nav trees, sidebar switcher, MDX code tabs, the no-flash boot script, and the landing hero. No more scattered"python"/"node"literals.app/lib/mermaid-theme.ts) —applyDiagramTheme()strips authorclassDefs 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 inlineclassDefs removed from MDX; the one stray fenced ```mermaid block converted to<Mermaid>.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 acrossarchitecture/*andresources/{faq,comparison}.HERO_PANESkeyed bySdk; 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.SiteNavand the landing CTA hardcoded/python/...(e.g. "API" →/python/api-referenceeven under Node); they now prefix the active SDK like the footer.CHANGELOG.mdrelease viasync-changelog.mjs→ generatedapp/lib/version.ts, instead of a hardcodedv0.16.Adding a new SDK (java/go)
One
SDK_PROFILESentry +SDK_IDSappend, itscontent/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.mdxCelery/RQ tables andresources/faq.mdxDjango/Flask Q&As remain Python-ecosystem content; accurate Node equivalents (BullMQ, Express) are net-new authoring.Summary by CodeRabbit