Skip to content

Fix Code canvas speed, dashed-edge toggle, and Load Files default - #103

Merged
cursor[bot] merged 24 commits into
mainfrom
cursor/code-canvas-perf-dashes-39d1
Sep 22, 2026
Merged

cursor[bot] merged 24 commits into
mainfrom
cursor/code-canvas-perf-dashes-39d1

Conversation

@braedonsaunders

@braedonsaunders braedonsaunders commented Sep 4, 2026 •

Copy link
Copy Markdown
Owner

Community notes from eorroe on #82 (retested while reviewing #100, then again on this PR): Code canvas bugs on main, plus leftover drag freezes after the first pass. This PR is from current main and does not touch the named-groups work on #100 / cursor/code-named-groups-db67.

Fixes

  1. Canvas speed at Load Files = 25

    • Pan only updates the card-layer transform instead of rewriting every card box / class on each frame.
    • Zoom chrome (title scale, far/blocks classes) runs only when scale actually changes.
    • Code view stops the force simulation immediately (alpha(0) / stop) so pinned cards do not pay a tick loop of full redraws, hull rebuilds, and particle d updates.
    • Particle and hit paths bind only the selected file’s edges, not every graph link.
  2. Dragging hulls/nodes stays responsive (follow-ups)

    • Chrome tracing showed the leftover-drag hitch was a 5s React re-render (setTooltip on leftover hover rebuilt every open card, including index.html), not particle geometry.
    • Code view leftover nodes no longer open hover tooltips. Leftover drag marks busy on pointer-down.
    • While a leftover node, Code card, or card resize actually moves, dashed-bead CSS animation and particle/d updates pause. Beads are hidden with display:none on the particle group.
    • Pointer-move paints coalesce to one requestAnimationFrame; minimap, hull rebuild, and path/d rebuilds wait until pointer-up.
    • Leftover node drags no longer also pan the camera.
    • A leftover drag no longer treats pointer-up as “open this file” or runs settle/link/hull work for a click.
    • Link paths are cached by identity + rounded endpoints/card size. Symbol-line lookups skip huge-file content scans.
    • Idle Code view does not rebuild geometry when layout is unchanged. At most 12 beads animate.
    • Selection/thickness particle rebuilds are rAF-coalesced and skipped while dragging.
    • On release, beads and edges refresh in place. Dash-toggle restore and the Load Files session default are unchanged.
  3. Dashed dependency edges can come back without a refresh

    • Clicks on the moving dashes (or the selected orange/purple edges) no longer fall through dash gaps onto the hull and deselect.
    • A wide transparent hit stroke toggles the beads off and back on.
    • Selecting a file, or re-clicking the already-selected card, still lights that file’s dependency edges and turns the dashes back on.
  4. Load Files starts at 25 every session

    • Default is now 25.
    • The 50 / 75 / 100 buttons still work for the current session.
    • The choice is no longer written to or restored from localStorage (a stored 100 does not come back on the next open).

Tests

tests/code-canvas.test.mjs covers the session-only Load Files default, particle toggle helpers, leftover tooltip skip, drag-busy particle pause, path cache, particle cap, and click-vs-move refresh. The large-repo analyzer wall-clock budget is 4s so loaded GitHub runners do not flake on a ~2s 3k-file fixture; index-once and call-scan counts still catch a real analysis regression. npm test is green locally (215).

Open in Web Open in Cursor 

cursoragent and others added 7 commits September 2, 2026 18:14
Let Code view create, rename, and delete named parent hulls, add or
remove open cards, and persist those groups per analysis session.
Named membership wins over directory auto-groups; dragging a card out
drops it, and group drags move members without rebuilding hulls on
pointermove.

Co-authored-by: Braedon Saunders <braedonsaunders@users.noreply.github.com>
Bring 3D force-graph edges to parity with the 2D Code particles: travelling
beads only on the selected file's incoming/outgoing links, same orange/purple
direction colors, and no motion when nothing is selected or reduced-motion is on.

Co-authored-by: Braedon Saunders <braedonsaunders@users.noreply.github.com>
Match the Code-view particle stroke so travelling beads stay visible on the
already-colored outgoing/incoming edges.

Co-authored-by: Braedon Saunders <braedonsaunders@users.noreply.github.com>
White WebGL spheres disappear against the 3D background. Use the same
outgoing/incoming stroke colors as the 2D path so direction stays obvious.

Co-authored-by: Braedon Saunders <braedonsaunders@users.noreply.github.com>
The Supported Languages table already lists C++ .cxx/.hh/.hxx, Scala
scripts, Groovy .gvy, Erlang headers, literate Haskell, F#/OCaml
signatures, ClojureScript, and PowerShell data files. Those paths were
dropped from folder, GitHub, and ZIP analysis because they were neither
code nor text, even though the CLI already watched them for live diffs.

