Repository navigation
Fix all code-review findings (2026-10-21) and history.js on Chrome for Mac - #22
Merged
Merged
Conversation
…hat clear as objects Fixes findings 1-3 of the 2026-10-21 code review, and what three review rounds of the fix found. - Save: S.docId (bumped by New and Open) is checked before the encode (the save is cancelled) and after the write (the new document keeps its own handle, name and save point). encodeBlob's fallback, which encodes the live canvas, rejects when the document was replaced (its `still` callback), so a failing blob worker can't write the new document into the old file. - Resize: a scale still running when New or Open replaces the document is dropped (New and Open reuse the base canvas and empty the history, so only S.docId tells). - Open: requests to replace the document are ordered with New (doc.js requestDoc / landDoc). An Open still loading when a later request lands is dropped quietly; a later one that never lands leaves it be; an edit made while it loads is asked about again. - ⌘E on a selection: a mark that clears or replaces what is under it (Core.clearsUnder) stays an object and splits the images where it overlaps them, with a toast. Tests: core.test.js (clearsUnder, flattenRuns), alpha.js 13, libs.js (resize during New/Open, save during New with a failing blob worker), smoke.js (saves and Opens racing New and each other). Each new check fails without its fix.
…s on Chrome for Mac - A pencil or eraser stroke that joins recomposes its tiles that hold other objects: drawn in later batches, it left their anti-aliased edges up to 4 levels off a fresh compose on Chrome for Mac (history.js's 3 failures here). - Open after a slow discard prompt offers the picker from a toast button. - PNG CRCs are computed lazily; png-worker reads a transferred snapshot back instead of the page calling getImageData on #image. - A restyle sets only what the kind draws with; Cut deletes after the clipboard write, and only what it copied; box-select and pan release toolbar focus; [ / ] keep to the even grid above 10. - encodeBlob falls back to toBlob when the snapshot fails; copying the whole image refuses a picture changed while it encoded; a second Cmd+E on a lone image adds no step. - readScene validates objects (Core.validObj); Core.unionBox replaces Math.max(...) over object lists; a brush's frame is its ink; paintLater skips an empty pass. - The "nothing seen changes" claim for Cmd+E on a selection now notes anti-aliasing shifts.
…colour and size, bench row for a pencil over objects - The Open… toast keeps the document mark from its confirm, so an edit made while it waits is asked about again (the file input path too, through takeInputSeen()). - A line draws with colour and size only: colour 2 on a selected line adds no step. - encodePng catches a failed snapshot where it is taken (no unhandled rejection). - bench.js: 'pencil over 5k' measures rejoin's cost; task.md records it and the open decisions.
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.
Fixes every finding of the 2026-10-21 code review (
docs/code-review-2026-10-21.md), plus the 3history.jschecks that failed on Chrome for Mac.What changed
Work that waits no longer lands on a newer document (findings 1–3,
c56df80)S.docIdtells documents apart.The rest of the review (findings 4–12)
[/]move an odd size above 10 onto the even grid.png-worker.jsreads a transferred snapshot back. The page no longer callsgetImageDataon#image. The worker still accepts the old{raw}message.encodeBlobfalls back totoBlobwhen the snapshot fails.Core.validObj). A bad one opens as plain pixels.Math.max(...)over object lists (Core.unionBox).paintLaterskips an empty pass.history.json Chrome for Macrejoin,scene.js).pencil over 5k:inpMain1.2 → 10.2 ms; no interaction over 200 ms).after editsmemory row shows +120 MB.Decisions for you
These are the agent's defaults. They're also listed in
task.mdunder Open.alt). The check now expects only the line's colour to change.Verification (this Mac)
c56df80was interrupted before it reported. Firefox and real Safari remain untested, as before.