Skip to content

Fix area/section faceting - #138

Merged
antidipyramid merged 2 commits into
masterfrom
bugfix/77-area-section-facet
Jul 28, 2026
Merged

Fix area/section faceting#138
antidipyramid merged 2 commits into
masterfrom
bugfix/77-area-section-facet

Conversation

@antidipyramid

Copy link
Copy Markdown
Collaborator

Overview

This PR aims to fix inconsistencies when using the area/section facets when searching by:

  • only allowing one area to be selected at a time
  • only allowing sections to be selected when an area has been selected
  • restricting selectable to section to ones within the selected area

#77 outlines more low-level fixes to the problem of section numbers not being unique but we'll try refining facet behavior on the search page before more involved solutions.

Testing Instructions

  • Verify that the above aims hold true when selecting area/section facets

msj added 2 commits July 15, 2026 10:34
- only allow faceting by section if an area has been selected
- only allow sections in the selected area to be selected
- only allow one area to be selected at a time
@antidipyramid
antidipyramid requested a review from xmedr July 15, 2026 14:54

@xmedr xmedr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! Works as expected. Just a handful of things to flag.

Searching by just area returns only items in that area, but searching by both area and section is performing an OR query. So when I search by Area 6 and Section 31, I get:

  • items in that area but different sections
  • items in that section but different areas

This same thing happens on staging, so it's not from something in this pr, but figured I'd flag since this new UX may imply an AND query.

Also, since we're now hiding the section facet before selecting an area, it might be useful to have some text either in the Area dropdown, or an empty Section dropdown, that notes that you have to select an area to select a Section, since staging has both available. Just a thought totally up to you and/or CCFP

</button>
<div id="facet-panel-collapse" class="facets-collapse collapse" style="width:100%">
{% for facet_field in view.facet_fields %}
{% if facet_field == "section" and "area_exact" in selected_facet_fields or facet_field != "section" %}

@xmedr xmedr Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation for this if and its related endif seem to be a little off

@antidipyramid
antidipyramid merged commit b523594 into master Jul 28, 2026
2 checks passed
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.

2 participants