Skip to content

Story 2137: Post Filter and Library Filter Components#2260

Merged
julhoang merged 10 commits intodevelopfrom
jh/filter-component
Apr 3, 2026
Merged

Story 2137: Post Filter and Library Filter Components#2260
julhoang merged 10 commits intodevelopfrom
jh/filter-component

Conversation

@julhoang
Copy link
Copy Markdown
Collaborator

@julhoang julhoang commented Mar 31, 2026

Issue: #2137

Summary

Add 2 new filter components and a searchable multi-select field for the V3 redesign:

  1. Post Filter (toggleable pill group)
  1. Library Filter (horizontal dropdown row on desktop, fullscreen modal on mobile).
  1. Combo Multi-Select (searchable dropdown with multi-selection)
  • Merges the combo's type-to-filter search with the multiselect's checkbox toggling and array-based selection (We don't have a Figma design for this)

Changes

  • Add _post_filter.html template and post-filter.css – checkbox-backed filter pill group with hover, selected, and focus-visible states
  • Add _library_filter.html template and library-filter.css – row of filter dropdowns (View, Grading, C++ Version, Category, Sort) that collapses into a CSS-only fullscreen modal on mobile via hidden checkbox toggle.
  • Add _field_combo_multi.html template – searchable multi-select field combining combo search/filter with multiselect checkboxes, multiple hidden inputs for form submission, and <select multiple> in no-JS fallback
  • Add expand icon to icon.html for the mobile filter trigger
  • Refactor dialog.js to support both hash-based and checkbox-based dialog types:
    • _dialog.html – hash-based modals (unchanged behavior)
    • _library_filter.html – checkbox-based modal with focus trap, ESC close, Enter key on labels, and focus restoration
  • Improve forms.css dropdown and combo accessibility styling (i.e. focus-visible outline)
  • Add demo data and example sections for all components in V3ComponentDemoView

‼️ Risks & Considerations ‼️

  • The library filter modal uses a checkbox toggle instead of the hash-based approach used by _dialog.html. This is intentional – the filter panel is transient UI that should not be deep-linkable or add entries to browser history. A URL hash like _dialog.html would let users navigate to an open filter state directly, which doesn't make as much sense for this component.
  • dialog.js was refactored to detect and enhance both dialog types (hash-based and checkbox-based) with shared focus-trap and ESC-close behavior, while keeping their open/close mechanisms distinct.

Screenshots

Post Filter

Light Mode Dark Mode
Screenshot 2026-03-31 at 11 27 43 AM Screenshot 2026-03-31 at 11 27 52 AM

Library Filter

Light Mode Dark Mode
Screenshot 2026-04-02 at 9 40 31 AM Screenshot 2026-04-02 at 9 41 04 AM Screenshot 2026-04-02 at 9 40 39 AM Screenshot 2026-04-02 at 9 41 16 AM

No-JS Fallback

Desktop Mobile
Screenshot 2026-04-02 at 9 41 45 AM Screenshot 2026-04-02 at 9 42 07 AM

Self-review Checklist

  • Tag at least one team member from each team to review this PR
  • Link this PR to the related GitHub Project ticket

Frontend

  • UI implementation matches Figma design
  • Tested in light and dark mode
  • Responsive / mobile verified
  • Accessibility checked (keyboard navigation, etc.)
  • Ensure design tokens are used for colors, spacing, typography, etc. – No hardcoded values
  • Test without JavaScript (if applicable)
  • No console errors or warnings

@julhoang julhoang linked an issue Mar 31, 2026 that may be closed by this pull request
@julhoang julhoang force-pushed the jh/filter-component branch from 0164d6b to e82eaae Compare March 31, 2026 18:26
@julhoang julhoang changed the title Jh/filter component Story 2137: Post Filter and Library Filter Components Mar 31, 2026
@julhoang julhoang marked this pull request as ready for review March 31, 2026 18:53
@julhoang julhoang marked this pull request as draft March 31, 2026 19:20
@julhoang julhoang marked this pull request as ready for review March 31, 2026 19:34
Copy link
Copy Markdown
Collaborator

@herzog0 herzog0 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for all the improvements!

Copy link
Copy Markdown
Collaborator

@julioest julioest left a comment

Choose a reason for hiding this comment

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

Just one suggestion

Other than that, great stuff! ✅

Copy link
Copy Markdown
Collaborator

@jlchilders11 jlchilders11 left a comment

Choose a reason for hiding this comment

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

LGTM!

@julhoang julhoang added the QA Ready For QA label Apr 1, 2026
@julhoang
Copy link
Copy Markdown
Collaborator Author

julhoang commented Apr 2, 2026

Hey @herzog0 , @jlchilders11 , @julioest ! Can I get another round review from you? I added a new _field_combo_multi.html and used it for Category dropdown – thanks!

@julhoang julhoang added Needs Review and removed QA Ready For QA labels Apr 2, 2026
Copy link
Copy Markdown
Collaborator

@julioest julioest left a comment

Choose a reason for hiding this comment

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

Looks great, nice job on this one Julia - approved :shipit:

@julhoang julhoang added QA Ready For QA and removed Needs Review labels Apr 2, 2026
Copy link
Copy Markdown
Collaborator

@jlchilders11 jlchilders11 left a comment

Choose a reason for hiding this comment

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

Approved as is, one thought/question about z-index.

display: none;
position: fixed;
inset: 0;
z-index: 10000;
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.

Quick thought: Should z-index be a var to prevent unintended collisions?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Great call out @jlchilders11 ! You're right we definitely need a more robust way to manage z-index across the app. Are you okay with me spinning off a separate PR to evaluate all components' z-index set up?

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.

Sounds good to me! Raw numbers for z-index give me itchy foot gun trigger reactions, lol

@julhoang julhoang merged commit c71187c into develop Apr 3, 2026
4 checks passed
@julhoang julhoang deleted the jh/filter-component branch April 3, 2026 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

QA Ready For QA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Filter Component

4 participants