Skip to content

Conversation

@meestahp
Copy link
Contributor

[Graph-] Added toggles to disable zoom & refocus movement on note selection
[Graph-] Added neighbour depth slider & refocus speed slider

Disable refocus and disable zoom, temporarily disable automatic refocusing and zooming when changing to a different node/note.
Refocus speed speeds up or slows down the speed with which the graph refocusing animation moves to a new node.
Neighbor Depth: controls the number of neighbours highlighted around the selected node
selectionNeighbourDepthB

…ection

[Graph-] Added neighbour depth slider & refocus speed slider
Copy link
Collaborator

@riccardoferretti riccardoferretti left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! I left a few comments, let me know your thoughts

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the graph visualization panel with new selection controls that give users fine-grained control over graph interaction behavior. It introduces UI sliders for neighbor highlighting depth and refocus animation speed, along with toggles to disable automatic zoom and refocus when selecting nodes.

Key Changes:

  • Added "Selection" folder to dat.GUI with four new controls: Neighbor Depth slider (1-5), Refocus Speed slider (0-3000ms), Disable Refocus toggle, and Disable Zoom toggle
  • Refactored focus nodes/links computation to use configurable neighbor depth instead of hardcoded single-level neighbors
  • Fixed null reference error in dataviz.ts by adding panel existence check before posting configuration update messages

Reviewed changes

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

File Description
packages/foam-vscode/static/dataviz/graph.js Added Selection panel GUI controls, implemented getNeighbors() function for configurable depth traversal, refactored focus computation to use neighbor depth, and conditionally apply refocus/zoom based on user settings
packages/foam-vscode/static/dataviz/graph.css Removed custom width constraints on dat.GUI controls to accommodate new slider controls
packages/foam-vscode/src/features/panels/dataviz.ts Added null check to prevent errors when configuration changes before panel creation

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

@meestahp meestahp force-pushed the graph/selectionPanel branch from d3bb75d to 4b9159a Compare November 27, 2025 20:19
@riccardoferretti
Copy link
Collaborator

Sorry I should have clarified from the beginning that I don't expect copilot's comments to be always followed through with.
I left a couple of comments, but the PR is fine the way it is by me. Will merge it later today whether you get to the comments or not.

@meestahp
Copy link
Contributor Author

Sorry I should have clarified from the beginning that I don't expect copilot's comments to be always followed through with. I left a couple of comments, but the PR is fine the way it is by me. Will merge it later today whether you get to the comments or not.

Ok, good to know. Some good points were made by the AI though, will keep it's suggestions in mind next time.

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