Repository navigation
Tap the mobile header to scroll to top - #4742
Conversation
…der-to-scroll-to-top-thr_stv78thfm7
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 637322006a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const viewport = Array.from( | ||
| scope.querySelectorAll<HTMLElement>("[data-page-scroll-viewport]"), | ||
| ).find((element) => element.getClientRects().length > 0); |
There was a problem hiding this comment.
Register the tools scroll viewports
On compact /plugins and /skills routes, AppLayout renders this tappable AppPageHeader, but their actual scrollers are the unmarked ResourceScrollPage viewport (apps/app/src/views/ToolsView.tsx:120) and the inner ScrollArea used by ResourceCollectionViewport (packages/shared-ui/src/components/ui/resource/collection.tsx:158). Because neither has data-page-scroll-viewport, this query finds nothing and tapping the header is a no-op across those tools pages; register those actual viewports, including the collection viewport, so the feature applies consistently.
Useful? React with 👍 / 👎.
## Human comments ## What was wrong On compact viewports, `AppPageHeader` scrolls the page to the top when its background is tapped (#4742). The thread actions menu renders its drawer through a portal, but React bubbles synthetic events through the component tree, not the DOM tree. A tap on the drawer's backdrop (or its grab handle) therefore reached the header's `onClick`. The target was a plain `div`, so it passed the interactive-element filter, and closing the drawer smooth-scrolled the timeline to the top. #4742 listed this as a deferred follow-up ("Ignore portaled menu-backdrop clicks in the header handler"). ## What changed - `apps/app/src/components/layout/AppPageHeader.tsx`: the compact tap-to-top handler ignores clicks whose target is outside the header's DOM (`!event.currentTarget.contains(event.target)`). Taps on the header itself behave as before. - `apps/app/src/components/layout/AppPageHeader.test.tsx`: covers a header tap (scrolls to top) and a click from a portaled child (does not). ## How you verified - Reproduced on an Android emulator (Pixel 9, Chrome) against the live app with a scroll-write probe. Tapping the backdrop logged `viewport.scrollTo({ top: 0, behavior: "smooth" })` from the `PAGE_SCROLL_TO_TOP_EVENT` handler, called from React's click dispatch. - Headless Chrome at 390×844: open the drawer at scrollTop 6000, then click the backdrop. Main moves the timeline; this branch stays at 6000. Re-checked on a `pnpm start:worktree` server for this branch: the backdrop keeps the position, and the header "Scroll to top" button still scrolls. - The new test's portal case fails without the fix and passes with it. - `pnpm exec turbo run typecheck --filter=@bb/app` and `pnpm exec turbo run lint --filter=@bb/app` pass. > AGENT GENERATED 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
Human comments
What was wrong
The mobile header had no scroll-to-top action, so returning to the start of a long thread required manual scrolling.
What changed
How you verified
atBottom: true.Final-head remote CI: all three app test shards and checks passed, including the extended regression. All required jobs passed except host-package tests, which failed with the same Pi provider-parity timeouts reproduced on the main base.
Post-merge CI on
8a9f2816d4046bee5e488dbf88e36a69db271d31passed every job except the same Pi provider-parity tests. The demo deployment passed.Slop Cop found one P1, now fixed, and two P2 follow-ups retained under the review policy:
Before: 4acc7fa · After: f7ada4a · Captured at 2×
header-scroll-growth.webm
BB-Thread-ID: thr_stv78thfm7