Repository navigation
Fix drawer tap-through and stale sticky-scroll cache - #1359
Merged
Merged
Conversation
Follow-up to #1356 for two SlopCop review findings. The deferred mobile open kept the backdrop at pointer-events-none for the 220 ms settle window while the panel was still inert, so a rapid second tap fell through to the page below. The drag helper now writes inline pointer-events on the backdrop whenever the panel is on screen. The sticky-bottom scroll cache only refreshed when the scroll port box resized. Content-only height changes (image loads, disclosure toggles) left the cached maximum stale, which could re-stick the user at the old bottom or block re-stick at the real one. The hook now also observes a content wrapper element. Co-Authored-By: Claude Fable 5 <[email protected]>
fahmiirsyadk
pushed a commit
to fahmiirsyadk/bb
that referenced
this pull request
Aug 12, 2026
Follow-up to get-bb#1356. This fixes findings 1 and 2 from the SlopCop review of that PR. ## Backdrop tap-through during the deferred open The deferred mobile open starts the slide 220 ms before the React state commit. In that window the panel is `inert` and the backdrop class still reads `pointer-events-none`, so a rapid second tap fell through to the page below the drawer. `applySidebarMobileDragStyles` now writes inline `pointer-events: auto` on the backdrop whenever the panel is on screen. The clear helper and the state commit remove the override, so the class-driven state owns pointer input again after settle. A tap the backdrop absorbs mid-slide does not cancel the open; the settle guard swallows the dismiss. ## Stale sticky-bottom scroll cache `useStickyBottomScroll` caches the maximum scroll offset and refreshes it from a `ResizeObserver` on the scroll port. The port box is fixed, so content-only height changes (an image load, a disclosure toggle) never fired the observer. The stale cache could re-stick a user at the old bottom, or block the re-stick at the real bottom. The hook now exposes a `contentRef`, and `TimelineDetailScroll` wraps its children in a div bound to it. The observer watches both boxes and feeds the same cache. ## Tests - `sidebar.test.tsx`: the backdrop intercepts taps during the deferred open, the absorbed tap does not cancel the open, and no stale override survives the close. - `useStickyBottomScroll.test.tsx`: a content-only growth refreshes the cache, the old bottom does not re-stick, and the real bottom does. `turbo run test --filter=@bb/app`: 2539 tests pass. Typecheck passes. > AGENT GENERATED: by Claude Fable 5 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5 <[email protected]>
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.
Follow-up to #1356. This fixes findings 1 and 2 from the SlopCop review of that PR.
Backdrop tap-through during the deferred open
The deferred mobile open starts the slide 220 ms before the React state commit. In that window the panel is
inertand the backdrop class still readspointer-events-none, so a rapid second tap fell through to the page below the drawer.applySidebarMobileDragStylesnow writes inlinepointer-events: autoon the backdrop whenever the panel is on screen. The clear helper and the state commit remove the override, so the class-driven state owns pointer input again after settle. A tap the backdrop absorbs mid-slide does not cancel the open; the settle guard swallows the dismiss.Stale sticky-bottom scroll cache
useStickyBottomScrollcaches the maximum scroll offset and refreshes it from aResizeObserveron the scroll port. The port box is fixed, so content-only height changes (an image load, a disclosure toggle) never fired the observer. The stale cache could re-stick a user at the old bottom, or block the re-stick at the real bottom. The hook now exposes acontentRef, andTimelineDetailScrollwraps its children in a div bound to it. The observer watches both boxes and feeds the same cache.Tests
sidebar.test.tsx: the backdrop intercepts taps during the deferred open, the absorbed tap does not cancel the open, and no stale override survives the close.useStickyBottomScroll.test.tsx: a content-only growth refreshes the cache, the old bottom does not re-stick, and the real bottom does.turbo run test --filter=@bb/app: 2539 tests pass. Typecheck passes.🤖 Generated with Claude Code