Skip to content

Show affiliation history as a merged timeline - #2260

Draft
maebeale wants to merge 1 commit into
mainfrom
maebeale/affiliation-timeline
Draft

Show affiliation history as a merged timeline#2260
maebeale wants to merge 1 commit into
mainfrom
maebeale/affiliation-timeline

Conversation

@maebeale

@maebeale maebeale commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

🤖 suggested review level: 3 Read 📖 two read-only views over existing data; no writes, no migrations

Split out of #2195. Now based directly on main — it was stacked on the STI branch (#2259) while that was open, and that closed unmerged.

Why

An affiliation's dates say what is true now, not how it got there. The Ahoy lifecycle events already record every edit, and the trainings and membership periods that explain those edits live in their own tables. This puts all three in one time-ordered view.

What

Affiliation edit → History section

Merged newest-first in Change | What | When | By columns: recorded edits (End date: — → Mar 4, 2026), the person's facilitator trainings, membership periods, and which registration minted the row.

Person → Affiliation history page

Person-level counterpart, reached from the gear on the affiliations section. Admin-only.

Why trainings and memberships aren't read from Ahoy

  • track_lifecycle_event bails unless a Current.user/Current.source is set, so imported and seeded rows have no events at all
  • Ahoy records changes, not state — a registration created already attended and never edited would never appear

Ahoy is used only for the affiliation's own columns, where nothing else records them.

Notes

  • Analytics::ResourceHistory is generic — any record's Ahoy history, so the next edit page that wants this is a two-line wire-up
  • Membership entries are gated on Membership.enabled?, so nothing renders in production
  • Read-only throughout: no writes, no migrations, no schema changes

@maebeale
maebeale force-pushed the maebeale/affiliation-timeline branch from 263bb67 to 4307c83 Compare August 19, 2026 14:15
@maebeale
maebeale changed the base branch from maebeale/facilitator-affiliation-reconciliation to maebeale/facilitator-boolean-affiliations August 19, 2026 14:15
@maebeale
maebeale force-pushed the maebeale/facilitator-boolean-affiliations branch from e6f321b to 75e1fb5 Compare August 21, 2026 16:43
Reading an affiliation's dates tells you what is true now but not how it got
there. The Ahoy lifecycle events already record every edit, and the trainings and
membership periods that explain those edits live in their own tables — this puts
all three in one time-ordered view so an admin can see why a row looks the way it
does without leaving the page.

Two views: a History section on the affiliation editor (Change / What / When / By
columns), and a person-level affiliation history page reached from the gear on the
person edit form's affiliations section.

Trainings and memberships are read from their own tables rather than from Ahoy:
Ahoy records *changes*, and only those made while a Current.user or Current.source
was set, so imported and seeded rows have no events at all. Ahoy is used only for
the affiliation's own columns, where nothing else records them.

Split out of #2195. Was stacked on the STI branch (#2259) while that was open; now
that it is closed unmerged, this sits directly on main and the STI-specific
resource-type matching is gone with it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@maebeale
maebeale force-pushed the maebeale/affiliation-timeline branch from 4307c83 to 1500928 Compare August 23, 2026 19:55
@maebeale
maebeale changed the base branch from maebeale/facilitator-boolean-affiliations to main August 23, 2026 19:55
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