Skip to content

Person History card + Ahoy person filter - #2207

Open
maebeale wants to merge 8 commits into
mainfrom
maebeale/person-edit-history-box
Open

Person History card + Ahoy person filter#2207
maebeale wants to merge 8 commits into
mainfrom
maebeale/person-edit-history-box

Conversation

@maebeale

@maebeale maebeale commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

🤖 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::PersonActivityEvents aggregates every Ahoy event for the person, their user account (lifecycle and auth.*, matched via the JSON record_id those events use), continuing-education registrations, and all associated data. Comments reuse PersonCommentAggregator so History and the comments page stay in lockstep.
  • AhoyActivitiesController#index gains a person_id filter (expanded server-side by the service), a Person: <name> chip in the applied-filters subheader, and a back-to-person eyebrow (instead of the generic Admin link) when person-scoped.
  • Not-ahoy-tracked data surfaced directly on the person-scoped activities view, since ahoy would be redundant and incomplete for both:
    • Communications — notifications are already a timestamped log; read from the notifications table (reusing notification_row).
    • Attendance time entries — self-service sign-ins happen on a login-free public callout (no Current), so ahoy would only capture staff edits; read the entries directly.
  • Associated-records cards: History card fills the empty bottom-right grid cell (admin-only); added Memberships (gated on 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?

Copilot AI lite review requested due to automatic review settings August 15, 2026 12:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings August 15, 2026 12:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings August 15, 2026 12:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@maebeale maebeale changed the title Person History card + person filter for Ahoy activities Person History card + Ahoy person filter; track notifications Aug 15, 2026
Copilot AI review requested due to automatic review settings August 15, 2026 13:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings August 15, 2026 13:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@maebeale maebeale changed the title Person History card + Ahoy person filter; track notifications Person History card + Ahoy person filter Aug 15, 2026
@maebeale
maebeale marked this pull request as ready for review August 15, 2026 13:21
@maebeale
maebeale force-pushed the maebeale/person-edit-history-box branch from 6c41def to 00af758 Compare August 15, 2026 14:02
Copilot AI review requested due to automatic review settings August 15, 2026 14:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

maebeale and others added 7 commits August 15, 2026 10:52
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
maebeale force-pushed the maebeale/person-edit-history-box branch from 00af758 to 2f00513 Compare August 15, 2026 15:09
Copilot AI review requested due to automatic review settings August 15, 2026 15:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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>
Copilot AI review requested due to automatic review settings August 15, 2026 15:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@maebeale
maebeale requested a review from jmilljr24 August 15, 2026 15:42
@maebeale

Copy link
Copy Markdown
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)

@maebeale maebeale changed the title Person History card + Ahoy person filter JM Person History card + Ahoy person filter Aug 15, 2026
@maebeale maebeale changed the title JM Person History card + Ahoy person filter JM: Person History card + Ahoy person filter Aug 15, 2026
@maebeale maebeale changed the title JM: Person History card + Ahoy person filter Person History card + Ahoy person filter Aug 16, 2026
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.

3 participants