Skip to content

Add zoom-out color blocks for Graph and Code - #95

Open
braedonsaunders wants to merge 3 commits into
mainfrom
cursor/zoom-out-color-blocks-8502
Open

Add zoom-out color blocks for Graph and Code#95
braedonsaunders wants to merge 3 commits into
mainfrom
cursor/zoom-out-color-blocks-8502

Conversation

@braedonsaunders

@braedonsaunders braedonsaunders commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Follow-up to the deferred item in #82. On 2026-08-22 eorroe asked for CodeCanvas-style color-coded sections when zoomed out, with a name on hover. Braedon deferred that along with the mini-map and a root-file gate. Mini-map is already in open #94 (untouched here). Thickness from #93 is already on main. This PR ships the zoom-out color blocks only.

A later test of this PR on a 110-file clone of this repo confirmed the chunks work, but asked that red and green be avoided so they are not confused with diffs. Zoom-out fills now use a non-red/green palette. Normal node circles, symbol chips, and the churn legend are unchanged.

What this PR does

At low zoom, Graph and Code drop fine chrome so the map stays readable.

Thresholds (CodeCanvas-aligned):

  • k ≤ 0.4 — color blocks on
  • k < 0.22 — Code cards hide source text (existing code-far) so only the chunks remain

Graph

  • Circles and labels hide
  • Each file becomes a filled rounded rectangle tinted by the current Color mode (folder / layer / churn)
  • Zoom-out fills remap red/green (and close hues) so folder, layer, and churn chunks cannot be read as diffs
  • Blocks keep a ~16px screen floor so they do not shrink back into noise
  • Hover still uses the existing node tooltip (name, functions, layer, churn)
  • Selection / blast-radius highlight applies to the rectangles too

Code

  • Open cards overlay colored chunks for functions, imports, exports, and leftover file regions
  • Chunk fills stay off the red/green diff palette: fn blue, import purple, export teal, leftover amber
  • Hover on a chunk shows the section name (tooltip + title)
  • In the 0.4–0.22 band the chunks sit over still-visible source; past 0.22 the text hides
  • Leftover Graph nodes on the same canvas use the same rectangle switch and remapped fills

3D Graph, Treemap, Matrix, Tree, Flow, Cluster, Bundle, and Block Diagram are unchanged.

Out of scope

Not in this PR, as requested:

How to verify

  1. Open index.html locally, or run npx codeflow tests/fixtures/golden-world.
  2. Analyze a small tree (tests/fixtures/golden-world is enough).
  3. On Graph, zoom out with the toolbar button or the wheel until scale is 0.4 or below (about two clicks from 1.0). Circles and labels should become folder-tinted rectangles that stay large enough to read as tiles. No chunk should look red or green. Hover a rectangle for the file name. Zoom back in and the usual chrome returns.
  4. Switch to Code. Zoom out past 0.4: cards keep their titles and show colored section chunks (blue / purple / teal / amber — not red or green). Hover a chunk for the function / import name. Keep going past 0.22: source text hides and only the chunks remain.
  5. Confirm 3D / Treemap / other views are unchanged, and that Add a bottom-right canvas mini-map for Graph and Code #94’s mini-map is not in this diff.

Tests

  • Local npm test: 178 pass / 0 fail
  • Threshold helpers, section layout, screen-scale floor, and code-blocks / code-far class toggling
  • Palette test: Code kind fills and remapped Graph/churn fills are not red or green
  • Existing Code canvas / thickness assertions still pass

Please review when ready. No Codex review ping.

Open in Web Open in Cursor 

When zoom drops below 0.4, Graph nodes swap circle/label chrome for
folder-tinted rectangles, and Code cards overlay function/import
sections. Past 0.22 the card source hides so only the chunks remain.
Hover still names the section. Mini-map and the root-file gate stay out
of this change.

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

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
codeflow Ready Ready Preview Aug 30, 2026 12:24pm

Request Review

Graph rectangles were the same world size as the circles they replace,
so at k<=0.4 they shrank into noise. Counter-scale them to a 16px
floor, turn blocks on at 0.4 inclusive, and give the tiles a stroke.

Co-authored-by: Braedon Saunders <braedonsaunders@users.noreply.github.com>
@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.

eorroe tested #95 on a 110-file clone and asked that chunks not look
like diffs. Code export/file fills move to teal/amber, and Graph
folder/layer/churn tiles remap red and green to blue/cyan/purple/orange.
Hover names and the 0.4 / 0.22 zoom switch are unchanged.

Co-authored-by: Braedon Saunders <braedonsaunders@users.noreply.github.com>
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