Skip to content

fix: add sticky notes where the canvas is visible - #22

Merged
maxgfr merged 1 commit into
mainfrom
issue-21-note-visible-center
Oct 17, 2026
Merged

maxgfr merged 1 commit into
mainfrom
issue-21-note-visible-center

Conversation

@maxgfr

@maxgfr maxgfr commented Oct 17, 2026

Copy link
Copy Markdown
Owner

Closes #21

handleAddAnnotation placed 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.

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
@maxgfr
maxgfr merged commit f5137be into main Oct 17, 2026
1 check passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.1.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@maxgfr
maxgfr deleted the issue-21-note-visible-center branch October 17, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New sticky notes land off-screen on phones and panned views

1 participant