Repository navigation
Conversation
…ched Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
@codex review |
Codex Review SummaryThis 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: 1c8e38a610
ℹ️ 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".
| const live = !flushed and file.buffers.stroke.order.items.len == file.buffers.stroke.pixels.count(); | ||
| const drawn: []u32 = if (live) (steps.orderOf(gpa, file.buffers.stroke.order.items) catch &.{}) else &.{}; |
There was a problem hiding this comment.
Route live stroke releases through the motion-aware commit
When a stroke uses the live buffer—for example, after its deferred snapshot exceeds the size cap—normal pointer release still calls drawPoint/drawLine with to_change = true, which reaches File.commitStroke. Its non-deferred branch calls toChange and history.append directly, bypassing this new metadata setup and clearing the recorded order. Consequently, these live hand-drawn strokes still export without motion; the new path is only reached when such a stroke is cancelled by cancelActiveDrawing. Route the non-deferred release path through the motion-aware commit as well.
Useful? React with 👍 / 👎.
Made by: claude
Part of fizzyedit/plans#65 (step A)
A pencil stroke was stored as a hash map, so its step was a sorted pixel set and a tape lost the order it was drawn in. Now:
Buffers.Stroke.orderrecords each pixel index when first touched (append,appendAssumeCapacity); cleared intoChangeandclearAndFree.strokeUndoCommitsetshistory.showing_order/showing_marks(one pen mark)/showing_msaround the append, as commands.zig does, somotionOfemitsStep.motion. A stroke flushed from the deferred snapshot is found by row scan, so it gets no motion.motionOf's index-to-position mapping moved tosteps.positionsOfso it is testable.Not in this PR: overdraw and per-sample timing (step B, a format change). Step format 2 is unchanged; steps without motion decode and apply as before.
Ran:
zig build test(new tests: out-of-order hand stroke exports in drawn order, repeats rejected by decodeMotion, step without motion still applies) andzig build, both pass locally. Not exercised: drawing by hand in the running app.Fix (crash on first hand stroke):
strokeUndoCommitzippedStroke.orderwith adrawnbuffer that was empty whenever the stroke was not "live" (the deferred-snapshot flush, or an allocation failure) whileorderwas not, so Debug panicked on non-equal lengths.orderis now converted bysteps.orderOf(its own length, no zip), and only for a live stroke. Tests added: empty and one-pixel orders, and an order longer than the pixels returns no motion.Not tested:
strokeUndoCommititself (it needs aFileand dvui, outsidezig build test) and I have not drawn in the running app, which is why the first version crashed. Please try one stroke before ready. Ran after the fix:zig build test,zig build.🤖 Generated with Claude Code