Admin "what this form submission changed" page - #2303
Open
maebeale wants to merge 5 commits into
Open
Conversation
Reconstruct everything a submission's smart-field answers changed across records — read back from the stamped Ahoy lifecycle events — grouped by record and labelled with what actually happened to each (added, removed, replaced, or filled a blank). Reachable from the linked-organizations page and any form-submission view, both admin-gated. The event stamping this reads is produced separately (PR #2301); the page and its read model are self-contained and tested against synthetic events. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
maebeale
marked this pull request as ready for review
August 21, 2026 15:48
The per-event registrant submissions view lists a person's submissions; add the same admin-gated "what this submission changed" jump to each, and teach the changes page's eyebrow to return there. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
"Changed" now means a submission overwrote a value that already existed — the risky case worth reviewing. Creating records, adding tags, and filling blanks are a new submission's own data, not edits, so they no longer count. The link only appears when there's at least one overwrite and shows how many. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
"Changed" means a submission edited a record that already existed — a value replaced or a blank filled (both from an update event). New records and added tags are still excluded as new data. This lets linking an org that wasn't a clean match raise the count, since the fill lands on the pre-existing org. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Give Maria Johnson (an existing dev-seed person) a registration that arrived after she was on record and edited six details already there — profile, address, phone, and her org's website/type — recorded as stamped Ahoy events so the "what this submission changed" page has a realistic worked example. Also give a few common columns friendlier labels on that page. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
🤖 suggested review level: 3 Read 📖 one read-model PORO + a small admin page and two links; logic is contained and spec-covered
Why
Gives admins a per-submission audit of everything a registration's smart-field answers changed across records — the consumer side of the change-tracking foundation.
What
FormSubmissionChanges— reads the Ahoy lifecycle events stamped with a submission id, groups them by the record they touched (tags attributed to their owner), and labels each with what actually happened: Added / Removed / Replaced / Filled./form_submissions/:id/changes(changes?→admin?), with an outcome chip per row and areturn_to-aware eyebrow.Depends on
Tests
form_submission_changes_spec— grouping, owner attribution, sector/age name resolution, replaced vs. filled, bookkeeping-record filtering, submission scoping.form_submissions_spec— admin renders the grouped changes + empty state; non-admin redirected.page_bg_class_alignment_spec— new view registered.