-
Notifications
You must be signed in to change notification settings - Fork 110
H-5763: Add simple MiniMap #8286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
H-5763: Add simple MiniMap #8286
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
26d0314 to
7cb91bd
Compare
7cb91bd to
5636d00
Compare
5636d00 to
5e51486
Compare
PR SummaryLow Risk Overview Introduces a custom MiniMap wrapper that offsets horizontally when the properties panel is open and custom-renders nodes (places as circles with type-based HSL coloring and strokes; transitions as grey rectangles) plus light mask/rounded styling. Written by Cursor Bugbot for commit 3ba9d4b. This will update automatically on new commits. Configure here. |
🤖 Augment PR SummarySummary: Adds a ReactFlow MiniMap overlay to the SDCPN editor to help navigate large Petri nets. Changes:
Technical Notes: Uses ReactFlow 🤖 Was this summary useful? React with 👍 or 👎 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| return ( | ||
| <ReactFlowMiniMap | ||
| {...props} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * Renders place nodes as circles and transition nodes as rectangles. | ||
| * Positions at top-right, offset by properties panel width when visible. | ||
| */ | ||
| export const MiniMap: React.FC<Omit<MiniMapProps, "style">> = (props) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type signature allows props that are silently ignored
Low Severity
The component type Omit<MiniMapProps, "style"> suggests all MiniMapProps except style can be customized, but props like className, maskColor, maskStrokeWidth, nodeComponent, and offsetScale are hardcoded after the spread and will be silently overwritten. This creates a misleading API where callers could pass these props expecting them to work, but they'll be ignored. The type should exclude all fixed props to accurately reflect the component's actual API.
Merge activity
|
1f85b90 to
b7a126d
Compare
becfd05 to
b584cca
Compare
b584cca to
a70a878
Compare
- Add VisibleViewport type representing panel insets (top, right, bottom, left) - Add computeVisibleViewport() helper that calculates insets based on panel state - Expose visibleViewport in EditorContext, computed reactively in EditorProvider - Add ReactFlow MiniMap positioned at top-right of visible viewport Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Create dedicated MiniMap wrapper component - Render place nodes as circles (transitions as rectangles) - Add rounded corners (6px) to minimap SVG - Set fixed size (100x64px) with reduced padding - Position relative to visible viewport for panel awareness Co-Authored-By: Claude Opus 4.5 <[email protected]>
Simplify MiniMap to use default ReactFlow positioning for now. Viewport-aware positioning will be added in a follow-up PR. Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Place MiniMap at top of canvas instead of bottom - Offset from right edge by properties panel width when visible Co-Authored-By: Claude Opus 4.5 <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
a70a878 to
3ba9d4b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| const isPropertiesPanelVisible = selectedResourceId !== null; | ||
| const rightOffset = isPropertiesPanelVisible | ||
| ? propertiesPanelWidth + PANEL_MARGIN * 2 | ||
| : PANEL_MARGIN; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MiniMap offset ignores non-resource panel visibility
Low Severity
MiniMap decides whether the properties panel is visible using only selectedResourceId !== null. If the properties panel can be shown for selections that don’t set selectedResourceId (e.g., edge selection, pinned-open panel, or other UI flows), rightOffset stays small and the MiniMap can overlap the panel.

🌟 What is the purpose of this PR?
This PR adds a MiniMap component to the SDCPN ReactFlow canvas using ReactFlow's built-in MiniMap. The MiniMap provides an overview of the entire Petri net, helping users navigate large nets.
Note: ReactFlow's MiniMap viewport indicator is not currently configurable to account for panel overlays. This PR focuses on adding the basic MiniMap functionality. A follow-up PR will add viewport awareness to bring selected objects back into view on selection.
🔗 Related links
🚫 Blocked by
None
🔍 What does this change?
MiniMapwrapper component using ReactFlow's built-in MiniMapPre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
📜 Does this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
🐾 Next steps
🛡 What tests cover this?
❓ How to test this?
📹 Demo
To be added