Skip to content

Add admin workshop RSVP members page (replaces 4k-item dropdown) - #2798

Merged
mroderick merged 2 commits into
masterfrom
feature/workshop-rsvp-page-clean
Aug 9, 2026
Merged

Add admin workshop RSVP members page (replaces 4k-item dropdown)#2798
mroderick merged 2 commits into
masterfrom
feature/workshop-rsvp-page-clean

Conversation

@mroderick

@mroderick mroderick commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Replaces the 4,000-item RSVP dropdown on the admin workshop show page with a dedicated, search-driven RSVP members page. The show page now links to it with a prominent button and no longer queries the full invitation list.

The manual RSVP is only ever used, when members show up for a workshop and haven't accepted the invite. We don't need to show the full list of RSVPs in a dropdown every time an organiser opens the workshop detail page.

What it does

  • New page GET /admin/workshops/:id/rsvp (Admin::WorkshopsController#rsvp):
    • Eligible invited-member count (invitations joined to member, excluding banned)
    • Name-search box (server-side, Member.find_members_by_name), results paginated with Pagy at 20/page
    • Workshop details (id, date/time, venue, spots) and an intro explaining the page
    • Per-row RSVP / Mark as not attending toggle that posts the inverted attending value to the existing Admin::InvitationsController#update, which redirects back preserving the search + page
  • Show page: the <select> is replaced by an "RSVP a member" button; the page no longer materialises the invitation list
  • Page titles set on both pages
  • Separate fix: escape %, _ and backslash in Member.find_members_by_name (a bare % matched every member; a trailing backslash caused a 500) — also hardens the existing admin/member_search

Related work

Tests

  • Controller specs for the rsvp action (search filter, banned exclusion, eligible count, eager-loading), the toggle (both directions + redirect-back preserving q/page), and view rendering (badges for attending/no-response/declined, pagination, empty state)
  • Member.find_members_by_name specs for wildcard/backslash terms
  • 209 controller/request/querier/model examples green; rubocop clean

Notes

  • Scope is the admin-only workshop RSVP page; no new mutation logic (reuses the existing update path)

Measured performance

/admin/workshops/3824 (4,364 invitations, 27 attending) against the production dump, same session.

Metric master this PR
End-to-end (browser DomContentLoaded) ~119 s ~2.0 s
RSVP dropdown partial render ~9.2 s ~0.03 s (link)
Server view_runtime ~10.7 s ~1.5 s
Allocations ~28.9 M ~4.7 M

Replacing the <select> with a link removes the ~9 s render of the 4,337-option dropdown and the large HTML body, taking the page from ~119 s to ~2.0 s end-to-end (roughly 60x faster).

Query count is unchanged (~202) — the N+1 fix is #2797, which is complementary; the two PRs merge independently.

@mroderick
mroderick force-pushed the fix/admin-workshop-nplus1 branch from 6f89a35 to 2380b3c Compare August 9, 2026 07:29
@mroderick
mroderick force-pushed the feature/workshop-rsvp-page-clean branch from d80b073 to fdb2e36 Compare August 9, 2026 07:39
@mroderick
mroderick changed the base branch from fix/admin-workshop-nplus1 to master August 9, 2026 07:40
@mroderick
mroderick marked this pull request as ready for review August 9, 2026 10:49
@mroderick
mroderick force-pushed the feature/workshop-rsvp-page-clean branch from fdb2e36 to 11e2ea6 Compare August 9, 2026 10:52
@mroderick
mroderick requested a review from olleolleolle August 9, 2026 10:53
@mroderick
mroderick force-pushed the feature/workshop-rsvp-page-clean branch 2 times, most recently from 0b37cf2 to 6d4bd02 Compare August 9, 2026 12:23
Add a dedicated RSVP members page for a workshop
(GET /admin/workshops/:id/rsvp): an eligible invited-member count
(invitations joined to member, excluding banned), a name-search form
over that workshop's invited members in any attending state (Pagy,
20/page), and a per-row toggle that posts the inverted attending value
to the existing Admin::InvitationsController#update, which redirects
back preserving the search.

Show the workshop details (id, date/time, venue, spots) and an intro.
Replace the full invitation <select> on the show page with a prominent
"RSVP a member" button and set page titles.
Member.find_members_by_name interpolates the search term into an ILIKE
pattern unescaped, so a bare '%' matches every member and a trailing
backslash raises a Postgres 'LIKE pattern must not end with escape
character' error. Escape %, _ and backslash so search terms are treated
literally. This hardens the new RSVP search and the existing
admin/member_search endpoint.
@mroderick
mroderick force-pushed the feature/workshop-rsvp-page-clean branch from 6d4bd02 to bf9f1c5 Compare August 9, 2026 12:32
@mroderick
mroderick enabled auto-merge August 9, 2026 12:34
@mroderick
mroderick merged commit bb24c0d into master Aug 9, 2026
9 checks passed
@mroderick
mroderick deleted the feature/workshop-rsvp-page-clean branch August 9, 2026 12:36
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