Repository navigation
refactor(examples): remove search from the workshop and venue lists - #396
Conversation
The workshop and venue lists now have one query path for text: QueryKit filters. The search parameter, its max length, and its LikePattern code are gone from the parameters DTOs, the handlers, and the HTTP and MCP entrypoints. The MCP filters description of list_workshops tells a caller how to write text with a quote, in the words of new-feature.cs. The SPA keeps its search box, its search URL param, and the text box of the venue picker. The list hooks send the text as a title or name filter with containsText. quoteText moves from the filter builder to frontend/src/lib/querykit-text.ts, so the filter builder and the lists share one encoder. Each box takes its max length from the field that its filter matches. The list query tests find text through a filter that QueryKitText.Quote writes, and keep each guarantee: case does not matter, %, _, and \ are plain text, and NUL and a lone surrogate map to the filters parameter. LikePattern, its banned-symbol rule, and its tests stay. The docs now say that a list finds text through filters, and that LikePattern is the rule for a raw ILike.
Independent verification of 3114d20: PASS+NOTESGoal checked: the workshops search box and the venue picker find text as before, and only the request changes (it sends How. Isolated stack from Search box on
All 50 requests (GET and POST) to URL reloads.
Venue picker (new workshop form). Typing Breaking change, recorded. Through the BFF, Pixels. I read the screenshots of the full list, a filtered list, both empty states, the empty tenant with a spaces URL, and the picker open on 12 results and on the plain search. The alignment, spacing, and clear button look right, and the sweep found no layout or focus fault. Nothing looks off. Notes (none block the merge).
Evidence (local): |
Why
A list in the template had two ways to query by text: a
searchparam and QueryKitfilters. QueryKit 1.17.1 lets a filter hold any text, so the user decided to keep onlyfilters. #394 taught the filter builder the padded raw string, and #395 removedsearchfrom the generator. This PR removes it from the workshop and venue examples, the SPA, and the docs. It is the last step.What changed
Server
searchis gone fromWorkshopParametersDto,VenueParametersDto,GetWorkshopList(handler, HTTP, MCP), andGetVenueList(handler, HTTP).list_workshopsMCPfiltersdescription now tells a caller how to write text with a", in the words the generator uses.SPA
?search=URL param, and the venue picker work as before.filters=title @=* "..."(venues:name), and the newcontainsText<T>(field, text)builds it.Tis the DTO, so a field name that the DTO does not have fails the build.quoteTextmoved tofrontend/src/lib/querykit-text.ts. The filter builder andcontainsTextuse that one encoder.?search=schema keeps the max length of a title, so a longer URL search falls back to the whole list, as it did before.No workshop has "" in its title.for a URL search of only spaces.Tests
WorkshopListQueryTestsandVenueListQueryTestsnow prove case,%,_, and\throughfilters, withQueryKitText.Quote. The NUL and lone-surrogate refusals now name thefiltersparam.QueryInputErrorTestsandQueryKitInputExtensionsTestsalready cover thefilterslimit.querykit-text.test.tscovers quotes at the ends,%_, a run of three quotes, trimming, and blank text.workshop-list.test.tsxhas a test for a URL search longer than a title. It fails without the limit.Docs and skills
features-and-cqrs.md"Search text" now says that a list finds text throughfilters.LikePatternstays the rule for any rawILike.backend.md,frontend.md,client-state.md,server-state.md,testing.md, thefrontend-featureandwriting-testsskills, and the verify skill workshops feature and recipe.Breaking change
Update each caller that sends
searchtoGET /api/v1/workshops,GET /api/v1/venues, or thelist_workshopsMCP tool. Sendfilters=title @=* "text"instead. An oldsearchparam is ignored without an error, so the caller gets the whole list.Not changed
LikePattern, its banned-symbol rule, and its tests stay. After this PR, no production code callsLikePattern. Whether to delete it is an open call for the maintainer.Local runs
With the examples kept:
dotnet build: 0 warnings.dotnet test --solution: 2598 of 2598 passed.pnpm lintandpnpm build: pass.pnpm test: 524 passed.With the examples removed:
pnpm test: 506 passed.pnpm test:e2e: 183 passed.dotnet test: 1997 of 1997 passed.After the review, I ran the frontend example and lib tests again: 186 passed.