Skip to content

[do not merge] Search UX v2 #4: Search page & AddFilterModal#664

Draft
hoyla wants to merge 2 commits intoljh-searchux-v2-pr3-active-filter-chipsfrom
ljh-searchux-v2-pr4-search-page-modal
Draft

[do not merge] Search UX v2 #4: Search page & AddFilterModal#664
hoyla wants to merge 2 commits intoljh-searchux-v2-pr3-active-filter-chipsfrom
ljh-searchux-v2-pr4-search-page-modal

Conversation

@hoyla
Copy link
Copy Markdown
Contributor

@hoyla hoyla commented Apr 3, 2026

Note

THIS IS A PLACEHOLDER PR SO I CAN REMEMBER WHAT WAS DONE IN THIS BRANCH.
It'll probably get rewritten entirely should we actually get here.

Context

Part of the Search UX Improvements epic.

Important

This is the fourth of five PRs in the Search UX Improvements epic.

PR1 Chip parsing infrastructure
 └─ PR2 Shared utilities & Downshift dependency
     └─ PR3 Active filter chips & multi-select
         └─ PR4 Search page & AddFilterModal  ← you are here
             └─ PR5 Sidebar tri-state filters

Changes to the user experience

This is the PR where the chip-based filter system becomes visible to users.

Active filter chips

Users now see interactive filter chips below the search box. Active filters display as coloured pills with negate/remove controls. Dormant default chips (Dataset, Workspace, Date Range, File Type) appear as placeholders when inactive. Clicking a dormant chip activates it.

Add Filter modal

A "More filters" button opens a modal listing all available filter types from the backend suggestedFields plus built-ins (File Type, Date Range). Related filters are consolidated — Created After and Created Before are merged into a single Date Range entry.

Bug fix

"Search this workspace" and "Search in folder" now embed workspace/folder as chips in the q parameter rather than using filters. This ensures the search page, sidebar, and chips all reflect the workspace on arrival.

What's included

  • Search.tsx — full TypeScript conversion of Search.js; integrates chip parsing, filter bar, and add-filter modal into the search page. triggerSearch extracts workspace and dataset filters from chips in q.
  • SearchBox.tsx — full TypeScript conversion of SearchBox.js; renders the search input with ActiveFiltersBar and AddFilterModal beneath it.
  • AddFilterModal (AddFilterModal.tsx) — modal dialog listing available filter types, resolving filter metadata (kind, chipType) and consolidating hidden filters.
  • Workspace search entry pointsWorkspaceSummary.tsx and Workspaces.tsx updated to use buildWorkspaceSearchQ and buildWorkspaceFolderSearchQ.
  • SCSS (_add-filter-modal.scss, _search.scss) — modal and search page styling.

TypeScript

Search.js and SearchBox.js converted to TypeScript with full type annotations.

Automated tests

No new test files in this PR.

Manual tests

Tested locally. Tested on playground.

@hoyla hoyla added feature Departmental tracking: work on a new feature ⚠️ do not merge labels Apr 3, 2026
@hoyla hoyla changed the title Search UX v2 #4: Search page & AddFilterModal [do not merge] Search UX v2 #4: Search page & AddFilterModal Apr 4, 2026
@hoyla hoyla force-pushed the ljh-searchux-v2-pr3-active-filter-chips branch from e16147c to 0a8ff34 Compare April 9, 2026 09:50
hoyla added 2 commits April 9, 2026 10:51
Convert Search.js to Search.tsx as a functional component using
hooks (useState, useEffect, useRef, useCallback). Replace
UNSAFE_componentWillReceiveProps with a useEffect that tracks
previous urlParams via useRef. Replace react-select v1 Sort/PageSize
dropdowns with plain <select> elements, removing one dependency on
the outdated react-select 1.x API.

Convert SearchBox.js to SearchBox.tsx as a functional component
using forwardRef + useImperativeHandle to preserve the imperative
focus()/select() methods that Search calls via ref. Replace the
InputSupper-based chip input with a plain <textarea> for text
entry, delegating filter management to the ActiveFiltersBar and
AddFilterModal components.

Add AddFilterModal.tsx — a functional component that composes the
existing Modal.js shell. Provides a form for selecting a filter
type, choosing include/exclude polarity, and entering a value
(text, date, date range, or multi-select checkboxes). Uses
Modal.js for overlay, backdrop dismiss, and ESC key handling
instead of reimplementing that behaviour.

Add search-layout CSS for sticky header + scrollable results area.
Add textarea styling for the new plain-text search input.
Add _add-filter-modal.scss for the modal form styling.
Replace react-select dropdown styling with native <select> styling.
'Search this workspace' and 'Search in folder' were passing workspace
via filters, which gets discarded by triggerSearch in favour of
chip-derived values from q. Use buildWorkspaceSearchQ and
buildWorkspaceFolderSearchQ to embed chips in q instead, so the
search page, sidebar, and chips all reflect the workspace on arrival.
@hoyla hoyla force-pushed the ljh-searchux-v2-pr4-search-page-modal branch from f599bc6 to 175c82a Compare April 9, 2026 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚠️ do not merge feature Departmental tracking: work on a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant