Repository navigation
Read every pair's record in the browser, and work out what isn't held (diffs step 4) - #119
Merged
Merged
Conversation
One client source of a pair's record, `records.recordOf`: what the tab holds, then `POST /api/derived/read` for every pair asked for at once, then the differ in the Web Worker, which now makes records as well as highlights. A batch list's pixel stats and moved-and-spacing filter, a story's stats and hunks, and delta keys all read it, so `RenderRow.pixelDiff` and the UI's reading of review.json go, and the cloud list gets stats. A local page writes back what it works out through a new `PUT /api/derived/...`, which the cloud refuses with read-only. A server without the read route answers 404, which counts as holding nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # docs/specs/cli.md # docs/specs/system.md
…4 read in fetchDerived From the simplify pass. A worker-safe `request-error.ts` holds `RequestError`, which the differ's Web Worker throws and posts as it is. `fetchDerived` takes a 404 as nothing held, so the records cache has no special case. The PUT route and sync share `boundedBody`. `Records` says what's `had` and what `failed`, and `useRecord` reads the same store `useRowDiffs` does, told at most once a frame. The delta scan asks for every record ahead, and a list works out what it shows again as records arrive only when moved-and-spacing-only is what's shown. An ahead record no longer keeps its pixels in the Web Worker. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
selfie-bot
approved these changes
Nov 30, 2026
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.
Step 4 of
docs/plans/diffs.md: the differ in a browser, and one source of a pair's record for every page.What changes
records.recordOf(pair)inui/src/client/records.ts. It checks what the tab already holds, thenPOST /api/derived/read, then the differ in the Web Worker. Every ask made in the same turn of the event loop goes out as one read, chunked byMAX_DERIVED_PAIRS. AnythingreadRecordcan't make sense of is worked out again. A server that answers the read with 404, as the Worker in production does today, counts as holding nothing:fetchDerivedreturns[].differ.worker.tstakes{ kind: "record" }beside{ kind: "highlight" }. It decodes and hash-checks both images, then runsdiffImagesand the sharedrecordOf. The highlight path is unchanged, except that it no longer returns thediffnothing read. When an image doesn't come, the failure crosses back as aRequestError(new worker-saferequest-error.ts), so step 0's retries and "couldn't look at N stories" count still apply.PixelDiffor keys reads the record:RenderRow.pixelDiffandBatchViewPlatform.pixelDiffsare gone, and the UI no longer readsreview.json. Its writer stays for step 6.repeatedSizesis gone.PUTs what it worked out to/api/derived/:current/:golden/:tag. ThroughReviewSource.keepDerived,selfie uikeeps it inProject.diffs. The route has the same Host/Origin/header/content-type checks as every other local write, a 64 KiB limit (derived-too-large), and sharesboundedBodywith sync. The cloud refuses it withread-only, for everyone.generate-storybook-fixtures.tsnow writesRECORDS(Node's records), and the preview holds them before every story.PartlyAcceptedhas the browser's differ make a record and checks it equals the one Node made, keys included.Measured (Chromium, local, synthetic batch of 140 changed 1280×1800 stories)
selfie reviewkeeps.docs/specs/ui.rationale.md.selfie pullcan't bring back Replace favicon and UI mark with matched tilted-phone SVGs #108's batch, since it pulls only decisions and a base, so the batch was built synthetically.Specs
ui.md: Package, ReviewSource, Routes, the new "A pair's record" rules, Repeated changes (where keys come from), and Stories.system.md→ Diffs and grouping: what the browser reads and computes. Stale lines are dropped, and the merge keeps selfie diff paints on demand, and selfie review stops painting (step 6, CLI) #118'sselfie diffrow.access.mdand its rationale: the write route, and Future for cloud write-back.cloud.md,cli.md(local layout).Snapshots
Stories hold the same
PixelDiffs as before through the fixture records, so no story should render differently. If theselfiecheck reports a change, I'll explain it here.🤖 Generated with Claude Code