Skip to content

feat: add rectangle zoom to Beads graph - #208

Open
thinksyncs wants to merge 2 commits into
mainfrom
feat/graph-rectangle-zoom
Open

feat: add rectangle zoom to Beads graph#208
thinksyncs wants to merge 2 commits into
mainfrom
feat/graph-rectangle-zoom

Conversation

@thinksyncs

Copy link
Copy Markdown
Contributor

Summary

  • Add rectangle-select zoom to the Beads Graph view.

Changes

  • Add a graph selection rectangle overlay.
  • Store graph pan with graph zoom and render the graph with translate plus scale.
  • Zoom into a dragged rectangle and reset to fit on double click.
  • Keep wheel and trackpad zoom centered around the pointer using pan state.

Testing

  • ./node_modules/.bin/oxfmt .
  • git diff --check
  • ./node_modules/.bin/oxlint
  • ./node_modules/.bin/tsc -p ./src --noEmit
  • ./node_modules/.bin/tsc -p ./web --noEmit
  • ./node_modules/.bin/vitest run
  • node_modules/.pnpm/esbuild@0.28.1/node_modules/esbuild/bin/esbuild --bundle web/beadsMain.ts --outfile=/tmp/beads-webview-rectangle-zoom.js --minify --target=es6 --format=iife

Notes

  • bd sync is unavailable in this local bd CLI; used bd dolt push instead.

Copilot AI review requested due to automatic review settings July 8, 2026 13:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds rectangle-select zoom to the Beads dependency graph webview by introducing a selection overlay and switching zoom anchoring to be based on a persisted pan+zoom transform.

Changes:

  • Introduces graphPan state and applies zoom via translate + scale CSS transforms.
  • Adds pointer-driven rectangle selection to zoom into a selected region, plus double-click “fit to viewport”.
  • Updates webview HTML/CSS and metadata tests to include the selection overlay and new transform behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
web/beadsMain.ts Implements pan+zoom state, per-pointer zoom anchoring, rectangle selection handlers, and updated zoom application logic.
src/beadsWebview.ts Adds the selection box element to the graph DOM and updates CSS for translate+scale and selection styling.
tests/beadsWebviewMetadata.test.ts Updates metadata assertions to reflect new CSS/DOM and new helper functions/constants.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread web/beadsMain.ts Outdated
Comment on lines +899 to +901
content.style.setProperty("--graph-zoom", graphZoom.toFixed(2));
content.style.setProperty("--graph-pan-x", `${graphPan.x.toFixed(1)}px`);
content.style.setProperty("--graph-pan-y", `${graphPan.y.toFixed(1)}px`);
Comment thread web/beadsMain.ts
Comment on lines +1122 to +1124
if (graphSelection === null || graphSelection.pane !== pane) {
return;
}
Comment thread web/beadsMain.ts
Comment on lines +1138 to +1140
if (graphSelection === null || graphSelection.pane !== pane) {
return;
}
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