feat: add live mouse coordinate display to shape builder canvas#107
feat: add live mouse coordinate display to shape builder canvas#107jeetburman wants to merge 8 commits intomeshery-extensions:masterfrom
Conversation
- Add real-time coordinate tracking on mouse movement - Display normalized coordinates (-1 to 1 range) matching polygon output - Show pixel coordinates for reference - Coordinate display only visible when mouse hovers over canvas - Theme-aware styling adapts to light/dark modes - Non-intrusive positioning in top-right corner - Smooth show/hide transitions on mouse enter/leave Fixes meshery-extensions#95
|
I request a review @leecalcote , @kishore08-07 |
|
@jeetburman |
I have added my agenda in the meeting minutes. I will present what I have worked on. |
- Coordinate display now follows mouse cursor instead of fixed position - Removed pixel coordinates, showing only normalized X,Y values - Changed from fixed top-right position to cursor-relative positioning - Uses SVG-relative coordinates (x,y) instead of screen coordinates - Maintains smooth 15px offset to prevent blocking cursor - Simplified to single-line format: 'X: 0.234, Y: -0.567' Based on team feedback from code review
Update: Coordinate Display Now Follows CursorThanks for the feedback during the meeting... Changes MadeBefore:
After:
Testing Done
Notes for Reviewer
DemoNewPR.mp4 |
|
I request a review @Rajesh-Nagarajan-11 @kishore08-07 |
|
Yeah, it’s looking good, but the coordinates still aren’t following the cursor properly. I think removing the transition might fix it. // @jeetburman |
Will do during today's meeting, testing it live. |
…jeetburman/shape-builder into feat/add-live-mouse-coordinates
|
Hey @Rajesh-Nagarajan-11 , I have removed the delay. After.mp4It is good to merge. |
|
Did you incorporate disable option for coordinates |
No, I havent. |
- Added showCoordinates state (default: true) - Added toggle button in toolbar with contained variant - Button label updates dynamically between Hide/Show Coordinates - Coordinates only display when both hovering and toggle enabled - Preserves all existing functionality
|
This is how it looks... Nothing breaks... Pls review @Rajesh-Nagarajan-11 button.mp4 |
|
@jeetburman Thank you for your contribution! Let's discuss this during the website call tomorrow at 6:30 PM IST | 7 AM CST Add it as an agenda item to the meeting minutes, if you would 🙂 |
Description
This PR adds a live mouse coordinate display to the shape builder canvas that shows real-time X/Y coordinates as users move their mouse over the grid. This enhancement improves the user experience by providing precise position feedback during shape creation.
Related Issue
Fixes #95
Changes Made
New Component:
CoordinateDisplayCoordinate Normalization:
centerX = rect.width / 2,centerY = rect.height / 2(x - centerX) / centerXfor -1 to 1 rangeCurrent Behavior vs New Behavior
Before:
Before.mp4
After:
After.mp4
Testing Performed
Isnt breaking any existing functionality as per my knowledge. Pls let me know if something breaks.
Files Modified
site/src/components/ShapeBuilder/index.js- Added coordinate tracking logic and display componentsite/src/components/ShapeBuilder/shapeBuilder.styles.js- AddedCoordinateDisplaystyled componentNotes for Reviewers
Signed commits
Checklist: