Skip to content

Commit 88690dc

Browse files
committed
fix(deeplink): event-path delivery also clears pendingFocusProvider stash
`dispatchFocusConnector` writes the stash before firing the event so the drain-on-mount path covers a SettingsView that hadn't mounted yet. But when SettingsView IS mounted, the event handler ran without clearing the stash — the next mount (tab navigation back to Settings) then re-drained it and fired a spurious scroll/flash on the previously focused panel (Greptile P1 follow-up after the timing-race fix). Clear the stash inside the event handler too, so whichever delivery path lands first consumes it.
1 parent e89aa01 commit 88690dc

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

packages/app-core/src/components/pages/SettingsView.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,13 @@ export function SettingsView({
767767

768768
function handle(event: Event) {
769769
const detail = (event as CustomEvent<SettingsFocusConnectorDetail>).detail;
770-
if (detail?.provider) focusProvider(detail.provider);
770+
if (!detail?.provider) return;
771+
// Consume the stash here too — the dispatcher always writes it before
772+
// firing the event, but if we're already mounted the event path wins
773+
// and the stash would otherwise persist and re-fire on the next mount
774+
// (e.g. tab navigation) as a spurious scroll/flash.
775+
consumePendingFocusProvider();
776+
focusProvider(detail.provider);
771777
}
772778

773779
// Drain any pending provider stashed before this mount.

0 commit comments

Comments
 (0)