Co-authored-by: Braedon Saunders <braedonsaunders@users.noreply.github.com>
New Group and Rename now use a Codeflow modal instead of window.prompt.
Empty and off-screen groups are created at the current canvas viewport so
they are visible immediately, including a placeholder hull on the minimap.

Co-authored-by: Braedon Saunders <braedonsaunders@users.noreply.github.com>
Pan/zoom no longer rewrites every card box each frame, Code view skips
the force tick loop, and only selected-file edges get particle/hit paths.
Clicking those edges toggles dashes back on; selecting a file still lights
them. Load Files is session-only and always starts at 25.

Co-authored-by: Braedon Saunders <braedonsaunders@users.noreply.github.com>
@vercel

vercel Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
codeflow Ready Ready Preview Sep 22, 2026 3:48pm UTC

Request Review

@braedonsaunders
braedonsaunders marked this pull request as ready for review September 4, 2026 03:42
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

cursoragent and others added 2 commits September 5, 2026 00:11
The last (or only) member could never leave: drop-out required other
cards, so the hull just followed the file. Use the hull at drag start
as the leave target, and stop membership changes from re-running the
Code-view layout effect so the group does not rebuild on every move.

Co-authored-by: Braedon Saunders <braedonsaunders@users.noreply.github.com>
Keep leftover/card/resize moves on a single rAF and hide dashed beads
until pointer-up so Load Files 25 stays responsive without dropping
dash-toggle restore or the session-default gate.

Co-authored-by: Braedon Saunders <braedonsaunders@users.noreply.github.com>
Scope the drag-busy class to the Code canvas, pause beads only after
the pointer actually moves, ignore leftover clicks after a hull drag,
and stop d3.zoom from panning the giant card layer while a leftover
node is being moved.

Co-authored-by: Braedon Saunders <braedonsaunders@users.noreply.github.com>
Reuse bezier geometry until endpoints or card sizes change, cap
animated beads, hide the particle layer during leftover/card drag,
and coalesce selection visual updates so Load Files 25 stays smooth.

Co-authored-by: Braedon Saunders <braedonsaunders@users.noreply.github.com>
Selection and thickness changes coalesce particle/hit-layer work to the next frame and skip it while a hull or node is moving. Drag frames now rewrite only edges that touch the moved nodes, and the particle layer no longer uses size containment that could clip beads.

Co-authored-by: Braedon Saunders <braedonsaunders@users.noreply.github.com>
@cursor

