Skip to content

fix(canvas): keep the drawing open when the screen rotates - #1317

Open
joepio wants to merge 2 commits into
developfrom
cursor/canvas-rotation-keeps-open-76c8
Open

fix(canvas): keep the drawing open when the screen rotates#1317
joepio wants to merge 2 commits into
developfrom
cursor/canvas-rotation-keeps-open-76c8

Conversation

@joepio

@joepio joepio commented Aug 31, 2026

Copy link
Copy Markdown
Member

Rotating a tablet (or phone) while drawing dumped Atomic Canvas back on the gallery.

Android re-registers the predictive-back callback when window metrics change, and PopScope(canPop: false) treated that as a real back press. The canvas also was not a route, so an activity recreate (some OEMs still do this on rotation) lost _openCanvas and showed the gallery.

  • Ignore pops for a short window after a metrics / size change (CanvasPopScope + RotationPopGuard).
  • Remember the open canvas subject in AtomicSession and restore it after login / store load.
  • Allow any orientation in the web PWA manifest; add colorMode to Android configChanges.

Tests cover the guard, the PopScope widget (rotation vs a later back press), and session persist / clear. flutter analyze lib test is clean; flutter test is green (70 tests).

Open in Web Open in Cursor 

cursoragent and others added 2 commits August 31, 2026 16:14
Android was treating a rotation as a back press (PopScope fires when
window metrics change), which dumped the user back on the gallery.
Ignore pops in that window, remember the open canvas across an activity
recreate, and allow landscape in the web manifest.

Co-authored-by: joepmeindertsma <joepmeindertsma@gmail.com>
…d test

_openFromGallery is async; restore after rotation has to wait for strokes
to load. The session test file had been written twice.

Co-authored-by: joepmeindertsma <joepmeindertsma@gmail.com>
@joepio
joepio marked this pull request as ready for review August 31, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants