Skip to content

feat: add back hierarchical interactive schema viewer for configuration file documentation#711

Merged
moose-code merged 1 commit intomainfrom
add-back-accurate-hierarchical-config-ref
Oct 6, 2025
Merged

feat: add back hierarchical interactive schema viewer for configuration file documentation#711
moose-code merged 1 commit intomainfrom
add-back-accurate-hierarchical-config-ref

Conversation

@JasoonS
Copy link
Contributor

@JasoonS JasoonS commented Oct 2, 2025

Summary by CodeRabbit

  • Documentation
    • Enhanced the Configuration Schema Reference with a human-readable overview and an interactive, hierarchical schema explorer.
    • Introduced a collapsible section to browse the schema inline, improving readability and discoverability.
    • Added an AI/LLM safety note to guide automated tools and avoid unintended indexing.
    • Retained the original reference link and added visual separators and notices for clarity.
    • Replaced static reference-only content with an interactive, user-focused viewer.

@JasoonS JasoonS requested a review from DenhamPreen October 2, 2025 14:46
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 2, 2025

Walkthrough

Updates 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

Cohort / File(s) Summary of Changes
Docs: Interactive schema explorer & AI/LLM note
docs/HyperIndex/Guides/configuration-file.mdx
Added imports for CodeBlock, Schema, JSONSchemaViewer; inserted non-indexable AI/LLM guidance block; embedded a collapsible interactive JSON schema explorer using config.evm.json; retained reference link; added separators/notices; duplicated the AI/LLM block within the section.

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Config schema #687 — Touches the same configuration-file.mdx section, replacing an interactive viewer with a static reference; directly related changes to the same area.

Poem

A nibble of schema, a hop through the tree,
I twitch my ears at JSON’s melody.
Click to expand, explore with delight—
Burrows of keys now come into sight.
With gentle notes for LLMs to see,
This bunny approves, quite interactively. 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly captures the primary feature—the addition of a hierarchical interactive schema viewer for the configuration file documentation—and clearly reflects the main change introduced by the pull request.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-back-accurate-hierarchical-config-ref

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.

❤️ Share

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

@vercel
Copy link

vercel bot commented Oct 2, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
envio-docs Ready Ready Preview Comment Oct 2, 2025 2:47pm

Comment on lines +371 to +375
<!--
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.
-->
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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...

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between e47e8fb and 24e9233.

📒 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.json exists.
  • No local src/theme/JSONSchemaViewer override detected; ensure @theme/JSONSchemaViewer is provided by your theme or a plugin to prevent build errors.

@moose-code moose-code merged commit c535f65 into main Oct 6, 2025
3 checks passed
@moose-code moose-code deleted the add-back-accurate-hierarchical-config-ref branch October 6, 2025 09:33
This was referenced Oct 30, 2025
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.

2 participants