Keep View registration button lit for public users via reg param#1365
Keep View registration button lit for public users via reg param#1365maebeale wants to merge 1 commit into
Conversation
1510833 to
cca0f79
Compare
|
This pull request has been inactive for 30 days. Please update it or let us know if it is still relevant. |
1 similar comment
|
This pull request has been inactive for 30 days. Please update it or let us know if it is still relevant. |
cca0f79 to
22240eb
Compare
Public (non-authenticated) users who register for events lose the 'View registration' button when they navigate away, because they have no logged-in identity to look the registration up by. This threads the registration slug through the URL as a '?reg=' param so the button persists across the events index and event pages for the current browsing session. - Slugs are packed into a single reg param, period-delimited, so one session can carry 2-3 registrations (period never occurs in a urlsafe_base64 slug, keeping the URL clean and collision-free) - EventsHelper parses the param, matches registrations per event, and merges a new slug in after registering so earlier events stay lit - The param is forwarded across nav/register links and the ticket page, and survives the Stripe checkout round-trip for paid events - Purely URL-based: nothing persists server-side, so a shared computer never leaks a prior visitor's registration - Request spec coverage for single- and multi-slug display and merging Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
22240eb to
97b37ce
Compare
| # (logged-out) users keep the "View registration" button lit across several | ||
| # events in one session. A period is used because it never appears in a | ||
| # urlsafe_base64 slug and stays unescaped in a URL, keeping it human-readable. | ||
| REG_PARAM_DELIMITER = "." |
There was a problem hiding this comment.
🤖 From Claude: Period is the delimiter because slugs are urlsafe_base64 (alphabet includes - and _) — a hyphen delimiter could collide with a slug that contains one. . never appears in base64url and stays unescaped in URLs.
| <% content_for(:page_bg_class, "public") %> | ||
| <div class="max-w-3xl mx-auto flex flex-wrap items-center gap-2 px-4 pt-4"> | ||
| <%= link_to event_path(@event_registration.event, reg: @event_registration.slug), class: "inline-flex items-center gap-1.5 text-sm text-gray-500 hover:text-gray-700 px-2 py-1" do %> | ||
| <%= link_to event_path(@event_registration.event, reg: reg_param_with(@event_registration.slug)), class: "inline-flex items-center gap-1.5 text-sm text-gray-500 hover:text-gray-700 px-2 py-1" do %> |
There was a problem hiding this comment.
🤖 From Claude: This is the one place a slug gets added to the set — after any registration the visitor lands here, so merging this ticket's slug into the inbound ?reg= param is what lets a second/third event stay lit alongside earlier ones.
What is the goal of this PR and why is this important?
?reg=slug drops off the URL the button disappears on the events index and on event pagesHow did you approach the change?
?reg=param instead of persisting anything server-side?reg=slugA.slugB) — a period never occurs in aurlsafe_base64slug, so the URL stays clean and collision-freeEventsHelperparses the param, matches a registration per event, and merges a new slug in after registering so earlier events stay litWhy URL param instead of session?
Trade-offs
UI Testing Checklist
🤖 Generated with Claude Code