Repository navigation
fix(launcher): prevent crash when exiting AI context view with active accessory - #1046
Conversation
… accessory
Guard the `options` and `value` prop getters on `SearchBarAccessoryDropdown`
in `SearchHeader.svelte` against `accessory` becoming `null` mid-flush.
When leaving the AI chat view (entered via Tab context mode) with Backspace
or Escape, `activeContext` and `activeView` are cleared in the same
synchronous tick. Because `SearchHeader` precedes `ExtensionViewContainer`
in the component tree, switching from `.context-search-row` to
`.search-input-row` mounts the `{:else}` branch's `SearchBarAccessoryDropdown`
before `ExtensionViewContainer`'s unmount cleanup clears
`searchBarAccessoryService.active`, causing the dropdown's queued `$effect`
to dereference `null.options` and trip the root `<svelte:boundary>`.
|
No actionable comments were generated in the recent review. WalkthroughThe search header now uses empty dropdown values when accessory data is nullish. A regression test covers context deactivation and navigation in one Svelte flush, and verifies that the accessory row is removed while the standard search-input row remains. ChangesSearch accessory teardown
Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk:
|
Guard the
optionsandvalueprop getters onSearchBarAccessoryDropdownin
SearchHeader.svelteagainstaccessorybecomingnullmid-flush.When leaving the AI chat view (entered via Tab context mode) with Backspace
or Escape,
activeContextandactiveVieware cleared in the samesynchronous tick. Because
SearchHeaderprecedesExtensionViewContainerin the component tree, switching from
.context-search-rowto.search-input-rowmounts the{:else}branch'sSearchBarAccessoryDropdownbefore
ExtensionViewContainer's unmount cleanup clearssearchBarAccessoryService.active, causing the dropdown's queued$effectto dereference
null.optionsand trip the root<svelte:boundary>.What changed
Affected areas
asyar-sdk, extension runtime, IPC contracts, manifest)Manual smoke test & Validation
pnpm dev) and visually verified the fix/feature works.AI usage
asyar-contributionskill (.agents/skills/asyar-contribution/SKILL.md), followed it, and reviewed every generated line.Boundaries
pnpm check:ci(or the relevant inner-loop checks) passes locally.Summary by CodeRabbit