Skip to content

feat(server): search results page with recipe cards and pictures #828

Closed

Description

@LeMyst

A low-priority idea from a user (C4rdninj4): a search results page for cook server that shows recipes as cards with their pictures, not just the dropdown under the search box.

Today

The search box in base.html (static/js/search.js) calls GET /api/search?q=… and lists the hits in a dropdown. Each row has a name and a path, nothing else: /api/search (handlers::recipes::search) returns only name and path. Pressing Enter does nothing unless a row is highlighted with the arrow keys, and no page lists all the results.

That works when you know which recipe you want. It's less useful when you're browsing ("something with leeks"), where the picture helps you choose.

Proposal

  • A GET /search?q=… page that shows the results as the same .recipe-cards the recipe index (recipes.html) uses, picture included when the recipe has one.
  • Pressing Enter in the search box with no row highlighted opens that page. Maybe also a "See all results" row at the bottom of the dropdown.
  • The dropdown stays as it is for quick jumps.

Things to keep in mind

  • Results come from cookcli_core::search::search and are filtered with inside_collection, like /api/search, so the page, the dropdown and cook search all find the same recipes.
  • Pictures go through /api/static (server/static_files.rs), like the recipe index.
  • --recipes-only: the page is a recipe read, so it goes in auth::middleware::RECIPE_READS.
  • The page strings ("N results for …", "No recipes match …") need messages in every locale (tests/locales_test.rs).
  • cook build web (static mode) has no server to answer /search. It could keep only the dropdown, or render the page in the browser from the search index it already loads.
  • Tests: a Playwright spec (typing a query and pressing Enter opens the page with cards) and a server integration test through common::with_isolated_config.

Activity

  1. added a commit that references this issue on Nov 16, 2026
    d94b10f
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions