web: fix white-screen on non-root classes; trim wasted right-pane margin; add error boundary#31
Merged
Conversation
Inside schema files, document_class.superclasses is an array of
{class_name: "..."} objects, not plain strings (the index.json
normalizes them to strings, hence the mismatch). Detail.tsx was
rendering each ref directly as a React child, throwing "Objects are
not valid as a React child" and unmounting the whole app on any class
that wasn't a root.
- Introduce SuperclassRef = string | {class_name, ...} and a
superclassName() helper; use it when rendering superclass links.
- Wrap Detail in an ErrorBoundary keyed on selection so a future
render bug surfaces a message instead of whiting out the page.
- Drop the leftover `main { max-width: 48rem; margin: 0 auto }` rule
from index.css that was constraining the right pane and leaving
large empty margins around the content.
stevevanhooser
added a commit
that referenced
this pull request
May 14, 2026
… NDIcalc-vis updates) Absorbs main commits 03d9925..988a795. Brings in: - V_delta NDIcalc-vis aggregation + tuning conversion docs (orientation_direction, speed, contrast, SF/TF) - pyproject setuptools auto-discovery fix (PR #29 prep) - web/ scaffold: Vite + React + TypeScript schema viewer (PRs #29, #30, #31, #33) - .github/workflows/deploy-web.yml: GitHub Pages deploy for the web viewer Note: the step-6 commit 03d9925 is already merged into main (via PR #27), so this sync is a fast-forward in tree terms. All step-6 changes (the 4 ontology-collapse conversion markdowns, _universal_renames.md, schema_version on base, class_version resets, V_delta_SPEC/notes edits, regenerated index.json) are preserved verbatim in main and therefore on this branch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hotfix on top of #30. Two visible bugs and one defensive add.
Fixes
White screen when selecting any non-root class (e.g.
app,contrast_tuning).Root cause: inside a schema file,
document_class.superclassesis an array of{class_name: "base"}objects, not plain strings. The repo'sindex.jsonnormalizes them to strings, which is why types and the tree builder worked, butDetail.tsxwas rendering each ref directly as a React child -- React threw "Objects are not valid as a React child" and unmounted the whole app.Fix: add
SuperclassRef = string | {class_name, ...}and asuperclassName()helper; use it when rendering. The fallback for meta schemas (nodocument_class) still works because the index entries already give us strings.Large empty margin between sidebar and content text.
Leftover
main { max-width: 48rem; margin: 0 auto; padding: 2rem 1rem }rule inindex.cssfrom the Step 1 placeholder was centering the right pane inside its grid cell. The viewer's right pane is now styled via.content; removed the stalemainrule.Error boundary wrapping the right pane, keyed on the selected class. A future render bug now shows an in-pane error message instead of whiting out the entire app.
Test plan
app(or any class with a superclass) renders the detail view instead of white-screening.Generated by Claude Code