Skip to content

Add full search filter controls#21

Open
ritorhymes wants to merge 5 commits into
eips-wg:masterfrom
ritovision:search-filter-controls
Open

Add full search filter controls#21
ritorhymes wants to merge 5 commits into
eips-wg:masterfrom
ritovision:search-filter-controls

Conversation

@ritorhymes

@ritorhymes ritorhymes commented May 18, 2026

Copy link
Copy Markdown

Built on top of the v2 multi-repo local build system #15.

Part of the Pagefind search rollout coordinated in eips-wg/preprocessor#39. This PR is stacked on #20, which adds the Pagefind browser runtime core. The complete user-facing search experience requires #22, #23, and #24 on top of these controls.

Description

Adds the full search filter controls on top of the Pagefind runtime core.

Demo site: wg-eips.ritovision.com/search

  • Adds Pagefind-backed filter controls for Proposal Category, Status, and Author.
  • Reads available Status and Author values from Pagefind filter data while keeping Proposal Category on the fixed generated proposal-category contract.
  • Establishes the staged, draft, and committed state model for full search.
  • Keeps query edits, filter selections, chip removal, clear-field actions, and Author AND/OR changes in draft state until Search or Enter commits them together.
  • Lets dropdown Apply and outside-click close accept staged dropdown edits into draft state without updating the URL or running Pagefind.
  • Keeps Esc scoped to the open dropdown by discarding only that dropdown's staged edits.
  • Preserves sort as an immediate committed action against the current committed query and filters.
  • Supports empty Search by returning to the clean search route and clearing results without calling Pagefind.
  • Uses the final Proposal Category URL and Pagefind field contract: proposalCategory in the URL and proposal_category for Pagefind.
  • Renders disabled loading filter shells in the template so the filter layout is present before JavaScript hydrates it.
  • Adds filter dropdown, chip, loading-state, and result-hover styles.
  • Extends search UI validation around the URL/state contract, Pagefind filter queries, loading shells, disabled search behavior, and the Pagefind loader boundary.

This PR does not add Created Date filtering, pagination, last-search restore, or the final validation hardening pass. Those land in the remaining stacked theme PRs.

Render external requires entries as direct links without forcing Zola to
resolve them as local pages.

This supports targeted --only rendering, where cross-repo proposal
dependencies can be rewritten to external URLs instead of local pages.

Move the theme demo homepage badges into front matter, a homepage_badges
macro, and theme-owned styles so the demo homepage stays
markdown-friendly.

Declare Zola 0.22.1 as the minimum supported version, enable bottom
footnotes, and update markdown highlighting to the class-based config
with github-light/dark themes and ABNF/CSL-JSON grammars.
Add POSIX and PowerShell setup scripts for theme contributors that
reuse or install build-eips, ensure a supported Zola is available, and
bootstrap the surrounding workspace through an active proposal repo.

Document the theme local development workflow, including workspace
layout, setup flags, serve versus preview, server/base URL settings,
targeted rendering, and source/output overrides.

Keep this focused on setup and documentation; theme rendering behavior
continues to be owned by the earlier theme PR.
Add the generated search route page and inert search state fallback
chain. The theme ships data/build_eips_search.toml with enabled = false
and a [extra.search] block in theme.toml. base.html prefers the project
data file when build-eips has written one and falls back to the
theme-level config for standalone theme consumption. The search route
renders the mount, embeds search state as JSON for later runtime code,
and shows a disabled-state message when search is off. No Pagefind
browser assets are loaded here.

Add the generated search route to the header navigation with a normal
text link so desktop and mobile navigation have the route as soon as the
route exists.

Add the Pagefind indexing contract on proposal rendering. Mark the
proposal article as the data-pagefind-body region and mark repeated
chrome as data-pagefind-ignore, so the index covers proposal prose
rather than taxonomy badges, preamble tables, the table of contents,
status callouts, links, citations, or other repeated UI. Emit Pagefind
filters for derived proposal_category, status, name-only authors, and
created_year; meta for proposal id, title, description, status, type,
category, author display strings, and created date; and sort keys for
number and created date.

Read the canonical proposal id from page.extra.proposal_id on rendered
proposal pages, and add proposal_id values to the committed theme
fixtures so standalone theme rendering produces the same ids that
build-eips will write.

Add two validation scripts. scripts/check-search-template covers the
fallback chain by building downstream Zola fixtures for missing project
data and project override cases. scripts/check-pagefind-indexing-hooks
runs real Pagefind against rendered output and asserts that /search/,
home, taxonomy pages, generic pages, and repeated chrome do not appear
in the index.
Replace the old Fuse search runtime with Pagefind-backed browser search.

Add a loader module as the single Pagefind API boundary. The loader
imports the configured Pagefind bundle, sets basePath, baseUrl, and
excerptLength, initializes once, and serves both search surfaces. Split
the prior monolithic search.mjs into focused modules for config,
constants, DOM helpers, loading, modal search, full-page search, and
result rendering. Rebuild the quick search modal against the new loader
with the final keyword/phrase copy and modal layout.

Wire the full search page runtime shell with query state, the
relevance/number/created sort contract, a status region, a results
region, and the final share-link icon button. The share button keeps
copy success or failure feedback on the icon state instead of rewriting
the result status text.

Update base.html to expose resolved search state as a JSON config script
for client JavaScript, make the global header search trigger a real
/search/ link, and load search UI styles from a dedicated stylesheet
instead of injecting them from JavaScript after startup.

Add check-pagefind-search-ui coverage for the loader boundary, quick
search modal, share icon state, and full search runtime shell against
rendered output.
Add Pagefind-backed filter controls on top of the runtime core. Read
available filter values from Pagefind and render draft-driven dropdowns
for Proposal Category, Status, and Author.

Establish the draft, staged, and committed state model for full search.
Dropdown edits are staged while a dropdown is open. Query and filter
edits update draft UI state. Search or Enter commits the draft query and
filters together, updates the URL, and runs Pagefind. Dropdown Apply,
outside click, chip removal, clear-field actions, and author mode
changes update draft state only. Empty searches clear to the clean
search route without calling Pagefind. Sort continues to commit on
change against committed state.

Use the rendered proposal filter contract introduced by the template
hook foundation: proposal_category, status, and author. Encode Proposal
Category with URL parameter proposalCategory and Pagefind field
proposal_category. Keep Pagefind import, filter loading, and search
execution behind loader.mjs.

Render disabled loading filter shells in the template so the filter
layout is present before JavaScript hydrates it. Add dropdown overlay,
chevron, chip, result-hover, and loading-state styles with validation
coverage for the URL/state contract and Pagefind filter queries.
@ritorhymes ritorhymes force-pushed the search-filter-controls branch from c4e4ff3 to 5bac4f0 Compare May 20, 2026 13:13
@ritorhymes ritorhymes marked this pull request as ready for review May 20, 2026 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant