JM: Person History card + Ahoy person filter - #2207
Open
maebeale wants to merge 8 commits into
Open
Conversation
maebeale
marked this pull request as ready for review
August 15, 2026 13:21
maebeale
force-pushed
the
maebeale/person-edit-history-box
branch
from
August 15, 2026 14:02
6c41def to
00af758
Compare
Give admins a single entry point to a person's full audit trail. The "History" card on person edit aggregates every Ahoy event tied to the person, their user account (lifecycle + auth), and all associated data — including all comments connected to the person via PersonCommentAggregator so History and the comments page stay in lockstep. The card links to the Ahoy activities index, which gains a person_id filter (expanded server-side by Analytics::PersonActivityEvents) and a "Person: <name>" chip in the applied-filters subheader so the active scope is visible. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Continuing education registrations previously reached a person's history only through their comments. Add them as a first-class association in Analytics::PersonActivityEvents (via their event_registration) so their own create/update/destroy events surface too — matching how they're already a first-class comment source in PersonCommentAggregator. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Notifications now emit Ahoy lifecycle events — dropped from the AhoyTrackable skip list — so they surface in a person's history. Because lifecycle tracking only fires when Current.user/Current.source is set, background/system notifications (no Current) stay untracked, bounding the added volume to user-initiated notifications. PersonActivityEvents pulls a person's notifications by recipient email, mirroring the "Communications (universal)" card. Associated records: add a Memberships card (distinct from topic subscriptions — annual membership feature, gated on Membership.enabled?) and relabel the "Subscriptions" card to "Topic subscriptions" so the two read as clearly different. Themes memberships orange with an id-card icon. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Surface a person's continuing-education registrations as a card in the associated-records panel. CE registrations have no index route yet, so the card is a placeholder (count only, marked "(placeholder)", no destination) until that page exists. When the Ahoy activities index is scoped to a person (arrived via the person edit History card), the eyebrow now returns to that person's edit page instead of the generic Admin link. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Notifications are already a durable, timestamped log, so ahoy events for them are redundant (and creates can spike in-request). Put Notification back in the AhoyTrackable skip list and drop it from PersonActivityEvents. Instead, when the Ahoy activities index is scoped to a person, surface their communications directly from the notifications table (matched by email, reusing the read-only notification_row partial) with a link to the full communications list. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
main (#2208) added the admin CE registrations browse index, so the card that was a placeholder now links to it, filtered to the person via `for_registrant` / `person_id`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
main #2211 made index_button show "None" instead of 0. The History card is hand-rolled (not index_button), so match it for a consistent panel. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
maebeale
force-pushed
the
maebeale/person-edit-history-box
branch
from
August 15, 2026 15:09
00af758 to
2f00513
Compare
Add the person's event attendance time entries to the activities view, read directly (not via ahoy): self-service sign-ins happen on the login-free public callout with no Current, so track_lifecycle_event skips them — ahoy would show only staff edits and silently drop the registrant's own sign-ins. Listed newest-first with event, date, in/out, and duration. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
@jmilljr24 this adds a "History" button to footer of person edit that goes to ahoy analytics, but merges in notifications (rather than adding ahoy to communications which will bloat ahoy and basically serve same function as notifications) |
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: 5 Inspect 🔬 new service + controller filter aggregating many associations, plus admin view changes
What is the goal of this PR and why is this important?
Give admins one entry point to a person's full audit trail. A new History card on person edit surfaces a count and links to the Ahoy activities index, scoped to that person.
How did you approach the change?
Analytics::PersonActivityEventsaggregates every Ahoy event for the person, their user account (lifecycle andauth.*, matched via the JSONrecord_idthose events use), continuing-education registrations, and all associated data. Comments reusePersonCommentAggregatorso History and the comments page stay in lockstep.AhoyActivitiesController#indexgains aperson_idfilter (expanded server-side by the service), aPerson: <name>chip in the applied-filters subheader, and a back-to-person eyebrow (instead of the generic Admin link) when person-scoped.notification_row).Current), so ahoy would only capture staff edits; read the entries directly.Membership.enabled?) and a CE registrations card (links to the admin CE index added in Add admin CE registrations + Licenses browse indexes #2208, filtered by person); relabeled "Subscriptions" → "Topic subscriptions".Anything else to add?
time_period=all_timeand all audiences, since the index otherwise defaults to past month and excludes admins — hiding most staff-made edits.topic_subscriptions.