Commit 99d95b2
[Repo Assist] Improve search UX: auto-focus, consistent close, Ctrl+K shortcut (#1084)
* Improve search UX: auto-focus, consistent close, Ctrl+K shortcut
- openSearch() focuses the search input immediately after showModal()
- closeSearch() resets the input value and clears results on every close path
(backdrop click, Escape, or future programmatic close), making behaviour
consistent regardless of how the dialog was dismissed
- Keyboard shortcut: Ctrl+K / Cmd+K (in addition to '/') now opens search,
matching the convention used by GitHub, MDN, and many modern doc sites
- The '/' shortcut is now suppressed when the user is typing in an INPUT or
TEXTAREA to avoid accidentally opening search mid-sentence
- Escape handling moved from keyup to keydown so ev.preventDefault() reliably
stops the browser's built-in dialog-close before our custom close logic runs
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* ci: trigger checks
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent a1df296 commit 99d95b2
2 files changed
Lines changed: 26 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
57 | 67 | | |
58 | 68 | | |
59 | 69 | | |
60 | | - | |
61 | | - | |
| 70 | + | |
62 | 71 | | |
63 | 72 | | |
64 | 73 | | |
| |||
112 | 121 | | |
113 | 122 | | |
114 | 123 | | |
115 | | - | |
| 124 | + | |
116 | 125 | | |
117 | | - | |
| 126 | + | |
| 127 | + | |
118 | 128 | | |
119 | 129 | | |
120 | | - | |
121 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
122 | 139 | | |
123 | 140 | | |
124 | 141 | | |
| |||
0 commit comments