Pause covered workspace sheets and mock the shared sheet handle in tests

This commit is contained in:
Mohamed Boudra
2026-10-14 17:38:50 +02:00
parent 88142d8655
commit 0a10ebed2f
2 changed files with 11 additions and 6 deletions
@@ -80,6 +80,7 @@ vi.mock("@gorhom/bottom-sheet", async () => {
await vi.importActual<typeof import("react-native")>("react-native");
return {
BottomSheetBackdrop: () => null,
BottomSheetHandle: () => null,
BottomSheetModal: ReactModule.forwardRef(() => null),
BottomSheetScrollView: ScrollView,
BottomSheetTextInput: TextInput,
@@ -24,6 +24,7 @@ import {
type SheetHeader,
} from "@/components/adaptive-modal-sheet";
import { systemBackPress } from "@/components/ui/isolated-bottom-sheet-modal";
import { RetainedPanelActivity } from "@/components/retained-panel";
import { Button } from "@/components/ui/button";
import type { PanelIconProps } from "@/panels/panel-registry";
import { getPanelRegistration } from "@/panels/panel-registry";
@@ -250,12 +251,15 @@ function WorkspaceSheetPresentation({
onChange={handleChange}
accessible={false}
>
<WorkspaceSheetBody
tab={tab}
isPaneFocused={isTop && isWorkspaceFocused}
isWorkspaceFocused={isWorkspaceFocused}
buildContent={buildContent}
/>
{/* A covered sheet keeps its state but stops its live work until it is on top again. */}
<RetainedPanelActivity active={isTop}>
<WorkspaceSheetBody
tab={tab}
isPaneFocused={isTop && isWorkspaceFocused}
isWorkspaceFocused={isWorkspaceFocused}
buildContent={buildContent}
/>
</RetainedPanelActivity>
</BottomSheet>
</WorkspaceSheetHandleContext.Provider>
</View>