Repository navigation
Guard concurrent 2D edits and add undo/redo shortcuts - #177
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e1be932980
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| adjustments={adjustments} | ||
| onCropSelectionChange={setHasValidCropSelection} | ||
| touchUpTool={touchUpTool} | ||
| touchUpTool={processingActive ? null : touchUpTool} |
There was a problem hiding this comment.
Preserve pending text edits when starting processing
If quantize or dedither starts while a text touch-up draft is open, this sets touchUpTool to null, causing CanvasPreview to rasterize the draft into its live canvas. The touch-up callback then rejects the commit because processing is active, but the commit queue does not roll back pixels when the callback returns no URL. If processing fails or produces no output, the image source stays unchanged while the draft remains visible without a history entry, so it cannot be undone. Keep the draft intact or discard it without mutating the canvas when processing starts.
AGENTS.md reference: AGENTS.md:L48-L49
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 1b203fb: refused touch-up commits now roll back, and unsaved or in-progress strokes are dropped before quantize or dedither reads the canvas (regression tests in tests/e2e/image-edit-guards.spec.ts).
9a47af0 to
ac7aaf9
Compare
A brush, eraser or text edit still encoding when quantize or dedither started was refused by the history owner, but the commit queue only rolled back on encode failure, so the pixels stayed on the canvas with no undo step. Roll back on any refused commit, and when the tool is paused for processing drop unsaved and in-progress strokes before processing reads the canvas. Undo/redo shortcuts now also stay out of open popovers, menus and select lists, follow the physical Z key on non-Latin layouts, and use the same edit lock as the toolbar buttons. Split the changelog entry into Added and Fixed, and tighten the late-resize regression. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Clicking Quantize or Dedither after changing an adjustment with the keyboard blurred the slider, which deferred its commit to the next frame; processing took the edit lock first and the commit was refused, leaving the slider out of sync with the preview. Commit on blur immediately instead. The brush rollback tests now check the pixels processing actually read, and the late-resize test re-arms its hold in the same browser call that releases the stale encode. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A slider drag defers its commit by a frame after pointerup. If focus moved to Quantize or Dedither and processing started inside that frame, the deferred commit was refused. Blur now also flushes a pending frame. Co-Authored-By: Claude Opus 5.5 <[email protected]>
valuesRef only caught up on render, so a blur right after a value change could commit the previous value and clear the dirty flag. Update the ref in scheduleSet, and cancel a pending drag flush when a reset commits directly so a later blur cannot commit again. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
ac7aaf9 to
a5fb0ed
Compare
Closes #163. First focused split from #156, based on current
develop(93b4be6).Image-changing actions now share a processing guard: quantize, dedither and swatch deletion own the lock; imports, resize, baked adjustments, crop, swatch replacement and queued touch-ups cannot commit stale work across a source change or processing operation. Import validation already in flight is cancelled when processing starts. Pending text drafts are paused during processing and restored if processing produces no output, so they cannot be silently rasterized without an Undo entry. The existing image history and shared canvas pipeline are preserved; edit orchestration lives in hooks.
Ctrl/Cmd+Z and Ctrl/Cmd+Shift+Z undo and redo 2D image edits. They leave text and number inputs, editable content, modal drafts, crop mode, processing, docs and 3D mode alone. The 2D guide documents this in all supported languages.
Validation:
npm run lintand the production build, including translation checks, pass.e1be932: 205 passed across all 8 browser suites, including shared-canvas, rapid touch-up history, 3D export and localization coverage.9a47af0passes lint, formatting, the production build and 27 targeted browser tests, including both quantize and dedither with a pending text draft and no processing output. The full eight-suite run was not repeated for this narrow follow-up.Upstream GitHub CI is currently
action_required, with no jobs started (run).Maintainer follow-up
Rebased onto
develop(after #176 and #178) and added fixes on top of the original two commits:1b203fb, closes the Codex P2). A brush, eraser or text commit that processing refuses is rolled back. Unsaved strokes, and a stroke still being drawn, are dropped before quantize or dedither reads the canvas.Proof: each new regression test fails without its fix and passes with it (brush rollback while saving or still drawing, for quantize and dedither; Ctrl+Z on an open select list; physical Z; keyboard, pending-drag and unrendered slider commits). Local run at
7f5c908(ac7aaf9only moves a comment):check:e2e: passed.@smoke: 137 of 141 passed. The four failures are theimage-decode-reuse"opaque Display P3 … through history" cases. They fail the same way on unchangeddevelopsources on this machine under heavy load, so they are not caused by this PR.Council review
Rounds: 5
Open from the last round (Sol): a Bake and a Resize that both finish encoding before React renders can both reach history. This already happens on
develop, where there is no guard at all; this PR narrows it to that window. Left out of scope.