Skip to content

Canvas re-layout Stage 0: uncertain links off trunks, reveal clear of the phase index, walk back to 90% - #19

Closed
realmyang wants to merge 1 commit into
mainfrom
relayout-stage0
Closed

realmyang wants to merge 1 commit into
mainfrom
relayout-stage0

Conversation

@realmyang

Copy link
Copy Markdown
Owner

Canvas re-layout, Stage 0

The first stage of the canvas re-layout. It improves today's phase-lanes diagram and the review walk, and adds a tool that measures the layout. Lanes stay the only layout. No contract change, no new setting or keybinding, version unchanged.

What changes

  • Dashed and dotted connections are no longer hidden (0a). An inferred or unresolved connection no longer joins a trunk. Each one that skips a phase takes its own channel track, 8 px apart, and the new webview/src/layout/separate.ts slides its other runs off the lines they shared (never into a card or a header, or along a border). Those with half or more of their line hidden go from 49 of 56 to none on the repository's documents and from 22 of 61 to none on the 17 public development documents. A diagram with no such connection draws as before.
  • Reveal in Diagram and the walk keep cards clear of the phase index (0b). Focusing no longer scrolls the diagram, a bottom sheet that lands a frame late no longer leaves a card under the index, and a connection whose two cards fit at 45% is framed so both clear it.
  • The walk returns to 90% after a finding (0c). A zoom the reader chose is kept.
  • webview/tools/layout-metrics.mjs (0d). A development tool with an informational baseline. It gates nothing and is not in the VSIX.

The geometry golden

Re-recorded once, on purpose, for 0a. The reason is in the header of webview/test/geometry-golden.test.mjs.

Costs and known leftovers

  • About 10% more line crossings, mostly on the dashed lines (vit-cc 119 to 140), and a few more labels crossed by an unrelated line.
  • Observed connections re-splay by a few pixels where an uncertain one left their gutter or channel slot.
  • Where a gutter is full, a dashed run can still lie on another line: 26 of 133 connections over the repository's, development and three local shakedown documents (99 before); 18 of the 26 are on the synthetic stress fixture.
  • On one shakedown document two opposite labels now sit 3 px apart.
  • The channel tracks for these connections are not capped: 144 px wider on the stress fixture, 23 px at most on the development documents.
  • A relayout is slower on large synthetic documents: about 420 to 1,000-1,300 ms at 1,000 steps in jsdom, 1-13 ms more on real documents. A follow-up will speed the separation pass up without changing any route.
  • A connection too far apart to fit at 45% still centres on its source card. Far-connection framing is a later stage.

Checks

  • Local: sh scripts/e2e.sh --skip-npm-install printed E2E OK: 15 exercised gates (webview 426 tests, extension 376, pytest 919 passed) on Node 26.4 and Python 3.13.
  • The new tests were mutation-checked during development; the reveal fixes were also measured in headless Chrome with a simulated host.
  • Not checked: live VS Code, a screen reader, usability. The numbers are geometric measures of boxes and lines, not readability.

🤖 Generated with Claude Code

… the phase index, walk back to 90%

The phase-lanes diagram stays the only layout. No contract change, no new
setting or keybinding, version unchanged.

0a. An inferred or unresolved connection no longer joins a trunk
(routing.ts, bundles.ts). Each one that skips a phase takes a channel track
of its own, 8 px apart (channel.ts, layout.ts), and the new
layout/separate.ts slides its other runs off the strokes they shared, never
into a card or a header or along a border. With the new tool, those with
half or more of their line hidden go from 49 of 56 to none on the
repository's documents and from 22 of 61 to none on the 17 public
development documents. Where a gutter is full a run can still lie on another
line: 26 of 133 over those sets and three local shakedown documents, 99
before. The geometry golden is re-recorded once, on purpose; the reason is
in the test header. A diagram with no such connection draws as before.
Costs: about 10% more crossings, a few more labels crossed, observed routes
re-splay by a few pixels where an uncertain one left their slot, the channel
tracks are not capped (144 px on the stress fixture, 23 px at most on the
development documents), and a relayout is slower on large synthetic
documents (about 420 to 1,000-1,300 ms at 1,000 steps in jsdom; 1-13 ms on
real documents).

0b. Reveal in Diagram and the walk keep their cards on the diagram and clear
of the phase index (render/canvas.ts, canvasview.ts, app/keys.ts,
render/flowbinding.ts): focusing no longer scrolls the diagram, a sheet that
lands a frame late no longer leaves a card or a connection's end under the
index, a connection whose two cards fit at 45% is framed so both clear it,
and a resize judges "was in view" with the index where it was.

0c. After a finding left the zoom between 62% and 75%, the walk's next claim
returns to 90%, or as far as it fits (canvasview.ts, app.ts). A zoom the
reader chose is kept.

0d. webview/tools/layout-metrics.mjs measures a layout (crossings, card
hits, hidden and overlaid uncertain lines, labels, first view, walk travel)
with an informational baseline. It gates nothing and is not in the VSIX.

Tests: exception-tracks, phase-index-clear, layout-metrics, walk.
Local: sh scripts/e2e.sh --skip-npm-install, E2E OK, 15 exercised gates
(webview 426, extension 376, pytest 919). Not checked in live VS Code or
with a screen reader; the measures are geometric proxies, not readability.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@realmyang realmyang closed this Oct 30, 2026
@realmyang
realmyang deleted the relayout-stage0 branch October 30, 2026 18:42
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.

1 participant