Skip to content

Fix graph extraction, 2D layout, and 3D selection camera - #20

Merged
cursor[bot] merged 7 commits into
mainfrom
cursor/oss-pr-graph-verify-c891
Aug 15, 2026
Merged

Fix graph extraction, 2D layout, and 3D selection camera#20
cursor[bot] merged 7 commits into
mainfrom
cursor/oss-pr-graph-verify-c891

Conversation

@Modsofthenation

@Modsofthenation Modsofthenation commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Ran Loadpath against a second round of open-source Django(+frontend) PRs and fixed the graph/inspector issues that showed up.

PRs exercised: pretix #6474, Weblate #21050, NetBox #22928, addons-server #25298, experimenter #16799, wger #2486, treeherder #9779, tecken #3339, taiga-back #252, django-cms #8781.

What was wrong

  • Files under app/views/*.py (and models/, forms/, tests/, …) were namespaced as views.CartApplyVoucher. Pretix alone minted 333 colliding view ids, so route→view edges were pruned and the inspector mixed apps.
  • re_path(r"^$") and re_path(r"^", include(...)) still rendered as ^$ / ^. Named groups like (?P<slug>…)/clone/ showed as regex soup in the graph and inspector.
  • NetBox’s netbox-graphiql workspace and Experimenter’s demo-app / legacy-ui won as the React root. Treeherder’s real UI is ui/, not the repo root.
  • django-filter FilterSet classes were invisible, so wger-style filterset_class PRs produced a review graph of disconnected tests.
  • 2D layout placed nodes in alphabetical columns with empty-layer gaps, ignored edges, and drew a label on every edge, so graphs were hard to follow.
  • Selecting a node in 3D layers rebuilt the whole WebGL scene, which reset orbit/zoom and flashed white when clicking off.
  • Switching the workspace dropdown left the previous review graph on screen with no loading indicator while the new architecture fetched.

Fixes

  • _app_from_path walks past views/ / models/ / tests/ / api/ / viewsets/ / filtersets/ packages unless that token is the last remaining segment, so nutrition/api/views.py is nutrition.IngredientViewSet and a root api app stays api.
  • Empty regex mounts use the same readable labels as path(""). Named groups — including nested (?:…) — become {slug}/clone on the node and in composed URLs.
  • Skip GraphiQL/demo/legacy trees even when the folder name is prefixed (netbox-graphiql); prefer a top-level ui/ folder (Treeherder).
  • Extract FilterSet as a form node, link filterset_class from the view, and tag the inspector with a filterset role.
  • 2D layout packs occupied layers, puts URL names in their own column, orders nodes with adjacent-layer barycenter, spaces boxes so they cannot overlap, wraps long names at / and ., and shows edge labels only for the selected node. fitView runs when the graph topology changes, not when a node is selected.
  • 3D selection paints in place instead of recreating the renderer. Camera pose is restored if the scene does rebuild; the canvas host stays on --graph-bg so deselect no longer flashes white.
  • Workspace switches clear the stale review, show a progress bar plus “Loading {repo}…” placeholder, wait for architecture and git refs, then show the indexed architecture graph. A busy index/review no longer silently drops an explorer pick.

After the fixes (same 10 PRs)

PR Review graph Notes
pretix #6474 8 nodes / 7 edges WidgetAPIProductList; routes {subevent}/widget/product_list; UI inspector loads facts + neighbors
Weblate #21050 3241 / 4352 serializer-field change; no views. collisions
NetBox #22928 455 / 572 signals review stays linked
addons-server #25298 234 / 0 mostly tests on untyped actions.py
experimenter #16799 1653 / 1945 forms + routes
wger #2486 770 / 1253 was 28 / 0; now IngredientFilterSet and friends
treeherder #9779 276 / 352 React root is ui/
tecken #3339 15 / 2 upload view + management command
taiga-back #252 153 / 0 validators.py still outside the typed graph
django-cms #8781 1 / 0 JS-only pagetree change

Pretix UI after the layout and 3D camera fixes:

2D review graph columns
2D selected node with inspector
pretix_2d_layout_select_nodes.mp4
pretix_3d_select_deselect_no_jump.mp4

Workspace switch loading:

Loading pretix workspace placeholder
workspace_switch_loading.mp4

Playwright test_ui_index_review_graph_copy_and_workspace and test_ui_workspace_switch_shows_loading pass.

include:module names on empty path("", include(...)) mounts are intentional unique labels, not leaked child URLs. Root routes named / are real index URLs.

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

Summary by CodeRabbit

  • New Features

    • Added 3D graph visualization with node selection, neighbor highlighting, hover details, camera preservation, and reduced-motion support.
    • Improved graph layout to reduce overlapping and crossing connections.
    • Added Django FilterSet detection, model/view relationships, and clearer route names.
    • Added a dedicated “URL names” graph layer.
  • Improvements

    • React project detection now better identifies the correct UI directory.
    • Graph nodes are larger and support two-line names.
    • Edge labels are shown only for connections relevant to the selected node.

A second OSS PR sweep (pretix, Weblate, NetBox, addons-server, and others)
showed view/form/model nodes under app/views/*.py sharing a views.* id, so
route edges were pruned and the inspector mixed apps. Name those nodes from
the Django app, treat re_path("^$") / named groups as real URLs, skip
GraphiQL and demo-app trees when detecting React, and extract django-filter
FilterSets so filterset_class reviews have a typed graph.

Co-authored-by: zord.lack.net <zord.lack.net@gmail.com>
@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@cursor[bot], you've reached your PR review limit, so we couldn't start this review.

Next review available in: 20 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: ed0f375a-ff53-419f-a95b-4c7752f45550

📥 Commits

Reviewing files that changed from the base of the PR and between 06ff147 and 5428146.

📒 Files selected for processing (13)
  • src/loadpath/extractors/django.py
  • src/loadpath/index.py
  • src/loadpath/static/assets/LayeredGraph3D-DQUYVbjc.js
  • src/loadpath/static/assets/index-B1geo4g4.css
  • src/loadpath/static/assets/index-CE5vlBBA.js
  • src/loadpath/static/index.html
  • tests/e2e/test_ui_flows.py
  • tests/unit/test_django_extractors.py
  • ui/src/App.tsx
  • ui/src/styles.css
  • ui/src/styles.test.ts
  • ui/src/types.test.ts
  • ui/src/types.ts
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: 58331939-7cab-4111-91b9-f5709b29401d

📥 Commits

Reviewing files that changed from the base of the PR and between f31a4a3 and 06ff147.

📒 Files selected for processing (22)
  • src/loadpath/detect.py
  • src/loadpath/extractors/django.py
  • src/loadpath/index.py
  • src/loadpath/static/assets/LayeredGraph3D-B5oUhOgB.js
  • src/loadpath/static/assets/index-Dc1-DXoM.js
  • src/loadpath/static/assets/index-DiHJRVJW.css
  • src/loadpath/static/index.html
  • src/loadpath/stitch/openapi.py
  • tests/unit/test_detect.py
  • tests/unit/test_django_extractors.py
  • tests/unit/test_index_and_stitch.py
  • ui/src/ImpactGraph.test.ts
  • ui/src/ImpactGraph.tsx
  • ui/src/LayeredGraph3D.tsx
  • ui/src/graphView.test.ts
  • ui/src/graphView.ts
  • ui/src/nodeInspector.test.ts
  • ui/src/nodeInspector.ts
  • ui/src/styles.css
  • ui/src/styles.test.ts
  • ui/src/types.test.ts
  • ui/src/types.ts

📝 Walkthrough

Walkthrough

React and Django indexing now detect relevant roots, normalize routes, and model FilterSets. The frontend adds edge-aware layouts, topology-aware graph interactions, persistent 3D camera state, updated styling, and rebuilt production assets.

Changes

Backend indexing and extraction

Layer / File(s) Summary
React root detection
src/loadpath/detect.py, tests/unit/test_detect.py
React detection prefers ui, centralizes exclusions, and skips GraphiQL, demo, example, Storybook, Docusaurus, and legacy UI paths.
Django route and FilterSet extraction
src/loadpath/extractors/django.py, src/loadpath/stitch/openapi.py, tests/unit/test_django_extractors.py, tests/unit/test_index_and_stitch.py
Django extraction normalizes regex routes, derives app packages, detects FilterSets, links FilterSets to views, and formats named route groups as placeholders.
Index revision
src/loadpath/index.py
INDEX_REVISION changes from 8 to 9.

Frontend graph visualization

Layer / File(s) Summary
Layered graph layout
ui/src/types.ts, ui/src/types.test.ts, ui/src/graphView.ts
The graph uses shared dimensions, Django layer priorities, edge-aware barycenter ordering, and compact occupied-layer packing.
Impact graph interaction
ui/src/ImpactGraph.tsx, ui/src/ImpactGraph.test.ts, ui/src/graphView.test.ts
Selected edges display labels, 3D focus is scoped separately, and viewport fitting runs after visible topology changes.
3D graph lifecycle and selection
ui/src/LayeredGraph3D.tsx, src/loadpath/static/assets/LayeredGraph3D-B5oUhOgB.js
The 3D graph preserves cameras by topology, applies configured colors, updates selection highlighting, and manages WebGL lifecycle and fallback behavior.
Frontend bundle, entrypoint, and styling
ui/src/styles.css, ui/src/styles.test.ts, src/loadpath/static/assets/index-Dc1-DXoM.js, src/loadpath/static/assets/index-DiHJRVJW.css, src/loadpath/static/index.html
Production assets and entrypoint references were rebuilt. Graph containers and nodes now use updated backgrounds, dimensions, and multiline labels.
FilterSet node inspection
ui/src/nodeInspector.ts, ui/src/nodeInspector.test.ts
Node inspection identifies FilterSets as typed input contracts with a dedicated role and purpose.

Estimated code review effort: 5 (Critical) | ~120 minutes

Merge Risk: ⚪ Minimal · up to 06ff1

The PR improves graph extraction, layout, and 3D selection behavior without any identified merge-blocking risk; it is merge-ready after normal checks and review.


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

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

cursoragent and others added 2 commits August 15, 2026 10:25
NetBox's package.json lives in netbox-graphiql, which did not match the
exact graphiql path token, so detect still treated it as the React root.

Co-authored-by: zord.lack.net <zord.lack.net@gmail.com>
Layered layout now packs occupied columns, orders nodes by barycenter so
edges line up, and clamps labels to two lines. Edge labels only appear for
the selected node. Selecting a 3D node no longer rebuilds the WebGL scene,
which was jumping the camera and flashing white on deselect.

Co-authored-by: zord.lack.net <zord.lack.net@gmail.com>
@cursor cursor Bot changed the title Fix views-package collisions, regex route labels, and FilterSet nodes Fix graph extraction, 2D layout, and 3D selection camera Aug 15, 2026
@Modsofthenation
Modsofthenation marked this pull request as ready for review August 15, 2026 10:56
cursoragent and others added 4 commits August 15, 2026 10:59
Routes and reverse-URL names were stacked in one layer, so pretix-style
widget graphs crowded four boxes into a single column. Management commands
also fell through to the OpenAPI default layer. Put those types on the
path they belong on, and insert wrap hints so long routes break at slashes.

Co-authored-by: zord.lack.net <zord.lack.net@gmail.com>
Picking another indexed repo left the previous review graph on screen with
no indication that architecture was still loading. Clear stale review data,
show the progress bar and a workspace placeholder, and wait for the new
graph plus git refs before rendering again.

Co-authored-by: zord.lack.net <zord.lack.net@gmail.com>
Clearing the previous review left the Impact graph tab empty once loading
finished. Switch that tab to the architecture graph so the newly fetched
workspace is actually visible.

Co-authored-by: zord.lack.net <zord.lack.net@gmail.com>
Adversarial review: DRF paths like nutrition/api/views.py still became
api.*, nested (?P<slug>(?:…)) leaked a ')', barycenter mixed ranks across
non-adjacent columns, and explorer picks were dropped while busy. Walk past
api/viewsets/filtersets unless they are the last remaining segment, parse
named groups with balanced parens, order only adjacent layers, and keep a
boolean workspace-loading flag with a visible error if a switch is blocked.

Co-authored-by: zord.lack.net <zord.lack.net@gmail.com>
@cursor
cursor Bot merged commit d4d1a32 into main Aug 15, 2026
2 checks passed
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