FE-1509: Add the notebook view's data model and layout foundations - #9406
FE-1509: Add the notebook view's data model and layout foundations#9406kube wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
Semgrep found 1 RegExp() called with a View Dataflow Graphflowchart LR
classDef invis fill:white, stroke: none
classDef default fill:#e7f5ff, color:#1c7fd6, stroke: none
subgraph File0["<b>libs/@hashintel/petrinaut/src/ui/views/Notebook/notebook-model.ts</b>"]
direction LR
%% Source
subgraph Source
direction LR
v0["<a href=https://github.com/hashintel/hash/blob/37fa8fec26558cdaa52191e602ef3fc9894682eb/libs/@hashintel/petrinaut/src/ui/views/Notebook/notebook-model.ts#L197 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 197] variableName</a>"]
end
%% Intermediate
subgraph Traces0[Traces]
direction TB
v2["<a href=https://github.com/hashintel/hash/blob/37fa8fec26558cdaa52191e602ef3fc9894682eb/libs/@hashintel/petrinaut/src/ui/views/Notebook/notebook-model.ts#L197 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 197] variableName</a>"]
v3["<a href=https://github.com/hashintel/hash/blob/37fa8fec26558cdaa52191e602ef3fc9894682eb/libs/@hashintel/petrinaut/src/ui/views/Notebook/notebook-model.ts#L202 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 202] escapeRegExp</a>"]
v4["<a href=https://github.com/hashintel/hash/blob/37fa8fec26558cdaa52191e602ef3fc9894682eb/libs/@hashintel/petrinaut/src/ui/views/Notebook/notebook-model.ts#L190 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 190] value</a>"]
v5["<a href=https://github.com/hashintel/hash/blob/37fa8fec26558cdaa52191e602ef3fc9894682eb/libs/@hashintel/petrinaut/src/ui/views/Notebook/notebook-model.ts#L202 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 202] `</a>"]
end
v2 --> v3
v3 --> v4
v4 --> v5
%% Sink
subgraph Sink
direction LR
v1["<a href=https://github.com/hashintel/hash/blob/37fa8fec26558cdaa52191e602ef3fc9894682eb/libs/@hashintel/petrinaut/src/ui/views/Notebook/notebook-model.ts#L202 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 202] new RegExp(`\\b${escapeRegExp(variableName)}\\b`, "u")</a>"]
end
end
%% Class Assignment
Source:::invis
Sink:::invis
Traces0:::invis
File0:::invis
%% Connections
Source --> Traces0
Traces0 --> Sink
|
37fa8fe to
d32fadc
Compare
d32fadc to
12bece8
Compare
12bece8 to
2321609
Compare
2321609 to
48e4267
Compare
48e4267 to
e571362
Compare
PR SummaryLow Risk Overview
Includes architecture README and broad Vitest coverage for all three modules. Reviewed by Cursor Bugbot for commit 235694d. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e571362. Configure here.
Pure, unit-tested projections of an SDCPN for the notebook view built on top of them: the cell list and its dependency-edge index covering all five entity kinds, topological cell ordering with declarations inlined before their first user, and a cut-down Sugiyama layered layout with a focus mode that re-layers by hop distance.
e571362 to
235694d
Compare

🌟 What is the purpose of this PR?
First data layer of the Notebook view stack, stacked on #9429: the pure projections the view renders from. No UI changes — nothing here is reachable until the next layer lands.
🔗 Related links
🔍 What does this change?
notebook-model: projects an SDCPN into a flat cell list and a single dependency-edge index covering all five entity kinds; both gutter directions derive from the same edges so they cannot disagree. Parameter usage is a word-boundary text match against transition and equation code.notebook-order: topological cell ordering that inlines each type, equation and parameter just before its first user, without ever dropping a cell.net-graph-layout: a cut-down Sugiyama layered layout (DFS cycle-breaking, longest-path layering, barycentre ordering) plus a focus mode that re-layers by hop distance from one node, with unreachable components keeping their own layered band.The structural analyses (cycles, initial places) are deliberately not here — they arrive above the view in #9431/#9432 for separate review.
Pre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
📜 Does this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
🛡 What tests cover this?
notebook-model.test.ts(cell projections, connection index, fuzzy match, dependent counts, net graph),notebook-order.test.ts(inlining, unused declarations, never dropping cells),net-graph-layout.test.ts(layering, cycle breaking, focus mode, edge geometry, determinism).❓ How to test this?
npx turbo run test:unit --filter @hashintel/petrinaut