Commit 4f63a70
authored
fix: Prevent permission request from stealing focus across cells (#1545)
## Problem
ActionSelector unconditionally auto-focuses on mount, stealing focus from the active cell's editor when a permission request arrives in another command center cell.
Closes #1503
## Changes
1. Add isUserInInteractiveElement() guard to skip auto-focus when user is in an input/editor
2. Add autoFocus option to restoreStepAnswer to conditionally skip its focus call on mount
3. Guard both mount-time focus paths so only idle panels auto-focus
## How did you test this?
Manually1 parent aee3c91 commit 4f63a70
2 files changed
Lines changed: 38 additions & 4 deletions
File tree
- apps/code/src/renderer
- components/action-selector
- features/command-center/components
Lines changed: 37 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
15 | 39 | | |
16 | 40 | | |
17 | 41 | | |
| |||
51 | 75 | | |
52 | 76 | | |
53 | 77 | | |
| 78 | + | |
54 | 79 | | |
55 | 80 | | |
56 | 81 | | |
| |||
76 | 101 | | |
77 | 102 | | |
78 | 103 | | |
79 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
80 | 107 | | |
81 | 108 | | |
82 | 109 | | |
| |||
107 | 134 | | |
108 | 135 | | |
109 | 136 | | |
110 | | - | |
| 137 | + | |
111 | 138 | | |
112 | 139 | | |
113 | 140 | | |
| |||
121 | 148 | | |
122 | 149 | | |
123 | 150 | | |
124 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
125 | 154 | | |
126 | 155 | | |
127 | 156 | | |
128 | 157 | | |
129 | 158 | | |
130 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
131 | 164 | | |
132 | 165 | | |
133 | 166 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| |||
0 commit comments