Skip to content

Add a search bar to the event spread view #2197

Description

@moveson

Spectators and crews — typically on phones — often need to locate a single entrant on the full spread of a large event. Scanning a long table is slow, and the browser's find-in-page feature is not discoverable on mobile. A search bar at the top of the spread would solve this directly.

The backend already supports it

EventSpreadDisplay#filtered_ranked_efforts (app/presenters/event_spread_display.rb) already applies .search(search_text), backed by the existing pg_search scopes (search_names_and_locations, search_bib). The page simply never grew a search input, so this is a view-layer feature.

Tasks

  • Add a search input to the spread view (reuse the house search-input pattern from other filtered index pages), submitting via GET so results are shareable/bookmarkable and display_style/sort params are preserved
  • Add search to EventSpreadDisplay#cacheable_params_digest — the digest currently covers only display_style, filter, and sort, so a searched result set would be cached under (or served from) the unsearched cache entry. This is technically a latent bug today for hand-built URLs and becomes load-bearing once search is in the UI
  • Show a clear-search affordance and an empty-state message when no entrants match
  • Mobile-first placement/sizing — the primary user is a crew member on a phone

Notes

  • Each distinct search term becomes its own fragment-cache entry once the digest includes it; acceptable at current traffic, but worth keeping the digest normalization (e.g. strip/downcase) in mind
  • Related but independent: highlighting followed entrants for signed-in users is tracked separately

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions