feat: add back hierarchical interactive schema viewer for configuration file documentation#711
Conversation
…on file documentation
WalkthroughUpdates the configuration-file.mdx guide to include an AI/LLM-safety note and an interactive JSONSchemaViewer powered by a loaded config.evm.json schema, with new imports, a collapsible details section, and concluding notices. The static reference is retained, and the AI/LLM informational block appears twice. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant DocsPage as Docs page (configuration-file.mdx)
participant Viewer as JSONSchemaViewer
participant Schema as config.evm.json
User->>DocsPage: Open Configuration Schema Reference
DocsPage->>User: Show AI/LLM guidance note
User->>DocsPage: Expand "Schema Explorer" details
DocsPage->>Viewer: Initialize interactive viewer
Viewer->>Schema: Load schema
Schema-->>Viewer: JSON Schema data
Viewer-->>User: Render hierarchical schema UI
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| <!-- | ||
| LLM NOTICE: This interactive schema viewer is for human use only. | ||
| LLMs should use the static markdown reference at /docs/HyperIndex/config-schema-reference instead. | ||
| This section contains dynamic content that may not be properly indexed or understood by AI systems. | ||
| --> |
There was a problem hiding this comment.
Maybe we remove this. It is a little bit extra 😅 Bottom line is I really think that it's gonna always be more accurate to use something like this than that script - and it is nice to see everything as a hierarchy.
I know it isn't the best for LLMs, but it is great for humans...
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
docs/HyperIndex/Guides/configuration-file.mdx (3)
377-383: Wrap viewer with BrowserOnly to prevent SSR/hydration issues.Safer if the viewer uses window/DOM APIs.
Apply:
+import BrowserOnly from "@docusaurus/BrowserOnly"; @@ -<div style={{ marginTop: "1rem" }} data-llm-ignore="true"> - <JSONSchemaViewer schema={Schema} /> -</div> +<div style={{ marginTop: "1rem" }} data-llm-ignore="true"> + <BrowserOnly fallback={<div>Loading schema viewer…</div>}> + {() => <JSONSchemaViewer schema={Schema} />} + </BrowserOnly> + </div>
377-385: Consider lazy-loading the heavy viewer/schema on expand to cut bundle size.Improves time-to-content for this long page.
One approach (outline):
+import React, {useState, Suspense} from "react"; +const LazyViewer = React.lazy(() => import("@theme/JSONSchemaViewer")); +// If schema is large, load it on demand: +let LoadedSchema: any = null; + -<details> +<details onToggle={(e) => { + if (e.currentTarget.open && !LoadedSchema) { + import("@site/static/schemas/config.evm.json").then(m => { LoadedSchema = m.default || m; }); + } +}}> <summary><strong>📋 Hierarchical Interactive Schema Explorer</strong> <em>(Click to expand - For human reference only)</em></summary> <div style={{ marginTop: "1rem" }} data-llm-ignore="true"> - <JSONSchemaViewer schema={Schema} /> + <Suspense fallback={<div>Loading schema viewer…</div>}> + {LoadedSchema ? <LazyViewer schema={LoadedSchema} /> : null} + </Suspense> </div> </details>Note: If you prefer simpler, at least lazy-load the component and keep the static schema.
367-370: Optional: move imports to the top of the file for consistency.Keeps MDX imports consolidated; the MDX compiler will hoist, but top-of-file is clearer.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/HyperIndex/Guides/configuration-file.mdx(1 hunks)
🔇 Additional comments (2)
docs/HyperIndex/Guides/configuration-file.mdx (2)
363-366: Good addition: clear guidance for AI vs human readers.Helpful context without degrading UX.
367-370: Verify JSONSchemaViewer alias and schema path
static/schemas/config.evm.jsonexists.- No local
src/theme/JSONSchemaVieweroverride detected; ensure@theme/JSONSchemaVieweris provided by your theme or a plugin to prevent build errors.
Summary by CodeRabbit