Skip to content

Affiliation edit gear: standalone editor with comments + reassign - #2235

Merged
maebeale merged 37 commits into
mainfrom
maebeale/affiliation-edit-gear
Aug 17, 2026
Merged

Affiliation edit gear: standalone editor with comments + reassign#2235
maebeale merged 37 commits into
mainfrom
maebeale/affiliation-edit-gear

Conversation

@maebeale

@maebeale maebeale commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator

🤖 suggested review level: 3 Read 📖 mostly view restructuring (grid rows + editor layout) plus one strong-param addition; contained blast radius

Why

  • Nested affiliation rows on the org/person edit forms can't reassign the person/org (locked to a hidden field once persisted) and have no place for comments.
  • A per-row gear now escapes to a fuller affiliation editor for exactly those two things.

What

  • Gear — light-grey fa-gear top-right of each persisted affiliation row on both edit forms; opens the editor in a new tab.
  • Standalone editor (affiliations#edit/#update, admin-only) — reassign person, reassign organization, edit title/dates/primary-contact, plus the standard comment thread.
  • CommentsAffiliation is now polymorphically commentable (same pattern as Person/Org); edits are audit-tracked via the inherited AhoyTrackable concern (update.affiliation).
  • Return-to — gear carries return_to + origin_id; save/cancel returns to the originating edit page, scrolled to the row (the editor's eyebrow + Cancel are the way back, since the new tab has no useful browser back).

Layout & editor polish

  • Inline rows → shared grid — affiliation rows on the person/org edit forms lay out on one CSS grid; a single desktop-only header row carries the column labels (Organization/Person, Title, Address, Start, End, Primary contact). At xl+ the rows align on a grid under the header; below xl they wrap and keep per-field labels; on mobile they stack. Uniform row height (Title textarea pinned + resize-none), symmetric padding.
  • Full editor — surfaces the address association (reuses the address picker) and permits organization_address_id so the change saves. Top of the form is now Person + Primary contact on one row, then Organization + Address at 50/50. Org and address notes are amber warnings; title hint reworded.

Notes

  • Reassigning the org clears the now-stale organization_address_id and event_registration_id (done in before_validation so the address validation doesn't reject the change first).
  • Opens in a new tab, so the org/person form's unsaved edits are preserved.

Tests

  • Request (edit/update, reassign, comment authorship, admin-only), policy, model (commentable + org-reassign clearing + buffered update.affiliation event), page_bg_class mapping.

Copilot AI lite review requested due to automatic review settings August 16, 2026 23: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.

Copilot AI review requested due to automatic review settings August 16, 2026 23:57

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 17, 2026 00: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
maebeale marked this pull request as ready for review August 17, 2026 01:43
Copilot AI review requested due to automatic review settings August 17, 2026 01:45

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 17, 2026 01:48

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 17, 2026 01:59

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 17, 2026 02:01

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 17, 2026 02:01

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 17, 2026 02:07

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 9 commits August 17, 2026 01:48
The nested affiliation rows on the org/person edit forms can't reassign
the person/org (hidden once persisted) and have nowhere for comments.
A per-row gear escapes to a standalone editor that can do both, and
carries return_to so it comes back to the exact row it was opened from.
Affiliation is now commentable (same polymorphic pattern as Person/Org),
so edits are audit-tracked via the inherited AhoyTrackable concern.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Keeps the shipped-feature seed current per the Features & tips workflow.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Preserves the org/person edit form's unsaved state; the editor's eyebrow
and Cancel handle the return since the browser back button is useless
across a new tab.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Put the person/organization lookups in one row, move their hints into
simple_form's hint slot so they sit tight under each field (the manual
paragraph sat below the wrapper's mb-4, leaving a large gap), and add a
hint clarifying what the "Facilitator" title means.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Give the title flex-1 and the date fields a fixed width so all three
sit on one row on desktop and wrap only when space runs out (before,
the date wrappers' full-width inputs forced End to wrap).

Make paginated-fields honor a #row fragment on connect: the affiliation
rows paginate at 10/page, so a returned-to row was hidden on a later
page and the browser couldn't scroll to it. Now the controller jumps to
that row's page and scrolls it into view.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Hide the nested-row "Remove" link on persisted affiliations; deletion
  now happens via the gear editor's Delete button (destroy honors
  return_to and lands back on the origin's affiliations section).
- Compact the person/organization profile buttons in the nested rows
  (add a compact option to organization_profile_button) and raise the
  date inputs to the other fields' height.
- Tighten vertical padding around the affiliation cards and the Add
  Affiliation button on both edit forms.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The person/organization column is the tallest, so pt-3/pb-2 left more
space above the label than below the profile button; use py-2 so the
gap above the label matches the gap below the button.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The two-line "Primary org<br>contact" label with the checkbox floating
below it made that column stack taller than the input columns, leaving
extra space in the card. Use a single-line label and center the checkbox
in a 42px box so the column matches the inputs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 17, 2026 05:49
@maebeale
maebeale force-pushed the maebeale/affiliation-edit-gear branch from f907e12 to 5726034 Compare August 17, 2026 05:49
Copilot AI review requested due to automatic review settings August 17, 2026 12:21

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.

Dates, address, and non-facilitator titles now echo the person button: empty
fields are transparent so the card tint shows through, filled fields take the
pill colour for the row's state (grey inactive, purple facilitator, else white).
The "Facilitator" title keeps its own darker purple. Server-rendered and kept in
sync live via the inactive-toggle controller (new valueField targets + paintFields),
with address-select dispatching a change so a picked address repaints too.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 17, 2026 12:32

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.

…server expired

Filled dates/address on an inactive facilitator row now take the same light
purple (purple-50) as the inactive facilitator title, instead of grey. Also pass
the server-rendered `expired` to the controller so a flagged-inactive row with no
end date renders consistently (the JS can't see the DB flag, so it now trusts the
server for date-less rows instead of guessing active).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 17, 2026 12:39

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.

…purple

Active non-facilitator rows now use a very light grey (gray-50, near white)
instead of the sky/emerald theme tint. Inactive facilitator rows keep a light
purple background + pill (new facilitator_inactive tint) to match their purple
title/fields, rather than greying out like inactive non-facilitator rows.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 17, 2026 12:54

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.

…ansparent

Inactive facilitator filled fields (and pill) now use the same bg-purple-100 as
active — the person-button colour — instead of the lighter purple-50; the row's
light-purple bg + softer title text + dimming still read it as inactive. Bump the
inactive-row dimming from opacity-60 to opacity-80 so the page no longer bleeds
through. Drop the now-unused facilitator_inactive pill tint.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 17, 2026 13:07

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.

…end date)

Adopt option C from the prototype: colour now carries role only (facilitator =
purple, else neutral) for both active and inactive rows, and inactive is a
structural cue instead — a dashed row border plus a struck-through end date
(.date-ended). This separates the role and status axes so all four states read
clearly, and drops the opacity/shade juggling. Simplifies the controller (role-
only fills, no isPast in the colour paths).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 17, 2026 15:48

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.

…fields

Role is the hue (facilitator = purple, non-facilitator = blue) and status is the
saturation (active = full -100 fills / -500 accent, inactive = super-light -50
fills / -300 accent + softer title). Add blue pill tints. Inactive rows also
strike through every field value (.aff-ended, row-wide), replacing the earlier
end-date-only strike. Drops the dashed-border / neutral-grey scheme.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 17, 2026 16:18

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.

Extend the .aff-ended strike to the pill's name/email (the .truncate spans in
the profile-button link), leaving the avatar untouched. Server-rendered, so it
applies on page load as well as live.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 17, 2026 16:30

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.

Show a comment icon (in the row's hue — purple/blue) beside the primary-contact
toggle when the affiliation has comments; hovering reveals the count and the most
recent comment. Add a request spec covering it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 17, 2026 16:46

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 merged commit 3b1fe7f into main Aug 17, 2026
3 checks passed
@maebeale
maebeale deleted the maebeale/affiliation-edit-gear branch August 17, 2026 18:03
maebeale added a commit that referenced this pull request Aug 19, 2026
The person History card and activity timeline had nothing multi-year to render,
so affiliation edits, trainings, memberships and comments couldn't be seen
interleaved. Two gaps kept the seeded rows invisible: affiliation comments were
missing from PersonCommentAggregator (Affiliation became commentable in #2235
without being added), and payment lifecycle events record the STI subclass
("CashPayment"), which the person's Payment filter never matched.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

2 participants