ENG-1730: Add node type filter dropdown to advanced node search#1054
ENG-1730: Add node type filter dropdown to advanced node search#1054trangdoan982 wants to merge 8 commits into
Conversation
PR size/scope checkThis PR is over our review-size guideline.
Please split this into smaller PRs unless there is a clear reason the changes need to land together. If keeping it as one PR, please add a brief justification covering:
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
a029682 to
dbbd6d2
Compare
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
88d19e0 to
ae0cea7
Compare
45ac2a1 to
67a2895
Compare
Fix indeterminate checkbox sizing, use Blueprint controls, improve Escape handling when the filter popover is open, disable the trigger while types load, colocate click-outside handling, and add unit tests for filter state helpers. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
67a2895 to
deb8ae8
Compare
| onSelectOnly: () => void; | ||
| onToggle: () => void; | ||
| }): React.ReactElement => ( | ||
| <div className="group flex items-center gap-2 px-3 py-1.5 hover:bg-gray-900/[0.04]"> |
There was a problem hiding this comment.
I'd double check hover:bg-gray-900/[0.04], I'm not sure these type of dynamic classes are supported in Roam
| onChange={onToggle} | ||
| /> | ||
| <Button | ||
| className="!px-2 !py-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100" |
There was a problem hiding this comment.
I don't believe ! is supported in Roam
| [onSelectedIdsChange, selectedIdSet, selectedIds], | ||
| ); | ||
|
|
||
| const handleOnly = useCallback( |
There was a problem hiding this comment.
Why does this need useCallback? Actually why does this need a separate function at all?
| } | ||
| > | ||
| {activeFilterCount > 0 && ( | ||
| <span |
There was a problem hiding this comment.
nit: use something like the filter-keep icon so that the icon itself doesn't move and cause jank when filter is on/off
| @@ -0,0 +1,61 @@ | |||
| import { type DiscourseNode } from "~/utils/getDiscourseNodes"; | |||
|
|
|||
| /** Advanced search: empty `selectedTypeIds` means all types; partial list is an active filter. */ | |||
There was a problem hiding this comment.
This is a bit ambiguous because “empty” can read like an action rather than a state.
Maybe something like
/* Advanced search: when selectedTypeIds has no values, show all node types; otherwise, filter to the selected types. */
https://www.loom.com/share/0f58be24091140faac67a1b74bc3ee06
Summary
typeFilterso keyword results respect the selected discourse node types; empty selection means all types (no filter).discourseNodeTypeFilter) anduseCloseOnClickOutsidefor reliable close behavior inside the dialog.Test plan
Made with Cursor