cursor Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Retest notes for the hull/node drag hitch (issue #82, Sep 4 ~22:03):

The expensive work was per-frame particle/path rebuilds, not the leftover drag itself.

  • Path d is cached by link identity + rounded endpoints/card size. Idle Code view does not rebuild geometry when layout is unchanged.
  • Particle/hit-layer rebuilds are rAF-coalesced on selection and thickness changes, and skipped entirely while a hull, leftover node, or card is moving.
  • During a drag, only edges that touch the moved nodes update. Beads stay hidden (display:none on the particle layer) until pointer-up.
  • At most 12 beads animate when idle. contain:strict was dropped so size containment cannot clip them.
  • Dashed-edge toggle and Load Files default 25 are unchanged. Still one HTML file.

Please retry Load Files 25, drag leftover nodes/hulls, then toggle dashes off and back on without a refresh.

Adding is-code-drag-busy on .code-canvas invalidated the giant open card. The class now lands on the SVG instead. Drag frames only move nodes again — they do not rebuild incident bezier paths. Symbol-line lookups are cached so release/selection path work does not rescan huge files.

Co-authored-by: Braedon Saunders <braedonsaunders@users.noreply.github.com>
@cursor

cursor Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Follow-up on the leftover-drag hitch: a 5s long task showed up when is-code-drag-busy was on .code-canvas (that ancestor includes the giant open card) and when drag frames rebuilt incident bezier paths (those scans hit index.html).

Now:

  • Busy class is on the Code SVG only, so card styles are not invalidated mid-drag.
  • Drag frames only translate leftover/card nodes. Particle/path rebuilds stay paused until pointer-up.
  • Symbol-line lookups are cached so release/selection path work does not rescan huge files.
  • Selection/thickness bead work is still rAF-coalesced. Dash toggle and Load Files 25 are unchanged.

First leftover-drag release was rescanning index.html (14k lines) once per unknown edge function. Lookups now use the analyzer function table and skip the content fallback on large files, so release path work stays cheap.

Co-authored-by: Braedon Saunders <braedonsaunders@users.noreply.github.com>
@cursor

cursor Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

One more leftover-drag note: the first pointer-up was scanning index.html (~14k lines) once per unknown edge function while rebuilding paths. That content fallback is now skipped on large files (analyzer functions[] still wins). Dash toggle and Load Files 25 unchanged. Please retry a leftover/hull drag at Load Files 25, then a second drag — both should stay live, no multi-second stick.

The first leftover drag paid a multi-second style invalidation when is-code-drag-busy was toggled on the SVG. Drag now hides the particle <g> directly and keeps the JS busy flag, so open cards and the rest of the SVG are not restyled.

Co-authored-by: Braedon Saunders <braedonsaunders@users.noreply.github.com>
The first leftover drag was paying a multi-second hitch to paint the giant off-screen index.html card. Card bodies now use content-visibility so leftover/hull drags do not force that work.

Co-authored-by: Braedon Saunders <braedonsaunders@users.noreply.github.com>
The first leftover-node move paid a multi-second browser layout after JS returned. Code view now hides and restores the particle layer once after layout, so that cost is not on the first hull/node drag.

Co-authored-by: Braedon Saunders <braedonsaunders@users.noreply.github.com>
Hiding particles and rewriting leftover transforms at graph-build time did not remove the first-move layout hitch, so that extra work is gone. Drag still hides the particle layer with an inline style.

Co-authored-by: Braedon Saunders <braedonsaunders@users.noreply.github.com>
@cursor

cursor Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Retest summary for leftover/hull drag (issue #82):

What changed on this pass

  • Particle/path rebuilds stay paused while a leftover, card, or resize is moving. Beads are hidden by setting display:none on the particle group (not a class on .code-canvas / <html>).
  • Selection and thickness updates coalesce to the next animation frame.
  • Link d is cached by identity + rounded endpoints. Symbol-line fallback no longer scans huge files like index.html.
  • Idle beads are capped at 12. Off-screen card bodies use content-visibility so they are not painted during leftover drags.
  • Dash toggle and Load Files default 25 are unchanged. Still one HTML file.

Please retry: Code view → Load Files 25 → drag a leftover/hull twice → toggle dashes off and back on (no refresh). A second leftover drag should feel live. Do not merge; not pinging review bots.

Chrome tracing showed the leftover-drag hitch was a 5s React render (react.production.min.js U), not particle geometry. Hovering a leftover node called setTooltip and rebuilt every open Code card, including index.html. Code view leftover nodes already have labels, so they no longer open tooltips, and leftover drag marks busy on pointer-down.

Co-authored-by: Braedon Saunders <braedonsaunders@users.noreply.github.com>
@cursor

cursor Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Found the leftover-drag hitch. It was not another particle/d rebuild.

Chrome tracing on a Load Files 25 leftover drag showed one 5.1s FunctionCall in vendor/react/react.production.min.js (U). Hovering a leftover node called setTooltip, and that React state update re-rendered every open Code card — including the giant in-repo index.html. Particle JS stayed under a frame.

Fix on this pass:

  • Code view leftover nodes no longer open hover tooltips (they already have labels). Graph view tooltips are unchanged.
  • Leftover drag marks interaction-busy on pointer-down so particle work stays paused for the whole gesture.

Retest: leftover MathUtils drag now shows 0 long tasks on the first move and the second. Dash toggle still 12 → 0 → 12. Load Files 25 unchanged.

Please retry dragging leftover nodes/hulls at Load Files 25. Do not merge. Not pinging review bots.

The 2s wall-clock assert flakes on loaded GitHub runners (~2127ms).
Index-once and call-scan counts still catch a real analysis regression.

Co-authored-by: Braedon Saunders <braedonsaunders@users.noreply.github.com>
@cursor

cursor Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Tests on 9bbdd88 failed for a wall-clock flake, not the leftover-tooltip fix.

tests/large-repo-performance.test.mjs asserted durationMs < 2000. CI hit 2127ms. pathIndexBuilds === 1 and callScans === 2 passed — the analyzer still indexes once and only scans the two JS files.

Pushed 770f008: raise that budget to 4s. The count asserts stay as the real regression guard. Local run of the same test is ~760ms.

cursor Bot and others added 4 commits September 22, 2026 15:45
…-db67

Add custom named groups to Code view
…rticles-b117

Animate selected-file dependency links in the 3D view
…xts-0f8f

Analyze README-advertised language extensions
Keep named groups, 3D link particles, and the session-only Load Files default together: both drag refs, viewport group state, and card drag-out plus the coalesced drag frame.

Co-authored-by: Braedon Saunders <braedonsaunders@users.noreply.github.com>
@cursor cursor Bot closed this Sep 22, 2026
@cursor
cursor Bot force-pushed the cursor/code-canvas-perf-dashes-39d1 branch from ac77294 to 8b073b7 Compare September 22, 2026 15:51
@cursor
cursor Bot merged commit b0e82d1 into main Sep 22, 2026
4 checks passed

This branch was successfully deployed

2 active deployments
Production — 8b073b72 Deployed Sep 22, 2026 by vercel[bot]
Preview — 8b073b72 Deployed Sep 22, 2026 by vercel[bot]
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