Skip to content

feat(suggestion-menu): add a noResults option - #535

Merged
kianbazza merged 1 commit into
ui-563-anchor-the-suggestion-menu-to-the-hosts-textfrom
ui-564-add-a-no-results-option-to-the-suggestion-menu
Sep 29, 2026
Merged

kianbazza merged 1 commit into
ui-563-anchor-the-suggestion-menu-to-the-hosts-textfrom
ui-564-add-a-no-results-option-to-the-suggestion-menu

Conversation

@kianbazza

@kianbazza kianbazza commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds noResults to SuggestionMenu.Root.

  • 'empty' (the default): the menu stays open and shows Empty, and Enter reaches the host.
  • 'close': the menu closes once every search for the query has finished empty (reason 'no-results'). It closes before the empty popup is painted.
    • An update() with the same query leaves it closed, for example when only the caret moved.
    • Any other query searches again, including Backspace, typing more, or a longer query after an empty one.
    • A controlled query that renders after the update() still reopens the menu.

SuggestionMenu.useAsyncMenuCoordinator is available for a "searching…" indicator while results refetch.

Evidence

suggestion-menu.no-results.test.tsx (14 tests):

  • The close happens with microtasks only, before any timer or frame.
  • The menu waits for loaders before deciding.
  • A same-query update stays closed.
  • An empty query that settled empty doesn't block a longer one.
  • Controlled queries reopen whether they render with the update or after it.
  • close() and changing the host forget the empty query.

Checked in Chromium with ProseMirror: /qz closes with no-results, and Backspace to /q reopens with "Quote".

Merge Danger

Door: two-way

Blast Radius: SuggestionMenu, plus a new shared 'no-results' reason

Closes UI-564

@kianbazza
kianbazza added this pull request to stack #526 September 29, 2026 01:44
@vercel

vercel Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ui-canary Ready Ready Preview Sep 29, 2026 2:31pm UTC

Request Review

@linear-code

linear-code Bot commented Sep 29, 2026

Copy link
Copy Markdown

UI-564

@kianbazza
kianbazza force-pushed the ui-564-add-a-no-results-option-to-the-suggestion-menu branch from 6c48291 to d557c1d Compare September 29, 2026 14:29
@kianbazza
kianbazza marked this pull request as ready for review September 29, 2026 14:45
@kianbazza
kianbazza merged commit 74af92f into canary Sep 29, 2026
5 checks passed

This branch was successfully deployed

1 active deployment
Preview – ui-canary — d557c1d2 Deployed Sep 29, 2026 by vercel[bot]
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.

1 participant