Repository navigation
Prefixed search on the attendees and organizations pages - #2857
Merged
Merged
Conversation
1 task done
maebeale
marked this pull request as ready for review
October 25, 2026 18:08
maebeale
force-pushed
the
maebeale/work-location-charts
branch
from
October 25, 2026 18:18
8c462c8 to
1f62ddc
Compare
maebeale
force-pushed
the
maebeale/search-syntax
branch
from
October 25, 2026 18:18
2048cf8 to
1730746
Compare
maebeale
force-pushed
the
maebeale/search-syntax
branch
from
October 25, 2026 18:53
1730746 to
f3d6db1
Compare
Four search boxes had grown four dialects. The people index took SearchCop's `or`; the roster keyword box took neither `or` nor the `--` that means "either" in every tag filter, workshop search and picker in this app; and typing a second word widened the people index while narrowing nothing anywhere else. Now the words inside an alternative all have to match in any order, `--` keeps either, quotes make a phrase, and one generated hint sits beside every box saying so. The two rules combine, which is the whole reason expand_alternatives parenthesises each alternative before SearchCop sees it. ContactSearchable holds the prefix map once, so the people index, the attendees page and the organizations index offer the same words and a prefix added here reaches all three. `type:` narrows to a work or personal address and, because SearchCop ANDs prefixes onto one joined row, `type: personal city: austin` asks for an address that is both — one prefix instead of a parallel personal_* set, composing with every field. The organizations box keeps its LA district columns by sitting them beside `type:` out of the bare-term catch-all, where they can be matched as the integers they are. Searching reads live addresses only. The standing chain settles which address SHOWS a person; it is the wrong rule for finding them, because an admin holding their old address would search it and be told nobody lives there. The attendees page had two City filters meaning different things side by side. The work-location one becomes a prefixed box of its own, "Where they work", which is also what lets locality, zip, school district and the LA districts be filtered at all. A visible dropdown still wins over the same field typed into the box, and a bare city param stays honoured as a chip so an older link narrows visibly rather than silently. Person.search_by_params no longer answers contact_info: every index reaches ContactSearchable from the URL param directly, so the branch was a second, older meaning for the same word. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The last pass generalised the people index's Contact info box by rewriting it: its scopes moved into the concern, its grammar changed from "either" to "all", and its hint became a generated constant. That is someone else's page, shipped this week, and nothing here needed it to change. Person keeps search_name_email and search_contact exactly as the people index has always had them, and gains search_location alongside — the same idea with the wider prefix set, the shared grammar and live addresses only. `as:` on searches_contact exists so a model that already has a search of its own can keep it. The controller, the view and the request specs are byte-identical to main again; the one line still gone from search_by_params is the dead contact_info branch nothing reaches. The specs for `type:`, for retired addresses and for the AND/OR grammar moved to the attendees page, which is where that behaviour now lives. Writing them turned up that a bare trailing `or` is SearchCop's operator, so Oregon has to be asked for as `state: OR` — said in the hint on the boxes that take prefixes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
PersonLocations reads where someone works from their active affiliations, so a work address hung off the registration no longer places anyone. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The attendees page's Where they work query now reaches the people index and its email export through a work_location param, placed by PersonLocations as of today. It runs after the existing name/email and contact scopes, so the people index query is unchanged whenever the param is absent; the visible box comes in a later step. Admin-only, like contact_info. 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
force-pushed
the
maebeale/search-syntax
branch
from
October 25, 2026 18:55
f3d6db1 to
fe1afed
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.
🤖 suggested review level: 3 Read 📖 contained: one new concern plus two pages adopting it; the people index only gains an additive URL filter
Takes the Contact info box @jmilljr24 built for the people index (#2825), generalises it into a concern, and gives it to the attendees page and the organizations index. Justin's people index search is unchanged — it only gains an additive, admin-only
work_locationURL filter.Built on his pattern, not over it
Personkeepssearch_name_emailandsearch_contactexactly as they are, and gainssearch_locationalongsidesearches_contact ..., as:exists precisely so a model with a search of its own can keep itpeople/_search_boxes.html.erbhas zero diff against mainpeople_controller.rbonly gains lines; none of his changepeople_search_spec.rbonly gains a newdescribe; his examples are untouchedPerson.search_by_paramsis the deadcontact_infobranch nothing reaches — every index gets there from the URL paramWhat the new box adds
locality:,district:,la_council:,la_supervisorial:,la_spa:, andtype:for work/personal/mailingtype: personal city: austinasks for an address that is both — one prefix instead of a parallelpersonal_*setAddress::STANDING, Chart and filter locations by where people work, on a date #2844) but shouldn't be how you look them up--means either, quotes make a phrase.amy jones--mary davisis(amy AND jones) OR (mary AND davis)Attendees page
Person.search_name_emailwhole so the same words find the same people as on the people indexPersonLocations(Chart and filter locations by where people work, on a date #2844), and is what makes locality / zip / school district / LA districts filterable at allcityparam stays honoured as a removable "City:" chip, labelled like Chart and filter locations by where people work, on a date #2844'sorg_citychipOrganizations index
People index:
work_location(URL only, no box yet)?work_location=state: CAnarrows the index and email export, placed byPersonLocationsas of todayPersonPolicy::ADMIN_ONLY_FILTERS); page links carry itRoster + bulk-email picker
--as "either", the way tag filters and workshop search already dojones amyfinds Amy Jones — the roster's twoCONCAT(first, ' ', last)rows only ever carried one word orderGotcha found while testing
oris SearchCop's operator, so Oregon has to be asked for asstate: OR; a bare trailingorsilently matches nobody. Noted in the hint on the prefixed boxes. Pre-existing on the people index box too.Features seed (optional)
🤖 Generated with Claude Code