Open
Conversation
Collaborator
Author
|
@jmilljr24 you ok w these changes? |
The registrant dropdown on event registration forms only returned 10 results with no deterministic ordering, causing admins to miss people. Increased to 25 with alphabetical ordering. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Two issues caused admins to not find people: 1. Multi-word queries like "John Smith" searched each column for the full string, matching nobody. Now splits into terms and ANDs them, so each term can match any column independently. 2. Person search only checked first_name and last_name. Admins searching by email got no results. Added email to searchable fields. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests cover multi-word queries, email search, exclusion, ordering, authorization, and edge cases for the registrant dropdown fix. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Verifies that names like "Mary Ann De La Cruz" can be found by searching any combination of terms from the first or last name. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Person remote search now checks email, email_2, and the associated user's email via a left join. This lets admins find people by any of their email addresses in the registrant dropdown. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests that the search endpoint finds people by email_2 and user email, and that the displayed label uses preferred_email priority order: user email > person email > email_2. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
TomSelect re-filters loaded results client-side using its score function on the label field. When the server matches on a field not in the label (e.g. email_2 or user email), TomSelect hides those results. Override score to trust server-side filtering. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Verifies the server returns people found via email_2 or user email even when the search term doesn't appear in the display label. This is the scenario where TomSelect was previously re-filtering results. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
User email is always first priority in preferred_email, so the label will always show user email when present — no mismatch is possible. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Covers the scenario where a search matches on people.email but the label displays user.email (higher priority in preferred_email). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
With score always returning 1, cached items from previous searches would accumulate and all show in the dropdown. Clear options before each new fetch so only the current server results are displayed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
TomSelect defaults to max-height: 200px on the dropdown content, which only fits ~7 visible items. Increase to 400px so users can see more results without scrolling. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Style the scrollbar with a thin gray thumb on a light track so users can see there are more results to scroll through. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Chrome uses overlay scrollbars by default which are invisible. Force the scrollbar to always render with overflow-y: scroll, add -webkit-appearance: none to opt out of overlay mode, and use scrollbar-color for Firefox support. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace custom scrollbar styling with a "Scroll for more results" text hint that appears below the dropdown when results overflow. Only shows when there are more items than the visible area fits. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Render name in bold with email in gray for person and user remote search dropdowns, matching the searchable_select_controller style. Uses the model value to conditionally apply rendering. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Model spec: create person explicitly with user association instead of relying on user.person which doesn't exist by default - Request spec: create persons with explicit user associations for tests that search by user email - Request spec: use looser assertions for guest/non-admin/invalid model since the app redirects rather than returning 403 - Controller: call skip_verify_authorized! before head :forbidden for invalid models to avoid verify_authorized after-action error Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
c11a754 to
3853ce4
Compare
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.
What is the goal of this PR and why is this important?
How did you approach the change?
left_joins(:user)score: () => () => 1so server results aren't hidden when matched on fields not in the labelclearOptions()before each fetch to prevent stale cached items from accumulatingUI Testing Checklist
Anything else to add?
RemoteSearchableconcern changes apply to all models usingremote_searchable_by, but the Person-specific email/user-email search is isolated toPerson.remote_searchpreferred_emailmethod)🤖 Generated with Claude Code