Say when a spotlight search found nothing instead of selecting a filter - #34641
Merged
Conversation
|
Please provide screenshots |
Member
|
@hayaksi1 you have a failing screenshot test |
Contributor
Author
Do you want ss test files? |
Member
Spotlight had no empty state, so a query matching nothing left the filter shortcuts as the only options in the dialog. The first option is selected by default, so pressing enter after typing switched the dialog into the public spaces filter. Leaving that filter needs backspace on an empty query, which is not discoverable, so a mistyped search quietly changed what was being searched. A no-results entry now sits above the shortcuts when a query returns nothing. It takes the default selection, so enter does nothing rather than choosing a filter, and it says why the list is empty. The shortcuts are still one arrow key away. The room directory screenshot covers a search that matches nothing, so it now shows the new row and its baseline is regenerated. The one-result baseline in the same spec is deliberately untouched: a search that does find something never renders the row, and leaving that image alone keeps the diff honest about which state actually changed. Tests: a query matching nothing followed by enter leaves no filter applied.
hayaksi1
force-pushed
the
pr/spotlight-no-results
branch
from
August 12, 2026 13:35
4a35ed5 to
7cc0627
Compare
Contributor
Author
|
@t3chguy Done. |
Member
I asked you not to force push in another PR already. Please read the contributing guide again. |
Contributor
Author
|
@t3chguy Sorry for the mistake, will try to follow the rule. |
The no results entry is an Option like every other row, and Option always drew the ↵ hint into its end adornment, so a tile that exists purely to be inert still advertised a keyboard shortcut. Its onClick is null precisely so that enter stops dropping the user into a filter, which left the hint promising something that could not happen. Option now draws the hint only when it was given an onClick. The stylesheet already takes this line for the other case where enter would not fire — it hides the prompt whenever focus leaves the search box, "as in this state pressing enter would not actuate that option" — so this extends a rule the component already had rather than inventing one, and any later option that is only there to be read gets it right without thinking about it. Tests: the no results entry is asserted to render without the prompt while the start chat shortcut beside it keeps one; it fails without the change. The room directory linux screenshot is regenerated, and the one result shot next to it came back byte-identical, which is what shows the render matches CI rather than quietly baking in a local one.
t3chguy
reviewed
Aug 26, 2026
The "No results found" entry has to be a listbox option so that it, rather than one of the "other searches" shortcuts below it, takes the default selection the roving tabindex hands to the first item that mounts. That is the whole point of the entry: it gives the initial selection somewhere harmless to land instead of dropping the user into a filter they never asked for. Routing it through AccessibleButton to get there was wrong, though. That gave a row nobody can activate the click and Enter/Space handlers of a button, plus the pointer cursor that comes with mx_AccessibleButton, so it advertised an interaction it does not have. Options without an onClick now render as a bare li carrying role="option" and aria-disabled, which is the standard way to express an entry that is present and announced but not selectable. Screen readers following aria-activedescendant land on it and hear that there is nothing to pick, and the shortcuts stay one arrow key away.
hayaksi1
force-pushed
the
pr/spotlight-no-results
branch
from
August 26, 2026 13:02
3b3953c to
9683922
Compare
Member
@hayaksi1 I have asked you on multiple occasions to not force push, as per our contributing guide. |
t3chguy
approved these changes
Aug 26, 2026
Contributor
Author
|
@t3chguy That last update only changed the latest commit ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.





Spotlight had no empty state, so a query matching nothing left the filter shortcuts underneath as
the only options in the dialog. The first option is selected by default, which made that the public
spaces shortcut, and pressing enter — the natural thing to do after typing — switched the dialog
into that filter. Getting back out needs backspace on an empty query, which is not discoverable, so
a mistyped search silently changed what was being searched.
The dialog now shows a no-results entry above the shortcuts when a query returns nothing. It takes
the default selection, so enter does nothing instead of choosing a filter, and it says why the list
is empty. The shortcuts are unchanged and still one arrow key away.
Worth flagging for review: under the people and public room filters the entry can show for a frame
while a server search is still in flight. Enter does nothing during that frame rather than creating
a room, which seems the safer of the two, but a loading guard is easy to add if you would rather it
did not appear at all.
Tests: a case in
SpotlightDialog-test.tsxtyping a query which matches nothing and pressing enter,asserting no filter chip appears; it fails without the change.
Fixes #23726
Checklist
public/exportedsymbols have accurate TSDoc documentation.