Repository navigation
history: a sprite's undo comes back when it opens again - #64
Merged
Merged
Conversation
Pixi takes its history back from fizzy's track (`restoreHistory`), and hashes a sprite for fizzy (`documentFingerprint`), which is how fizzy knows a kept track ends where the sprite stands: until now no pixi track was kept at all. A step pixi cannot encode yet (anything but pixels) is still reported after its restart, so fizzy keeps who made it. Pixi's own "Undo: …" toast goes: fizzy's bubble says it, and whose. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
foxnne
force-pushed
the
history/shared-history
branch
from
October 19, 2026 19:11
47d371c to
602ea04
Compare
foxnne
marked this pull request as ready for review
October 19, 2026 19:16
Merged
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.
Part of fizzyedit/plans#14 (
plans/SHARED_HISTORY_PLAN.mdstep 3;plans/RECORDING_PLAN.mdstep 10 for pixi).Most of pixi's share of shared history was already on main (#48, #49, #56, #57, #59, #60, #62: step ids, every step reported with its top and author,
historyLine/historyGoTo, going back as a step, the waiting draw keeping its author). This closes what was left.What changes
restoreHistory: each entry one pixel step (steps.zig), kept with its id, checked against the sprite first (steps.fits, a walk back and forward on a copy of each layer the steps touch) and refused, history untouched, when it does not fit; ids must be distinct, non-zero and not the unsaved mark. A non-empty history is refused over one being made (fizzy picks a kept track up again when a restart leaves a track with no base, which could otherwise replace live history). A saved sprite stays saved. An empty history clears it, so "Forget This Document's History" works for pixi too.documentFingerprint: a hash of the grid, each layer by position (name, shown, folded, pixels; a drawing still being revealed as it ends), the sprites' origins and each animation's name and frames. fizzy keeps a closed document's track only when the owner has one, so until now no pixi track was ever kept and nothing could be restored.restarted, so fizzy never heard of the step: an agent's Add Layer read as nobody's, and "Go back to before Claude's change" could not find it. A step added now follows its restart, effect empty; the recorder's new track drops steps before its base, so tracks are unchanged. Undo and redo of such a step still report only the restart: with the authors cleared, fizzy would read the step as the person's and announce the wrong undoer.quietflag, which only silenced that toast, goes with it.Known limit, needs fizzy: a
restartedclears fizzy's author map, so after a non-pixel step the steps before it read as the person's (seen: Claude's Draw before Claude's Add Layer, after going back). Fix: either pixi encodes everyChangekind (RECORDING_PLANstep 4), or fizzy's Tracks starts a new track on an empty-effect step so owners need not sendrestartedfor it. Left as a follow-up. Also not carried yet: a take-back step's "Back to …" title across a reopen (text's #641 put it in its step format; pixi's format has no label).How it was seen (macOS, debug fizzy at main 58cdcb16,
--quiet, its own profile, pixi Debug):fizzy.undoanswered{"title":"Layer","by":"Claude"}, then{"title":"Draw","by":"Claude"}; the control server's own calls read as the person's.fizzy.goBackBeforeanswered{"to":3,"by":"Claude","also_taken_back":0}and the agent's layer was gone.zig build test: the newfitstest (a history fits the sprite it leads to, not another).Not seen: Windows/Linux (no platform code here).
🤖 Generated with Claude Code