Show a one-time nudge towards in-room search when pressing Ctrl/Cmd+F on web#34006
Open
hayaksi1 wants to merge 2 commits into
Open
Show a one-time nudge towards in-room search when pressing Ctrl/Cmd+F on web#34006hayaksi1 wants to merge 2 commits into
hayaksi1 wants to merge 2 commits into
Conversation
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.
Problem
On web, the in-room search shortcut (
ctrlFForSearch) is intentionally off by default so thebrowser's native Ctrl/Cmd+F find bar keeps working (see #34005 / #24359). The cost is
discoverability: a user who would prefer the shortcut to search the conversation has no idea the
option exists — pressing Ctrl/Cmd+F just opens the browser find bar forever.
Fix
The first time a web user presses Ctrl/Cmd+F while the shortcut is still off, show a one-time
toast explaining that Element can make that shortcut search the room, with an action to enable it.
It:
preserve, so it returns early there);
ctrlFForSearchNudgeShownflag is setthe first time, so it never nags again;
additive.
Tests
InRoomSearchNudgeToast-test.ts: shows once and not again, respects the already-enabled anddesktop cases, and the enable action flips
ctrlFForSearch.LoggedInView-test.tsx: the keydown handler invokes the nudge only in the eligible web case.Relates to #22888
Relates to #24359
Checklist
public/exportedsymbols have accurate TSDoc documentation.