feat(core): support draft filter (#12400)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Added support for draft mode and completion callbacks across filter components, enabling stepwise filter creation and editing.
  - Enhanced filter menus and editors with external control via refs and new callback props for open/close state management.
  - Introduced new filter option group component for multi-step filter interactions.
  - Expanded tag filter methods for more granular filtering options.
  - Enabled controlled open state and close event handling for desktop and mobile menus.
  - Added programmatic control and completion callbacks to member selector and tags inline editors.

- **Improvements**
  - Updated filter and tag editors with improved UI layouts and added "Done" buttons for easier completion.
  - Improved menu and editor accessibility by allowing programmatic open/close and completion event handling.
  - Refactored date filter components for modularity and consistent draft handling.
  - Separated draft filter state management in filter UI for clearer user interactions.

- **Bug Fixes**
  - Refined date filter logic for more accurate "after" and "before" comparisons.

- **Style**
  - Adjusted styles for draft filters and editor layouts to enhance visual clarity and user experience.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
EYHN
2025-05-21 04:49:44 +00:00
parent 41ec438df8
commit 8f352580a7
28 changed files with 778 additions and 154 deletions

View File

@@ -92,6 +92,8 @@ export const AllPage = () => {
);
const [tempFilters, setTempFilters] = useState<FilterParams[] | null>(null);
const [tempFiltersInitial, setTempFiltersInitial] =
useState<FilterParams | null>(null);
const [explorerContextValue] = useState(() =>
createDocExplorerContext(initialState)
@@ -281,7 +283,8 @@ export const AllPage = () => {
const handleNewTempFilter = useCallback((params: FilterParams) => {
setSelectedCollectionId(null);
setTempFilters([params]);
setTempFilters([]);
setTempFiltersInitial(params);
}, []);
const handleDisplayPreferenceChange = useCallback(
@@ -320,6 +323,7 @@ export const AllPage = () => {
className={styles.filters}
filters={tempFilters}
onChange={handleFilterChange}
defaultDraftFilter={tempFiltersInitial}
/>
<Button
variant="plain"