Issue 200
bug: Search links events to a 404, drops a shared query, and doesn't encode it
Back to our planDone
bugfrontendpriority: high
Type
bug
Summary
Three search bugs: event results open a 404, a shared search link loses its query, and the query isn't URL-encoded.
Problem
- The search index holds posts and events (
src/plugins/index.ts:136), but every result is drawn as a post card linking to/posts/<slug>(src/components/CollectionArchive/index.tsx:22). All four results for "council" are events, and all four links return 404. - Opening
/search?q=councilshows results, then the empty search box rewrites the address to/searchafter 200 ms (src/search/Component.tsx:9–16). - Typing
a&bproduces?q=a&b, so the server searches fora(src/search/Component.tsx:15). The security guideline asks forencodeURIComponent.
Found while taking the UI inventory (https://github.com/boulaajaj/sprecher-east-neighborhood-website/blob/main/docs/ui/evidence.md#bugs-found-while-taking-the-inventory, opens in a new tab, #170).
Proposed fix
Link each result by its collection (doc.relationTo), start the search box from the URL's q, and encode the query.
Acceptance criteria
- Not done: An event result opens the event.
- Not done:
/search?q=councilkeeps its query and results. - Not done: A search for
a&bsearches fora&b. - Not done: Unit tests cover the link and the encoding.
Area
frontend
Priority
priority: high
Generated by Claude Code, opens in a new tab