Skip to content

Fix drawer tap-through and stale sticky-scroll cache - #1359

Merged
SawyerHood merged 1 commit into
mainfrom
bb/review-slop-cop-pr-feedback-thr_3kk6khinzi
Aug 12, 2026
Merged

SawyerHood merged 1 commit into
mainfrom
bb/review-slop-cop-pr-feedback-thr_3kk6khinzi

Conversation

@SawyerHood

Copy link
Copy Markdown
Collaborator

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 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

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]>
@SawyerHood
SawyerHood merged commit d1c6242 into main Aug 12, 2026
10 checks passed
@SawyerHood
SawyerHood deleted the bb/review-slop-cop-pr-feedback-thr_3kk6khinzi branch August 12, 2026 01:20
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant