Repository navigation
app: history strip slices are 1:1 crops of the frame - #656
Merged
Merged
Conversation
foxnne
force-pushed
the
app/history-slice-crisp
branch
2 times, most recently
from
October 19, 2026 17:27
e0ac0c3 to
ef8e7e4
Compare
foxnne
marked this pull request as ready for review
October 19, 2026 17:27
Each step's picture is now a crop of the pane at its own pixels, the strip's size, centred on where the step changed the document, and the strip draws it one pixel for one. Before, a 384x192 thumbnail was stretched into the strip, which blurred it past reading. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
foxnne
force-pushed
the
app/history-slice-crisp
branch
from
October 19, 2026 18:15
ef8e7e4 to
871087e
Compare
4 of 5 tasks
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.
Builds on #653 (base
app/history-slice-change; retarget tomainonce it lands).What changes
The history strip's slices are crisp: each step's picture is a crop of the pane at its own pixels, the strip's size, centred on where that step changed the document, and the strip draws it one pixel for one (Retina-aware, nearest sampling, whole-pixel placement). Before, a ~384x192 thumbnail was stretched into the strip, which blurred text past reading.
HistoryFrames.takecopies the pane twice on the GPU: a small copy (384x192, as before) for finding the change, and the whole pane at 1:1 into a target kept while the history keeps moving (a held undo or a scrub reuses it; it is let go of the first frame no picture is asked for). The next frame,landreads back the small one, finds the change's box (columns from app: each step's history slice shows where it changed #653's prints, plus rows the same way:prints), and crops the strip's size round it out of the whole copy (history_transport.cropAt,FrameTarget.copyRect). Only the crop is kept.FrameTargetgainssnapshotInto(the last frame into a caller's kept target) andcopyRect(a rect of a texture into a new target);snapshotTargetis built from the same pieces.contentOf), else the pane's middle. (The brief said the pane's middle; content first keeps a small document's text in the strip rather than empty pane.)HistoryTransport.stripPixelsgives the strip's full-grown size in physical pixels, at its widest (no export button);paintStripdraws each picture centred in its column withhistory_transport.oneToOne, cut to the column, never scaled. The content-framing rules (frameContent,contentUnion,sliceAt) are gone.Measured (Debug, macOS, one quiet sandbox run, text document, 15 edits/undos through the control socket,
devtools.stats): the capture (history.frame, both GPU copies encoded) 0.30–0.44 ms max per move; the landing (history.frame.crop: readback of the small copy, prints, crop) 1.6–2.9 ms max, once per move, nothing on other frames. The readback was already there before this change (history.frame.content).Memory: per step, the crop (strip w x h x 4 bytes; 600x104 on a Retina screen with a full-width bar = 250 KB) plus prints ((384 + 192) x 4 = 2.3 KB).
capstays 48: about 12 MB, under the old ~14 MB. Transient: one whole-pane copy for one frame per history move.SDK impact
FrameTarget.copyRectadded in the backend's glass; no fingerprint move expected)Verified
Unit tests:
cropAt(round the change, held inside, smaller picture),oneToOne(1:1, centred, cut, whole pixels), row+column change box fromprints,changedSpan.Follow-ups
A picture taken at one display scale and shown at another is still drawn 1:1 (so smaller/larger than the strip); it is replaced at the next move.
🤖 Generated with Claude Code