Skip to content
SprecherEast
Issue 200

bug: Search links events to a 404, drops a shared query, and doesn't encode it

Back to our plan
Done
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=council shows results, then the empty search box rewrites the address to /search after 200 ms (src/search/Component.tsx:9–16).
  • Typing a&b produces ?q=a&b, so the server searches for a (src/search/Component.tsx:15). The security guideline asks for encodeURIComponent.

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=council keeps its query and results.
  • Not done: A search for a&b searches for a&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

See it on GitHub, opens in a new tab