{# The sidebar rides along on every results swap, out-of-band, so its counts and drill-down always describe the results below. Without this the sidebar is stale from the first filter click until a full page load, which is fatal for faceted browsing: the numbers are what the user steers by. htmx restores focus after a swap to an element with the same id, so every control in the sidebar carries a stable one and keyboard position survives. The typeahead input additionally uses hx-preserve, since its value is user state the server does not render. Guarded on `oob_sidebar`: the full page includes this same partial inside #results-container, and rendering the sidebar there too would emit it twice with duplicate ids. Only the standalone /discover/results response sets it. #} {# #total-count sits in the page form, outside #results-container, so a plain swap leaves it reading the previous filter's total. It said "13 items" beside a list showing 3. #} {# Search results say how well they matched, in two places. .results-tier-break is the one heading, and it sits exactly where the claim it makes becomes true: above it, every row holds at least one word that was typed; below it, every row holds none and is here on character overlap alone. The query orders the tiers and flags the first row of the lower one. A page made entirely of near matches carries the heading at the top, which is the honest rendering under pagination. No heading when not searching, and none for 1-2 character searches, which are substring-only and have no boundary. .row-match-note is the per-row half: "Matched 3 of 5 words" on a row holding some but not all of them. It cannot be a heading, because coverage varies row to row and one page can hold a 4-of-5 beside a 1-of-5. Rows with every word say nothing, since that is the unremarkable case; rows with none say nothing either, because the heading above them already did. Grid view needs `grid-column: 1 / -1` on .results-tier-break to span the row. Discover has no CSS yet, so these are class hooks like the rest of the sidebar. #} {% if oob_sidebar %} {{ count_label }} {% endif %} {% if oob_sidebar && mode == "items" %}
{% include "partials/discover_sidebar.html" %}
{% endif %} {# The region a filter change replaces, whole. Its id is here rather than on a wrapper in the page, so the answer to /discover/results IS the region and an outer swap keeps the element every control targets. The out-of-band elements above stay outside it: htmx only honours hx-swap-oob at the top level of a response. #}
{% if mode == "projects" %} {% for project in projects %} {% if project.starts_fuzzy_block %}
Near matches None of your words are in these. The spelling is close.
{% endif %} {{ project.title }}{{ project.creator }}{% if project.match_label.is_some() %}{{ project.match_label.as_deref().unwrap_or("") }}{% endif %} {{ project.category_name.as_deref().unwrap_or(&project.project_type) }} {{ project.item_count }} {{ project.date }} {% endfor %} {% if projects.is_empty() %}
{% if is_search %}

Nothing matched your search.

Try fewer words, or check the spelling. You can also clear all filters.

{% else %}

No projects found matching your filters.

Try clearing all filters.

{% endif %}
{% endif %} {% else %} {% for item in items %} {% if item.starts_fuzzy_block %}
Near matches None of your words are in these. The spelling is close.
{% endif %} {% endfor %} {% if items.is_empty() %}
{% if is_search %}

Nothing matched your search.

Try fewer words, or check the spelling. You can also clear all filters.

{% else %}

No items found matching your filters.

Try clearing all filters.

{% endif %}
{% endif %} {% endif %}
{% if mode == "projects" %} {% for project in projects %} {% if project.starts_fuzzy_block %}
Near matches None of your words are in these. The spelling is close.
{% endif %}
{{ project.title }}
{{ project.creator }}
{% if project.match_label.is_some() %}{{ project.match_label.as_deref().unwrap_or("") }}{% endif %}
{% endfor %} {% if projects.is_empty() %}
{% if is_search %}

Nothing matched your search.

Try fewer words, or check the spelling. You can also clear all filters.

{% else %}

No projects found matching your filters.

Try clearing all filters.

{% endif %}
{% endif %} {% else %} {% for item in items %} {% if item.starts_fuzzy_block %}
Near matches None of your words are in these. The spelling is close.
{% endif %} {% endfor %} {% if items.is_empty() %}
{% if is_search %}

Nothing matched your search.

Try fewer words, or check the spelling. You can also clear all filters.

{% else %}

No items found matching your filters.

Try clearing all filters.

{% endif %}
{% endif %} {% endif %}