Repository navigation
Commit d0e3c3e
committed
fix(commands): keep the palette path off a hidden sidebar provider
CodeRabbit filed src/activate/registerCommands.ts:167 (root comment 4503339692): the
sidebar plusButtonClicked evicts the registered provider's running task even when the
sidebar is hidden, because the commandPalette rows this branch added keep the command
reachable whenever a tab panel is not the active webview panel. Checked against the
tree rather than the finding text: src/package.json gains a menus.commandPalette
section (8 rows) in which zoo-code.plusButtonClicked sits under
"activeWebviewPanelId != zoo-code.TabPanelProvider"; with a text editor focused and the
sidebar collapsed that context key is unset, so the clause passes and the palette runs
the sidebar handler. The rows restrict an already-listed command rather than introduce
it - what changed is that these handlers dropped the guard upstream's copy had: at
merge-base a4f774b plusButtonClicked opened with getVisibleProviderOrLog and returned
when it found no visible instance (registerCommands.ts:90-104), so the same palette
invocation logged and did nothing instead of aborting a task behind an invisible view.
sidebarCommandTarget keeps the click-origin targeting while the registered provider's
own view is visible, which a view/title click always is, and otherwise falls back to
the visible instance - what these handlers did before the click-origin split: act on
whichever surface is on screen, and do nothing when none is. Applied to plusButtonClicked,
the destructive one, and to settingsButtonClicked, historyButtonClicked and
marketplaceButtonClicked, which only post, so the four stay consistent about where a
palette invocation lands. Telemetry still fires only once a target exists.
registerCommands.spec.ts: the registered provider double states the view/title
precondition (isViewVisible: true), and five cases pin the palette origin - plusButton
click targeting the visible provider instead of evicting behind the hidden sidebar,
plusButtonClicked doing nothing when no surface is visible (asserting the log line and
that no plus telemetry fired), and an it.each over the three post-only commands. With
the guard deleted the lane fails exactly those five and passes the other 62; with the
guard in place the lane is 67 tests green. tsc --noEmit 0 errors, eslint
--max-warnings=0 clean on both files, prettier --check clean, and
src/eslint-suppressions.json is untouched, so no count moves.
The pre-commit hook ran lint-staged on this commit (PATH prepended with
C:/Users/eason/AppData/Roaming/npm so the hook resolves pnpm 10.8.1 instead of falling
through to npx). No --no-verify was used.1 parent 9ab5356 commit d0e3c3e
2 files changed
Lines changed: 111 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
| |||
194 | 195 | | |
195 | 196 | | |
196 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
197 | 202 | | |
198 | 203 | | |
199 | 204 | | |
| |||
336 | 341 | | |
337 | 342 | | |
338 | 343 | | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
339 | 402 | | |
340 | 403 | | |
341 | 404 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
140 | 158 | | |
141 | 159 | | |
142 | 160 | | |
| |||
155 | 173 | | |
156 | 174 | | |
157 | 175 | | |
158 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
159 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
160 | 185 | | |
161 | 186 | | |
162 | | - | |
163 | | - | |
164 | | - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
165 | 190 | | |
166 | 191 | | |
167 | | - | |
| 192 | + | |
168 | 193 | | |
169 | 194 | | |
170 | 195 | | |
| |||
187 | 212 | | |
188 | 213 | | |
189 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
190 | 220 | | |
191 | 221 | | |
192 | 222 | | |
193 | | - | |
| 223 | + | |
194 | 224 | | |
195 | 225 | | |
196 | 226 | | |
| |||
208 | 238 | | |
209 | 239 | | |
210 | 240 | | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
211 | 246 | | |
212 | 247 | | |
213 | | - | |
| 248 | + | |
214 | 249 | | |
215 | 250 | | |
216 | 251 | | |
| |||
223 | 258 | | |
224 | 259 | | |
225 | 260 | | |
226 | | - | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
227 | 267 | | |
228 | 268 | | |
229 | 269 | | |
| |||
0 commit comments