Build Toward the Whole: notionwidgets - #1
Merged
Merged
Conversation
engine/validate.js documents itself as the canonical graph contract but nothing in the repo executed it: the shipped widget does not import it and scripts/check-site.mjs only ran JSON.parse over maps/. The Pages gate therefore accepted datasets with duplicate ids or edges pointing at unknown nodes. The check script now imports validateDataset and fails on schema errors, printing warnings for orphans. The internal link check also now mirrors the deploy job exclusions (_* and .* paths) so a link that resolves in the repo but 404s on Pages is caught before deploy. Verified: node scripts/check-site.mjs passes on main content and fails on an injected duplicate id, an injected dangling edge, and an injected link into _archive/. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01656XvdqNAVojSPQBtLZAAt
The widget's only path to real data is the nodes and edges URL params, but it expected an ad hoc shape (name, s, t, top level tags) that no dataset in the repo uses. The canonical contract in engine/validate.js and every maps/*/dataset.json use label, from, to and meta. Passing a repo dataset crashed the page with a TypeError, and any non array JSON crashed nodes.map, contradicting the README rule that invalid params fall back to safe defaults. Add a normalization step that accepts both shapes, drops malformed or duplicate nodes and edges that reference unknown ids, defaults missing fields, and falls back to the demo graph when no usable nodes remain. Edge types outside structure, data and reference now get the structure stroke instead of an undefined attribute. The demo path and the old URL shape are unchanged. Verified in headless Chromium with D3 and Dagre served locally: demo renders 12 nodes and 18 edges before and after; the notion-workspace dataset renders 24 nodes and 30 edges after (page error before); object and non JSON input fall back to demo after (page error before). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01656XvdqNAVojSPQBtLZAAt
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Applies the Build Toward the Whole patch series.
Commits
Gate
node scripts/check-site.mjs— passing locally on this branch.Not for merge yet.