-
Notifications
You must be signed in to change notification settings - Fork 28
feat: add live mouse coordinate display to shape builder canvas #107
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
base: master
Are you sure you want to change the base?
feat: add live mouse coordinate display to shape builder canvas #107
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 |
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.
check with remove the transistion or reduce the seconds and distance to make it more live
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 |
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: