diff --git a/apps/web/app/components/FilterRail.tsx b/apps/web/app/components/FilterRail.tsx index 0c7ad7dea..30484fcae 100644 --- a/apps/web/app/components/FilterRail.tsx +++ b/apps/web/app/components/FilterRail.tsx @@ -1,7 +1,12 @@ -import type { ChangeEvent, FormEvent } from 'react'; -import { Form, Link, useNavigate, useSearchParams } from 'react-router'; +import { useEffect, useRef, useState, type ChangeEvent, type FormEvent } from 'react'; +import { Form, Link, useNavigation, useSearchParams } from 'react-router'; import { count as fmtCount } from '@sigma/shared'; -import { withParams } from '../lib/filters'; +import { + categorySelectionState, + filterFormKey, + preservedParamInputs, + shouldPruneField, +} from './filterRail.logic'; export interface FilterOption { value: string; @@ -27,10 +32,14 @@ export interface FilterGroup { more?: { href: string; label: string }; } -// Sticky filter rail. Filters live in the URL (shareable). A `