Compare commits

...
Author SHA1 Message Date
paseo-bot[bot] 1a18409be5 fix(app): keep the drawer closed during file preview swipes
The native workspace drawer recognizes pans from inside the compact sheet host. Block panel opening gestures while the active workspace file sheet is open so dismissing it returns to the same drawer state.
2026-11-29 17:19:50 +00:00
2 changed files with 28 additions and 4 deletions
@@ -0,0 +1,21 @@
# Open an agent chat with a Markdown link labeled "Preview fixture" to a file
# whose first source line is "# Preview Fixture". Use 1080×2400 at density 420.
context platform=android timeout=120000 retries=0
env APP_ID=sh.paseo.debug
open "${APP_ID}" "${AGENT_URL}"
wait "label=\"Open menu\"" 15000
press "label=\"Preview fixture\""
wait "id=\"file-mode-source\"" 8000
press "id=\"file-mode-source\""
wait "text=\"# Preview Fixture\"" 8000
gesture pan 370 670 580 0 1000
press "label=\"Close\""
wait absent "id=\"sheet-tab-body\"" 5000
wait absent "label=\"Close sidebar\"" 3000
# The same drawer gesture must work again after the file sheet closes.
gesture pan 370 670 580 0 1000
wait "label=\"Close sidebar\"" 5000
press "label=\"Close sidebar\""
close
@@ -10,6 +10,8 @@ import {
type IsolatedBottomSheetModalRef,
systemBackPress,
} from "@/components/ui/isolated-bottom-sheet-modal";
import { isNative } from "@/constants/platform";
import { useBlockMobilePanelOpenGestures } from "@/mobile-panels/provider";
import {
SheetPane,
useSheetPaneBridge,
@@ -109,15 +111,16 @@ function SheetTabSheet({ sheet, isTop, onClose }: SheetTabSheetProps) {
},
[onClose, tab.tabId],
);
// Hidden workspaces stay mounted in the deck and under Settings; only the visible one owns Back.
const ownsBackPress = isTop && isWorkspaceFocused && isScreenFocused;
// Hidden workspaces stay mounted in the deck and under Settings.
const isActiveSheet = isTop && isWorkspaceFocused && isScreenFocused;
useBlockMobilePanelOpenGestures(isNative && isActiveSheet && tab.target.kind === "file");
useEffect(() => {
if (!ownsBackPress) return;
if (!isActiveSheet) return;
return systemBackPress.subscribe(() => {
close();
return true;
});
}, [close, ownsBackPress]);
}, [close, isActiveSheet]);
return (
<IsolatedBottomSheetModal