Skip to content

ENG-1731: Add keyboard-only filtering with tag chips#1072

Open
trangdoan982 wants to merge 6 commits into
mainfrom
eng-1731-add-keyboard-only-filtering-with-tag-chips
Open

ENG-1731: Add keyboard-only filtering with tag chips#1072
trangdoan982 wants to merge 6 commits into
mainfrom
eng-1731-add-keyboard-only-filtering-with-tag-chips

Conversation

@trangdoan982
Copy link
Copy Markdown
Member

@trangdoan982 trangdoan982 commented May 23, 2026

https://www.loom.com/share/dd5b9491a87b436395a5fb2344b51c24

Summary

  • replace the advanced search text input with a keyboard-friendly chip input for node-type filters
  • add ghost completion + Tab commit behavior (prefix-only) and chip keyboard navigation/removal
  • keep chip state synchronized with the existing type filter dropdown and support chips-only result filtering

Test plan

  • Open advanced search in Roam and verify ghost completion appears for unique node-type prefix
  • Press Tab to commit a ghost completion into a chip and confirm search term clears
  • Verify Backspace/Arrow Left-Right chip navigation/removal behavior without mouse
  • Toggle filters via dropdown and confirm chips/results stay in sync

Made with Cursor

@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 23, 2026

ENG-1731

@supabase
Copy link
Copy Markdown

supabase Bot commented May 23, 2026

This pull request has been ignored for the connected project zytfjzqyijgagqxrzbmz because there are no changes detected in packages/database/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@trangdoan982 trangdoan982 requested a review from mdroidian May 24, 2026 03:26
@mdroidian
Copy link
Copy Markdown
Member

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 620c204db8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/roam/src/components/AdvancedNodeSearchDialog/AdvancedSearchDialog.tsx Outdated
Copy link
Copy Markdown
Member

@mdroidian mdroidian left a comment

Choose a reason for hiding this comment

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

A few things I noticed with this PR that I think we should address:

Input box alignment
It looks like this PR introduces a misalignment of the search box with the icons. I would consider this a regression that needs to be fixed:

Image

Not using Blueprint Tags
Did we try using Blueprint Tag, TagInput, or InputGroup for this? Were there some issues stopping us from using the components that Roam style guide recommends?

Tailwind
As discussed in our last meeting, we noting how Roam doesn't handle all of the tailwind class syntax: specifically arbitrary values. So let's do a quick run through to double check.

Comment thread apps/roam/src/components/AdvancedNodeSearchDialog/NodeTypeChipsSearchInput.tsx Outdated
Comment thread apps/roam/src/components/AdvancedNodeSearchDialog/NodeTypeChipsSearchInput.tsx Outdated
Comment thread apps/roam/src/components/AdvancedNodeSearchDialog/NodeTypeChipsSearchInput.tsx Outdated
Comment thread apps/roam/src/components/AdvancedNodeSearchDialog/NodeTypeChipsSearchInput.tsx Outdated
Comment thread apps/roam/src/components/AdvancedNodeSearchDialog/NodeTypeChipsSearchInput.tsx Outdated
Comment thread apps/roam/src/components/AdvancedNodeSearchDialog/NodeTypeChipsSearchInput.tsx Outdated
@trangdoan982
Copy link
Copy Markdown
Member Author

Addressed in 542ac30:

  • Search bar alignment: Header row uses items-center again (matching eng-1730); removed self-start wrappers on filter/sort/close controls.
  • Tailwind / Roam: Replaced arbitrary/! classes with inline styles (CHIP_LABEL_MAX_WIDTH, INPUT_MIN_WIDTH) and text-xs for the Tab hint.
  • useMemo: Removed; lookups are plain derived values / small helpers.
  • ArrowDown guard: onArrowDown / dialog onKeyDown no-op when results.length === 0, and index clamps with Math.max(index, 0).

Base automatically changed from eng-1730-add-filter-dropdown-menu to main May 28, 2026 18:03
@graphite-app
Copy link
Copy Markdown
Contributor

graphite-app Bot commented May 28, 2026

PR size/scope check

This PR is over our review-size guideline.

  • Recommended: ~200 lines changed
  • Acceptable limit: up to 400 lines when well-scoped/self-contained
  • Preferred file count: fewer than 5 files

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:

  • What single problem this PR solves
  • Why the files/changes are coupled

trangdoan982 and others added 4 commits May 28, 2026 14:26
Replace the advanced search input with a chip-based type filter input that supports ghost tab-completion and keyboard chip navigation while staying in sync with the dropdown filter state.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use Tag with getNodeTagStyles for filter chips while keeping a custom input for ghost Tab completion. Fix header alignment, Roam-safe styling, remove unnecessary memos, and guard ArrowDown when there are no results.

Co-authored-by: Cursor <cursoragent@cursor.com>
@trangdoan982 trangdoan982 force-pushed the eng-1731-add-keyboard-only-filtering-with-tag-chips branch from 6f8193b to afe9ade Compare May 28, 2026 18:27
@trangdoan982 trangdoan982 requested a review from mdroidian May 28, 2026 18:30
Comment thread apps/roam/src/components/AdvancedNodeSearchDialog/AdvancedSearchDialog.tsx Outdated
Comment thread apps/roam/src/components/AdvancedNodeSearchDialog/NodeTypeChipsSearchInput.tsx Outdated
Comment thread apps/roam/src/components/AdvancedNodeSearchDialog/NodeTypeChipsSearchInput.tsx Outdated
Comment thread apps/roam/src/components/AdvancedNodeSearchDialog/NodeTypeChipsSearchInput.tsx Outdated
…handler.

Use Tailwind flex-1 instead of inline flex styles, rely on Blueprint Tag active state for chip focus, document Tag vs TagInput choice, pass a single onSearchKeyDown prop, and restore fixed-height toolbar for filter controls.

Co-authored-by: Cursor <cursoragent@cursor.com>
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