feat(web): adopt vite 8.1 / sveltekit 2.70 + fix pane pop focus regression#1001
Merged
Conversation
…ocus Completes the deferred upgrade from BUG-2278. The advisory-fix PR #997 had dragged this toolchain in via `npm audit fix`; #999 reverted it because it regressed the pane-focus E2E suite. Root-caused (see BUG-2278 residual): the trigger is @sveltejs/kit 2.66.0 (PR #15452), which blurs the active element to <body> BEFORE the component update during navigation. On the pane's popstate pop path (handlePaneBack -> history.go(-1), which can't carry keepFocus), that early blur (focusout only, no focusin) makes Kit's end-of-nav reset_focus() body.focus() a no-op emitting no focusin — starving PaneHost's focusin-only backstop, so focus strands on <body>. (Drill path uses goto({keepFocus:true}) and is unaffected — which is why only the 5 pop/ESC focus tests failed. vite/rolldown/svelte are not implicated.) Fix: re-assert focusPaneRegion() after the popstate settles (next frame, so it runs after Kit's microtask-scheduled reset_focus), removing the dependency on an incidental focusin(body). ~12 lines in paneHostController.ts; no-op when the pane closed or focus already landed in-pane. Toolchain: vite 8.0.11->8.1.5, @sveltejs/kit 2.59.1->2.70.1, rolldown rc.18->1.1.5 (lockfile only; package.json caret ranges + advisory overrides unchanged). Advisory deps stay at their patched versions (audit 0 prod vulns). Verified on the bumped toolchain: the 5 previously-failing pane-focus tests pass, full pane e2e 41 passed (the one flaky test, :160, is a PRE-EXISTING flake on main that flakes on the reverted toolchain too and passes on retry), web check (0 errors), test (464), build, tiptap-pins, npm ci all green. Claude-Session: https://claude.ai/code/session_01EZ6yr6pAUFb1uffan912ra
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Completes the deferred toolchain upgrade from BUG-2278. PR #997's
npm audit fixhad dragged this toolchain in as caret collateral; #999 reverted it because it regressed the pane-focus E2E suite. This lands the upgrade with the root-cause fix so the toolchain and the fix ship together.Root cause (confirmed: repro + parallel analysis + adversarial verify)
The trigger is
@sveltejs/kit2.66.0 (PR #15452), not vite/rolldown/svelte. Kit 2.66 blurs the active element to<body>before the component update during navigation. On the pane's popstate pop path (handlePaneBack→history.go(-1), which can't carrykeepFocus), that early blur fires onlyfocusout(nofocusin), so Kit's end-of-navreset_focus()body.focus()becomes a no-op that emits nofocusin— starvingPaneHost's focusin-only backstop, which pre-2.66 piggybacked on that incidentalfocusin(body)to pull focus back into the pane. Focus strands on<body>. The drill path usesgoto({keepFocus:true})and is unaffected — which is exactly why only the 5 pop/ESC focus tests failed.Fix
Re-assert
focusPaneRegion()after the popstate settles (next frame, so it runs after Kit's microtask-scheduledreset_focus), removing the dependency on an incidentalfocusin(body). ~12 lines inpaneHostController.ts; no-op when the pane closed or focus already landed in-pane.Toolchain
vite8.0.11→8.1.5,@sveltejs/kit2.59.1→2.70.1,rolldownrc.18→1.1.5 — lockfile only;package.jsoncaret ranges + advisoryoverridesunchanged. Advisory deps stay patched (npm audit --omit=dev= 0 vulns).Verification
:998).:160) is a pre-existing flake onmain— it flakes on the reverted toolchain too and passes on retry; not introduced here.npm ci(in sync),check:tiptap-pins,npm audit --omit=dev(0 prod vulns),build,check(0 errors),test(464) — all green.reset_focusinternals).Closes BUG-2278.
https://claude.ai/code/session_01EZ6yr6pAUFb1uffan912ra