Skip to content

refactor(app): decompose FilterBar into feature folder#8559

Merged
MarkusNeusinger merged 1 commit into
mainfrom
refactor/frontend-filterbar-split
Jun 10, 2026
Merged

refactor(app): decompose FilterBar into feature folder#8559
MarkusNeusinger merged 1 commit into
mainfrom
refactor/frontend-filterbar-split

Conversation

@MarkusNeusinger

Copy link
Copy Markdown
Owner

Summary

Part 8 of the frontend modernization roadmap. Pure decomposition of the 881-line FilterBar.tsx into sections/plots-gallery/FilterBar/ — no behavior change, import path stays src/sections/plots-gallery/FilterBar.

  • index.tsx (268): orchestrator — scroll/sticky + chip-menu state, composes sub-components
  • FilterSearch.tsx (357): search state, InputBase, fuse.js results, keyboard nav, search tracking; renders FilterMenu (they share dropdown state, so FilterMenu is composed here rather than in index)
  • FilterMenu.tsx (252): presentational dropdown (categories, values, exact/fuzzy split, no-results)
  • FilterChips.tsx (190): chips with roll animation + chip action menu (add-OR / remove / remove-all)
  • FilterSizeToggle.tsx (26): ToolbarActions wrapper
  • Existing FilterBar.test.tsx moved as index.test.tsx with assertions untouched; +4 new per-component test files

Tests: 552 → 578 (+26). All analytics events, aria attributes, and keyboard interactions preserved verbatim.

Verification

yarn lint ✓ · yarn fm:check ✓ · yarn type-check ✓ · yarn test 578/578 ✓ · yarn build

🤖 Generated with Claude Code

- Split the 843-LOC FilterBar.tsx into FilterBar/ with index.tsx
  (orchestrator: scroll/sticky + chip-menu state), FilterSearch.tsx
  (search state, fuse.js results, keyboard navigation, expand/collapse),
  FilterMenu.tsx (category dropdown rendering), FilterChips.tsx (chips
  with roll animation + chip action menu), and FilterSizeToggle.tsx
  (ToolbarActions wrapper)
- Pure decomposition: every sx block, trackEvent call (search,
  search_no_results, grid_resize), aria attribute, and keyboard handler
  copied verbatim; props between parent and children are explicit
  typed interfaces (DropdownItem and RandomAnimation now named types)
- Existing consumers unchanged: index.tsx re-exports FilterBar under
  the same 'src/sections/plots-gallery/FilterBar' path
- Moved FilterBar.test.tsx to FilterBar/index.test.tsx unchanged and
  added per-component tests (keyboard nav, chip menu, dropdown modes,
  size toggle passthrough): 552 -> 578 tests

Part 8 of the frontend modernization roadmap.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 10, 2026 00:54
@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.60606% with 38 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
app/src/sections/plots-gallery/FilterBar/index.tsx 61.66% 23 Missing ⚠️
.../sections/plots-gallery/FilterBar/FilterSearch.tsx 90.44% 13 Missing ⚠️
...rc/sections/plots-gallery/FilterBar/FilterMenu.tsx 95.12% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the Plots Gallery FilterBar by decomposing the former monolithic FilterBar.tsx into a dedicated feature folder (src/sections/plots-gallery/FilterBar/) while keeping the public import path (src/sections/plots-gallery/FilterBar) stable and aiming for no behavior changes.

Changes:

  • Replaced app/src/sections/plots-gallery/FilterBar.tsx with a folder-based module whose index.tsx orchestrates sticky/scroll behavior and composes the new subcomponents.
  • Split responsibilities into FilterSearch, FilterMenu, FilterChips, and FilterSizeToggle.
  • Moved/added tests to cover the decomposed components.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
app/src/sections/plots-gallery/FilterBar/index.tsx New FilterBar orchestrator (sticky + scroll progress + chip-menu state + composition).
app/src/sections/plots-gallery/FilterBar/index.test.tsx Moved/updated FilterBar tests for the folder-based module.
app/src/sections/plots-gallery/FilterBar/FilterSearch.tsx Extracted search input logic (query/category state, keyboard nav, analytics).
app/src/sections/plots-gallery/FilterBar/FilterSearch.test.tsx Added focused tests for search/dropdown keyboard and tracking behavior.
app/src/sections/plots-gallery/FilterBar/FilterMenu.tsx Extracted dropdown rendering (categories, values, exact/fuzzy sections, empty state).
app/src/sections/plots-gallery/FilterBar/FilterMenu.test.tsx Added tests for menu rendering/selection behaviors.
app/src/sections/plots-gallery/FilterBar/FilterChips.tsx Extracted chip rendering + chip action menu (OR add/remove/remove-all).
app/src/sections/plots-gallery/FilterBar/FilterChips.test.tsx Added tests for chip rendering and chip-menu actions.
app/src/sections/plots-gallery/FilterBar/FilterSizeToggle.tsx Wrapper around ToolbarActions for reuse in desktop/mobile placements.
app/src/sections/plots-gallery/FilterBar/FilterSizeToggle.test.tsx Added tests ensuring size changes and analytics wiring.
app/src/sections/plots-gallery/FilterBar.tsx Deleted the previous monolithic implementation.

@MarkusNeusinger MarkusNeusinger merged commit bbd7d2c into main Jun 10, 2026
10 checks passed
@MarkusNeusinger MarkusNeusinger deleted the refactor/frontend-filterbar-split branch June 10, 2026 01:20
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