Repository navigation
fix: add sticky notes where the canvas is visible - #22
Merged
Merged
Conversation
A new note went to a fixed diagram position (x and y between 100 and 300) whatever the view, so on a phone, or once the canvas was panned or zoomed, it landed off-screen and "Add note" looked like it did nothing. It now goes to the center of the visible pane, read from the canvas transform. This also removes the flakiness of the mobile e2e that edits a note. Refs #21
|
🎉 This PR is included in version 2.1.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #21
handleAddAnnotationplaced each note at a fixed diagram position (100–300, 100–300). On a phone (the canvas is ~200 px wide next to the sidebar) or after panning/zooming, the note was off-screen: "Add note" looked like it did nothing, and the mobile e2e that double-clicks the note failed about 2 runs in 3 ("element is outside of the viewport"), including on #18's CI.New notes go to the center of the visible pane, computed from the canvas transform (
.react-flow__viewport), with a little jitter so several notes do not stack exactly.Checks: lint, typecheck, app 127 tests, Playwright 84/84 on 4 projects; the mobile note test passed 12/12 in a row (it failed 2/3 before); a diagnostic run placed the note inside the visible pane 8/8 times.