fix: draw mode can now be exited without drawing#120
Merged
boennemann merged 1 commit intomainfrom Mar 25, 2026
Merged
Conversation
Root cause: entering draw mode called toggleToolbar() to close the radial menu, but toggleToolbar() internally calls setMode(null) — immediately resetting activeMode to null before the async setupGlobalDrawCanvas() could run. The draw canvas existed in the DOM but the store thought we weren't in draw mode, so all teardown paths were no-ops. Fixes: - Close radial toolbar via direct dispatch instead of toggleToolbar() - Replace deps().setMode(null) indirection in onDone(false) with inline cleanup matching the proven save path pattern - Inline draw teardown in setMode() for mode-switch reliability - Wrap cleanup() calls in try/catch for resilience Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
toggleToolbar()which internally callssetMode(null), resettingactiveModebefore the asyncsetupGlobalDrawCanvas()runs. All teardown paths became no-ops.toggleToolbar()deps().setMode(null)indirection in discard path with inline cleanup (same pattern the save path uses successfully)setMode()for reliable mode switchingTest plan
🤖 Generated with Claude Code