Skip to content

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
element-hq:developfrom
hayaksi1:pr/search-cmdf-toast
Open

Show a one-time nudge towards in-room search when pressing Ctrl/Cmd+F on web#34006
hayaksi1 wants to merge 2 commits into
element-hq:developfrom
hayaksi1:pr/search-cmdf-toast

Conversation

@hayaksi1

Copy link
Copy Markdown

Stacked on #34005 (defaults the Ctrl/Cmd+F search shortcut on for desktop). Please review
that one first — the diff here includes it and will reduce once it merges. This PR adds only the
web-side discoverability nudge on top.

Problem

On web, the in-room search shortcut (ctrlFForSearch) is intentionally off by default so the
browser'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:

  • only triggers on web (desktop already defaults the shortcut on and has no browser find bar to
    preserve, so it returns early there);
  • shows at most once per browser — a new device-local ctrlFForSearchNudgeShown flag is set
    the first time, so it never nags again;
  • does not swallow the keypress — the browser find bar still opens as usual; the toast is purely
    additive.

Tests

  • New InRoomSearchNudgeToast-test.ts: shows once and not again, respects the already-enabled and
    desktop 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

@hayaksi1 hayaksi1 requested a review from a team as a code owner June 27, 2026 12:36
@hayaksi1 hayaksi1 requested review from MidhunSureshR and dbkr June 27, 2026 12:36
@github-actions github-actions Bot added the Z-Community-PR Issue is solved by a community member's PR label Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Z-Community-PR Issue is solved by a community member's PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant