Keep People "Email addresses" in sync with the active filter - #2533
Merged
Merged
Conversation
The link lived in the static index header and was built once from the page's query params, so filters applied later via the Turbo frame never reached it — clicking it returned every person's email. Re-render the link inside the frame response (mirroring the people_count pattern) so it always carries the current filter, and gate it on :manage? rather than :index?. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jmilljr24
approved these changes
Sep 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 suggested review level: 3 Read 📖 small view/controller change, re-renders one link in the existing Turbo frame
Admins who filter the People directory and then click "Email addresses" now get emails for just the filtered people, not everyone.
What is the goal of this PR and why is this important?
people_resultsTurbo frame without changing the top-level URL, so the link kept its stale (usually empty) params and returned every person's email.How did you approach the change?
turbo_stream.replace(same pattern as the people count), so it always carries the current filter.:manage?instead of:index?to match the other admin-only buttons.Anything else to add?
:index?and:manage?both resolve to super-admin today, so who can use the feature is unchanged — the gate switch is for intent/future-proofing.