Skip to content

JM: Make the profile page where people edit or ask for changes - #2671

Open
maebeale wants to merge 34 commits into
mainfrom
maebeale/profile-page-edit-requests
Open

maebeale wants to merge 34 commits into
mainfrom
maebeale/profile-page-edit-requests

Conversation

@maebeale

@maebeale maebeale commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

🤖 suggested review level: 5 Inspect 🔬 four new owner pages, a nested-attributes change, and a reworked change-request flow

Facilitators (a very low-tech audience) can now open their own profile and change things one step at a time, without the long admin form.

Profile as the hub

  • Owner banner (people/_own_profile_banner): heading plus two buttons, "Choose what others can see" and "Edit my data". Pending change requests show below.
  • Section buttons with words, not a pencil on every field. Each one jumps to that part of the simple edit page. Affiliations get "Ask for a change".
  • "My profile" in the avatar menu now shows for owners outside production.
  • Gate: PersonPolicy#edit_own_profile? (owner and not production). Production doesn't change.

New owner pages (each saves through update with return_to, then returns to the profile)

  • people#details, "Edit my data": cards for photo, name and pronouns, emails (address read-only, type editable, a request link per address), bio, birthday, time zone, phone, best time to call, mailing address, social media, sectors and ages, program settings, and licenses. Sectors, ages, and program settings use slider switches.
    • Every owner link goes here, never to the full form.
    • Sector and age checkboxes are inverted _destroy boxes. Child indexes must be numeric, or strong params drop them.
    • A star picks the main sector and age range. It reuses the existing primary-tag controller (no new JS files), and the server still rejects two main sectors.
  • people#visibility, "Choose what others can see": on/off switches and name-style cards that preview the person's real name.
  • Organization changes ask one question per page: which organization (skipped if there's only one), what to change, then a form with only those inputs.
    • No JS show/hide.
    • "AWBW Facilitator" display title.

Change requests

  • Started from the edit page: each email and organization has its own request button there.
  • Phones, addresses, licenses: chained <details> toggles (people/_add_more_chain) add several before saving, with no JS. Every card has a Remove box, and an unsaved card marked Remove is skipped.
  • return_to=details brings an email request back to the edit page's email card.
  • New other field: free text, resolved by staff by hand.
  • Fixed: the request form picked its layout from auto_appliable?. So an affiliation request with a category already set (when editing a pending one, or re-rendering after an error) showed a plain text box.

Worth a look

  • ADR-0006 (from Align owner profile edit fields with what saves #2670): "Edit · owner" now means these owner pages. The secondary email moves from admin-set to request-a-change.
  • New secondary_email request type: Approve writes email_2 directly. The primary email still goes through the confirmation flow.
  • Person contact methods: reject_if now skips a new row with no number. Its hidden kind used to defeat :all_blank.
  • Request tabs (known, accepted): email and organization requests open in a new tab so unsaved edits stay put. After sending, the original tab won't show the request as pending until it's refreshed.
  • Full edit form: still reachable by URL. Owners can still see their sent-emails list there, which the simple page doesn't show yet (Where should facilitators see the emails AWBW has sent them? #2677).
Screenshot 2026-10-14 at 11 29 50 AM Screenshot 2026-10-14 at 11 22 41 AM image Screenshot 2026-10-14 at 11 22 33 AM image Screenshot 2026-10-14 at 11 37 07 AM

🤖 Generated with Claude Code

@maebeale maebeale changed the title WIP: Make the profile page where people edit or ask for changes Make the profile page where people edit or ask for changes Oct 14, 2026
Comment thread app/models/person.rb
accepts_nested_attributes_for :contact_methods, allow_destroy: true, reject_if: :all_blank
# A new row's hidden kind is always filled in, so a row counts as blank by its number.
accepts_nested_attributes_for :contact_methods, allow_destroy: true,
reject_if: proc { |attrs| attrs["id"].blank? && attrs["value"].blank? }

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🤖 From Claude: This also changes the admin form: a blank cocoon-added phone row is now silently skipped instead of failing validation. Its hidden kind made :all_blank never match.

@maebeale
maebeale force-pushed the maebeale/profile-page-edit-requests branch 3 times, most recently from 81369d4 to df5cad7 Compare October 14, 2026 14:16
owner_params = permitted.except(*ADMIN_ONLY_FIELDS)
owner_params[:user_attributes] = owner_params[:user_attributes].except(*ADMIN_ONLY_USER_FIELDS) if owner_params[:user_attributes]
owner_params[:sectorable_items_attributes] = without_admin_sector_flags(owner_params[:sectorable_items_attributes]) if owner_params[:sectorable_items_attributes]
owner_params[:affiliations_attributes] = owner_affiliation_fields(permitted[:affiliations_attributes]) if permitted[:affiliations_attributes]

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🤖 From Claude: Owners can now send affiliations_attributes, narrowed to id + organization_address_id on existing rows. The model validation keeps the address within that affiliation's organization, and nested attributes only find rows in the person's own association. Person's affiliation reject_if was loosened to new rows only so this update isn't dropped.

@maebeale
maebeale marked this pull request as ready for review October 14, 2026 14:37
@maebeale
maebeale force-pushed the maebeale/profile-page-edit-requests branch from b0ef2c4 to cd49411 Compare October 14, 2026 14:39
@maebeale maebeale changed the title Make the profile page where people edit or ask for changes JM: Make the profile page where people edit or ask for changes Oct 14, 2026
@maebeale
maebeale requested a review from jmilljr24 October 14, 2026 15:39
@maebeale
maebeale force-pushed the maebeale/profile-page-edit-requests branch from f653771 to a0a7f85 Compare October 14, 2026 15:57
maebeale and others added 17 commits October 14, 2026 20:19
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Facilitators are a very low-tech audience. They didn't know the edit form existed
and couldn't tell which details they could change and which needed staff. The
profile now spells that out: one big Edit button, labeled buttons for the
staff-kept details, and an Edit button on each section. Change requests and Cancel
both return to the profile.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The visibility checkboxes sat near the bottom of a long form, mixed with fields
staff use. Low-tech users need a short checklist they can't get lost in. Saving
goes through the regular update and returns to the profile.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
People need a way to ask for changes that aren't their email or an
organization, so an "other" request carries just a free-text description that
staff resolve by hand. The visibility page now uses on/off switches and name
cards that show the person's real name in each style, so it's easier to scan.
New specs check that every setting on the page saves for an owner and lands on
the person's change log.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
People with several organizations had to find theirs in a dropdown buried in
the form. They now pick from cards first, or add a new one. Someone with one
organization goes straight to the form. Also fixes the request form showing a
plain text box for an affiliation request that already has a category, which
broke editing a pending request.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
After picking an organization, people now pick what to change from cards and get
a form with only those inputs, such as native date pickers for dates. The
dropdown that revealed fields with JavaScript is gone. Facilitator affiliations
read "AWBW Facilitator", and the visibility labels say whose work each switch
covers.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The full person form is long and full of staff-only controls. Owners now get a
single page of plain-language cards: photo, name, bio and birthday, phone,
address, social media, sectors and ages as checkboxes, and licenses. Every edit
link on their profile leads there. Blank add-new rows are skipped, and a new
phone row with no number no longer trips validation.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
People can't change their main sector or age range here, so they need to see
which one it is before unchecking it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sectors and age ranges now use the same on/off switches as the visibility page,
through one shared switch partial. The name card groups pronunciation with legal
first name and puts pronouns on its own row.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A star beside each sector and age range sets the main one. It reuses the
primary-tag controller, so starring a row turns it on and turning a row off
clears its star. If JavaScript doesn't run, the server still rejects two main
sectors.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Main made time zone, best time to call, and program settings owner-editable, so
the simple page now has them too. ADR-0006 now lists the owner pages. The full
form keeps its admin wording when an admin edits their own record.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Owners can now see both email addresses, set each one's type, and jump to a
change request for that exact address. The secondary email gets its own request
type, which admins approve like the primary one. The request form returns to
the email card. Both owner forms now warn before leaving with unsaved changes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The ↗ icon promises a new tab, and opening one keeps the edit page and any
unsaved changes in place.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The add-an-organization request needed an existing organization from the search,
which left people stuck if theirs wasn't in the portal. They can now type its
name instead. Staff create it by hand, so these requests skip Approve.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
"Show my name as" now says it applies throughout the site. The free-text
request reads "Request a profile data change" everywhere it's offered.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The Your name heading and the hint already say what the choices do. The label
stays for screen readers.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… card

People with more than one address had no way to add another or say which one we
should mail to. A native details toggle adds one address at a time, with no JS.
The existing primary-tag star picks the main address, and someone's first
address is starred by default. The phone number, type, and best time to call now
share one row on desktop.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
maebeale and others added 17 commits October 14, 2026 20:19
… types

An unlit star alone didn't say what it did, so it now reads "Mark as main"
until picked (CSS only). Licenses use the same "Add a license" toggle as
addresses. Each email's type now sits beside the address, not at the far right.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
People can add more than one phone and pick the one to call first. This uses the
same details toggle and star as addresses, and the first phone is starred when
none is marked. The stars line up with the field labels. Only the free-text
request form is titled "Request a profile data change". The banner and link go
back to their earlier wording.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Low-tech users who get stuck can reach staff in one click. The contact form
comes prefilled with a profile-question subject and leads back to the edit page.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Owners can reach staff from their profile too, not only from the edit page. The
contact form leads back to the profile.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The edit page stays focused on editing. Questions start from the profile.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Owners can see each organization on the edit page, with a button to request a
change and one to add an organization. The request steps carry return_to and
come back to the card. The banner's question button now reads "Ask an
unrelated question".

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Main brought back the collapsed Hidden from profile card. Its "Change sharing
settings" link went to the full form, which owners aren't linked to.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The banner is now the heading plus two buttons, "Choose what others can see"
and "Edit my data". Change requests live on the edit page next to what they
change. On that page, phones, addresses, and licenses share one add pattern:
chained details toggles add several before saving, and every card can be
removed. Affiliations name each organization once, with its titles nested
under it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
People had no way to see or set which of an organization's addresses is their
work address. The edit page now shows it under each title as a plain dropdown
of that organization's addresses. The policy lets owners change only that field
on affiliations they already have. A missing address goes to staff through a
new "Add my work address" request. Person's affiliation reject_if now applies
only to new rows, so the narrowed update isn't dropped. Also: "Your activity"
and consistent "you" wording on Choose what others see.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
An owner who toggled their bio off still saw a standalone "Add a bio"
section, as if a bio would show publicly. The prompt now sits with the
other hidden pieces so the page reflects what others will actually see.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A blank bio shows nothing to others even with sharing on, so a standalone "Add a
bio" card still read as a public section. The prompt now always sits in the
owner-and-admin card. The card's "turned off in sharing settings" note shows
only when something really is turned off.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Reverts the previous commit. With bio sharing on, the owner should see the
standalone prompt in its usual spot. Only a bio switched off folds into Hidden
from profile, as in #2688.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
It matches the collapsible lilac cards beside it. It starts open, and the title
and a chevron toggle it through the existing expandable-card controller.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The work address card under every title made the list long and pulled titles
apart. On desktop each title is now one row: title and dates, a compact work
address dropdown, then Request a change. "Address not listed?" is the
dropdown's hint link.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@maebeale
maebeale force-pushed the maebeale/profile-page-edit-requests branch from a0a7f85 to 50834a5 Compare October 15, 2026 00:26
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