B105: keep scroll baseline while focused; force dock under uiFocused

Advance lastScrollTop even when search is focused so the first scroll
after blur does not false-flip snap. Re-assert dock whenever uiFocused
and the sheet left dock (handle collapse cannot hide an active search).

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
This commit is contained in:
Cursor Agent 2026-08-01 18:01:48 +00:00
parent 98a69ab153
commit faf813c354
No known key found for this signature in database
2 changed files with 6 additions and 5 deletions

View file

@ -54,12 +54,12 @@ export const CampaignQuickActionsDrawer = ({
[setSnapPoint],
)
// Focus / active query on the peek search expands to dock (B105).
// Active search focus keeps the drawer docked (B105) — same gate as scroll.
useEffect(() => {
if (uiFocused) {
if (uiFocused && !isDock) {
setSnapPoint(QUICK_ACTIONS_SNAP_DOCK)
}
}, [setSnapPoint, uiFocused])
}, [isDock, setSnapPoint, uiFocused])
return (
<Drawer

View file

@ -26,8 +26,6 @@ const CampaignContentScrollWithPeek = ({ children }: { children: ReactNode }) =>
const peekHeight = isDock ? QUICK_ACTIONS_SNAP_DOCK : QUICK_ACTIONS_SNAP_COLLAPSED
const syncSnapFromScroll = useCallback(() => {
if (uiFocused) return
const scrollport = scrollRef.current
if (!scrollport) return
@ -35,6 +33,9 @@ const CampaignContentScrollWithPeek = ({ children }: { children: ReactNode }) =>
const direction = quickActionsScrollDirection(lastScrollTopRef.current, nextTop)
lastScrollTopRef.current = nextTop
// Keep the scroll baseline fresh while search is focused; only gate snap writes.
if (uiFocused) return
if (direction === 'down') {
setSnapPoint(QUICK_ACTIONS_SNAP_COLLAPSED)
return