OXY-155: Page switch resets scroll to top - #293
Open
Kalin-Rudnicki wants to merge 1 commit into
Open
Conversation
Client-side navigation only scrolled when the URL had a #fragment, so a page switch inherited the previous page's scroll position (the reused HolyGrail center pane keeps its scrollTop) and landed mid-page. - add PageScroll service: targetFor(fragment) -> Top | Fragment(id), plus onNavigate that scrolls to top (window + center scroll containers) or to the anchor. - add Window.scroll.toTop resetting document scroll and .oxy-holy-grail-center / --center-only containers. - PageManager.loadPage now calls PageScroll.onNavigate (anchor behavior kept). - add PageScroll pure-logic tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
OXY-155 — Page switch lands in the middle of the page
Root cause:
PageManager.loadPageonly scrolled after a page switch when the URL carried a#fragment. With no fragment it did nothing, so the new page inherited the previous page's scroll position — the reused HolyGrail center pane (.oxy-holy-grail-center,overflow-y:auto) keeps itsscrollTop, landing the new page mid-page.Fix:
PageScrollservice: puretargetFor(fragment)→Top | Fragment(id), plusonNavigatethat either scrolls to top or to the anchor.Window.scroll.toTop— resets the document/window scroll and the reused center scroll containers (.oxy-holy-grail-center/--center-only).PageManager.loadPagenow callsPageScroll.onNavigate(fragment); anchor/hash navigation behavior is unchanged.PageScrollpure-logic tests.Verification:
sbt oxygen-ui-web/test→ 47 tests pass (incl. new suite), clean compile under-Werror.Confidence: 8/10. High confidence on the root cause and the standard navigation path (HolyGrail + document scroll). Not higher because the JS test env has no DOM (couldn't visually confirm in a browser) and bespoke non-HolyGrail scroll containers are covered only by the window reset. See
report/OXY-155.mdfor full details, decisions, and assumptions.🤖 Generated with Claude Code