Repository navigation
Commit 13521a5
committed
Redesign category + tag filter UI: sidebar, popover, mobile sheets
Replaces the link-based subcategory/facet pill rows with a real
client-side faceted filter, matching the attached design:
- Desktop: a persistent 'Browse category' sidebar (subcategory list
with static counts) + a 'Filters' button that opens a popover with
one chip group per facet, an applied-filters chip row, and a live
'N resources' / 'Show N results' count.
- Mobile: the sidebar and popover become two toolbar buttons that open
bottom sheets — Browse category, and Filters (collapsible accordion
groups, sticky Clear all / Show N results footer).
- Filtering is now genuinely combinable (category AND every selected
facet, OR within a facet's own values) and updates the grid live,
instead of linking off to a separate taxonomy term page per click.
- Category counts are still server-rendered per section (accurate,
static); the live result count and card visibility are client-side,
driven by a small per-section JSON payload embedded in the page
(static/js/resource-filters.js) — no fetch, works progressively
(full card grid is still real HTML/SEO-visible with no JS).
- Card tag chips trimmed from up to 4 down to 2 (subcategory + one
facet value), matching the design's card density.
- Sections with no schema entry (Press & News) or no facets/subcategories
yet (empty Member Directory) simply don't render the controls that
wouldn't do anything — no dead buttons.
Fixed two bugs while wiring this up:
- The filters popover was positioned absolute against .resources-content
(the whole scrollable card column) instead of the toolbar, so it
rendered far below the fold — moved it inside a small relatively
positioned wrapper around the Filters button.
- Go's html/template auto-escapes script tag bodies as a JS string
literal unless told otherwise, so the embedded JSON payload was
double-encoded (a JSON string containing JSON, not an object) —
piped through the safeJS template function to fix.
Scope note: the old 'Year' filter row (event_year taxonomy) isn't part
of the attached design and has been dropped from the UI; the taxonomy
and its term pages still exist, just with no link pointing at them
from the section page anymore.1 parent 4777f9d commit 13521a5
6 files changed
Lines changed: 981 additions & 177 deletions
File tree
- assets/scss
- layouts
- partials/resources
- resources
- static/js
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | | - | |
264 | | - | |
| 263 | + | |
| 264 | + | |
265 | 265 | | |
266 | | - | |
267 | | - | |
268 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
269 | 335 | | |
270 | 336 | | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
271 | 340 | | |
272 | 341 | | |
273 | 342 | | |
| |||
0 commit comments