fix(app): restore mobile left sidebar swipe (#1976)

Keep the shared sidebar model outside the root gesture detector so Gesture Handler attaches to the native surface on Android/Fabric.
This commit is contained in:
Mohamed Boudra
2026-07-10 11:34:47 +02:00
committed by GitHub
parent a689ccb0af
commit 1f0285c06b
2 changed files with 27 additions and 24 deletions
+3
View File
@@ -70,6 +70,9 @@ definition, no longer eligible to begin.
- Callers request semantic targets through `panel-store`; they never write shared values. - Callers request semantic targets through `panel-store`; they never write shared values.
- Gesture behavior comes from the four explicit hooks in `mobile-panels/gestures.ts`. - Gesture behavior comes from the four explicit hooks in `mobile-panels/gestures.ts`.
- Keep `SidebarModelProvider` outside `MobileGestureWrapper`. The provider shares sidebar derivation
across consumers, while Gesture Handler requires the wrapper's direct child to be a native `View`
so its injected `collapsable={false}` reaches Android/Fabric.
- Mobile sidebars render through `MobilePanelOverlay`; do not duplicate overlay lifecycle or motion - Mobile sidebars render through `MobilePanelOverlay`; do not duplicate overlay lifecycle or motion
styles in sidebar components. styles in sidebar components.
- Animated panel nodes use React Native static styles plus inline theme values. Do not attach - Animated panel nodes use React Native static styles plus inline theme values. Do not attach
+24 -24
View File
@@ -464,33 +464,33 @@ function AppContainer({ children, chromeEnabled: chromeEnabledOverride }: AppCon
</View> </View>
); );
const content = ( const surface = (
<SidebarModelProvider> <View style={layoutStyles.surfaceFill}>
<View style={layoutStyles.surfaceFill}> {workspaceChrome}
{workspaceChrome} <FloatingPanelPortalHost />
<FloatingPanelPortalHost /> {isCompactLayout && chromeEnabled && <LeftSidebar />}
{isCompactLayout && chromeEnabled && <LeftSidebar />} <DownloadToast />
<DownloadToast /> <RosettaCalloutSource />
<RosettaCalloutSource /> <UpdateCalloutSource />
<UpdateCalloutSource /> <WorktreeSetupCalloutSource />
<WorktreeSetupCalloutSource /> <CommandCenter />
<CommandCenter /> <HostChooserModal />
<HostChooserModal /> <ProjectPickerModal />
<ProjectPickerModal /> <ProviderSettingsHost />
<ProviderSettingsHost /> <WorkspaceShortcutTargetsSubscriber enabled={keyboardShortcutsEnabled} />
<WorkspaceShortcutTargetsSubscriber enabled={keyboardShortcutsEnabled} /> <WorkspaceSetupDialog />
<WorkspaceSetupDialog /> <KeyboardShortcutsDialog />
<KeyboardShortcutsDialog /> <QuittingOverlay />
<QuittingOverlay /> </View>
</View>
</SidebarModelProvider>
); );
if (!isCompactLayout) { const content = isCompactLayout ? (
return content; <MobileGestureWrapper chromeEnabled={chromeEnabled}>{surface}</MobileGestureWrapper>
} ) : (
surface
);
return <MobileGestureWrapper chromeEnabled={chromeEnabled}>{content}</MobileGestureWrapper>; return <SidebarModelProvider>{content}</SidebarModelProvider>;
} }
function MobileGestureWrapper({ function MobileGestureWrapper({