Skip to content

Keep showing a change after it's approved - #64

Merged
nedtwigg merged 3 commits into
mainfrom
show-accepted-changes
Nov 5, 2026
Merged

nedtwigg merged 3 commits into
mainfrom
show-accepted-changes

Conversation

@nedtwigg

@nedtwigg nedtwigg commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Once a change is approved, later batches compare against it, so it stops showing as a change. A merged PR's commit, a later commit on the PR, and a re-render at the same commit all open on "Nothing differs", with no link to what happened. For example, #60's merge commit reads as 124 unchanged. The diffs only survive on the batch the approval was made on, and nothing leads there.

What it does

  • Finds the base: a batch's base is the newest finished batch of the default branch at a commit it reaches, other than its own commit. It needs no schema change, no Git in the Worker, and no parent order, so it also works on batches already recorded.
  • Lists what's been approved since then: a story is listed if it doesn't differ now but would differ by the base's approvals. It's shown between what it replaced and this image, including approved additions and removals.
  • Shows it on the batch page: a banner says "124 stories changed and approved earlier", with a "See what changed" button. There's also a count and a new "Approved earlier" option under Show.
  • Offers no chat either: chat answers 404 for a story its batch reads as unchanged, so its panel is hidden on these rows.
  • Offers no decision: each story opens with its usual before, after and diff, plus a link to the batch it was approved on. There are no approve or reject buttons, and pressing a says why. The server already refused such a decision as stale-decision.
  • Stores new diffs on push: /diffs/needed now includes these pairs, because a branch that approved several times creates a before-and-after pair that no single commit compared.

Later batches on the default branch use the merge as their base, so a merge shows only what it brought, and the commits after it show nothing.

Testing

  • pnpm test passes after merging main: ui 105, store 632 (92 skipped), render 148, cli 516. The last commit, which hides chat on these rows, had a typecheck and the filter and delta tests only.
  • New tests cover the rule, the SQL on a store (merge, later branch commit, next default-branch commit, re-render), real Git through approvedSinceOf, the route including the refused decision, and the stored diff on push.
  • Dogfooded through selfie ui on a scratch repo that merges the real header change (before and after Storybooks from 9fb57fd and 6e330ef):
    • The merge batch reads 124 unchanged, and the new list shows all 124 with real diffs, such as 21,057 pixels on pages-batch--dark.
    • The batch the approval was made on lists nothing, since it still shows those as changed itself.
  • The three new stories render, and one asserts that there are no decision buttons.

Before you rely on it

  • Not tried on the hosted Worker: it needs a deploy, which I haven't done. The hosted route shares its store code with the tests above, but the page itself has only run locally.
  • Some older diffs may be missing on the hosted site: diffs are stored by pair, and only new pushes store these extra pairs. A story whose pair was never compared should show its before and after images with "The pixels couldn't be compared" instead of a diff. That's from reading the code, not from seeing it happen. A single-approval PR like Link the demo videos from the README, and say what's really built #60 already has its pair.

Known limitations

  • Re-rendering an old commit on the default branch: that batch can become the newest, so the list reaches further back and shows more than it needs to.
  • Read once per page load: the list doesn't refresh when the window regains focus, unlike the rest of the batch. Approvals made elsewhere appear on the next load.
  • Every batch page pays for it: the banner needs the count, so each load makes one more request. On the Worker that's two more D1 reads, plus a read of each approving batch's Storybook and viewports.
  • Only reached through the filter: a story page opened without ?show=approved-earlier still just says "Unchanged".

Not in this PR

GitHub statuses on later commits still go stale: 05a0588 says "124 changed, waiting for approval" although its batch reads 124 unchanged, because publish only updates the commit that was decided on.

🤖 Generated with Claude Code

nedtwigg and others added 3 commits November 4, 2026 17:00
Once approved, a change is what later batches compare with, so a merged pull
request's commit opens on "Nothing differs", with nothing leading to what it did.
A batch now lists what's been approved since its base, the newest batch of the
default branch its commit reaches, each between what it replaced and this image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	ui/src/client/DetailScreen.tsx
Chat answers 404 for a story its batch reads as unchanged, which is what these are.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nedtwigg
nedtwigg merged commit 13ce513 into main Nov 5, 2026
1 of 2 checks passed
@nedtwigg
nedtwigg deleted the show-accepted-changes branch November 5, 2026 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant