[fragment-scroll] Rename ScrollAndMaybeFocusHandler to ScrollHandler - #96828
Open
eps1lon wants to merge 1 commit into
Open
[fragment-scroll] Rename ScrollAndMaybeFocusHandler to ScrollHandler#96828eps1lon wants to merge 1 commit into
ScrollAndMaybeFocusHandler to ScrollHandler#96828eps1lon wants to merge 1 commit into
Conversation
The handler in `layout-router.tsx` no longer touches focus or blur. Focusing the first host descendant was removed in #89903 and blurring on navigation was removed in #96113, so the "MaybeFocus" part of the name has described nothing for a while. This change renames `ScrollAndMaybeFocusHandler` to `ScrollHandler`, `InnerScrollAndMaybeFocusHandler` to `InnerScrollHandler`, and `ScrollAndMaybeFocusHandlerProps` to `ScrollHandlerProps`. The ref the handler reads is renamed along with it. The `FocusAndScrollRef` type becomes `ScrollHandlerRef`, and the `focusAndScrollRef` field becomes `scrollRef` on `AppRouterState`, on `GlobalLayoutRouterContext`, and on the handler's own props. `InnerScrollHandler` aliases that prop to `scrollHandlerRef` when it destructures, because the effect already binds a local `scrollRef` for the resolved `ScrollRef` whose `current` it writes. The type itself cannot simply be called `ScrollRef`, since `router-reducer-types.ts` already imports that name from `app-router-types.ts` and uses it inside the definition. Two stale comments are corrected as well. `navigation.ts` referred to a `ScrollAndFocusHandler` that has not existed for some time, and the doc comment on `AppRouterState` still claimed the field drives focus management. This is a pure rename with no behavior change. The component names are also updated in `nextjsClientComponentNames` in `test/lib/next-test-utils.ts` and in the owner-stack snapshot in `test/development/browser-logs/browser-logs.test.ts`.
Contributor
Stats from current PR✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
Build Cache
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📝 Changed Files (8 files)Files with changes:
View diffsapp-page-exp..ntime.dev.jsfailed to diffapp-page-exp..time.prod.jsDiff too large to display app-page-tur..ntime.dev.jsfailed to diffapp-page-tur..time.prod.jsDiff too large to display app-page-tur..ntime.dev.jsfailed to diffapp-page-tur..time.prod.jsDiff too large to display app-page.runtime.dev.jsfailed to diffapp-page.runtime.prod.jsDiff too large to display 📎 Tarball URLCommit: 7e1ae3b |
Contributor
Tests PassedCommit: 7e1ae3b |
icyJoseph
approved these changes
Aug 7, 2026
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.
As of #95602, the old scroll-and-focus handler doesn't exist anymore
As of #96113, the new handler no longer handles focus.
This updates the relevant variable names to reflect that we no longer handle focus.