fix(mobile): close settings drawers and remove extra top spacing (#770)
* fix(mobile): close side drawers when opening settings * fix(mobile): remove duplicate top inset in drawers --------- Co-authored-by: Jovines <jovines@qq.com>
This commit is contained in:
committed by
GitHub
co-authored by
Jovines
parent
81c41388ac
commit
f032df2298
@@ -145,6 +145,21 @@ export const MainLayout: React.FC = () => {
|
|||||||
}
|
}
|
||||||
}, [isSessionSwitcherOpen, isMobile]);
|
}, [isSessionSwitcherOpen, isMobile]);
|
||||||
|
|
||||||
|
// Ensure mobile drawers are closed when opening full-screen settings
|
||||||
|
useEffect(() => {
|
||||||
|
if (!isMobile || !isSettingsDialogOpen) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setMobileLeftDrawerOpen(false);
|
||||||
|
if (isSessionSwitcherOpen) {
|
||||||
|
useUIStore.getState().setSessionSwitcherOpen(false);
|
||||||
|
}
|
||||||
|
if (isRightSidebarOpen) {
|
||||||
|
setRightSidebarOpen(false);
|
||||||
|
}
|
||||||
|
}, [isMobile, isSettingsDialogOpen, isSessionSwitcherOpen, isRightSidebarOpen, setRightSidebarOpen]);
|
||||||
|
|
||||||
// Sync right drawer and git sidebar state
|
// Sync right drawer and git sidebar state
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isMobile) {
|
if (isMobile) {
|
||||||
|
|||||||
@@ -683,6 +683,13 @@ export const SessionSidebar: React.FC<SessionSidebarProps> = ({
|
|||||||
});
|
});
|
||||||
}, [updateStore]);
|
}, [updateStore]);
|
||||||
|
|
||||||
|
const handleOpenSettings = React.useCallback(() => {
|
||||||
|
if (mobileVariant) {
|
||||||
|
setSessionSwitcherOpen(false);
|
||||||
|
}
|
||||||
|
setSettingsDialogOpen(true);
|
||||||
|
}, [mobileVariant, setSessionSwitcherOpen, setSettingsDialogOpen]);
|
||||||
|
|
||||||
const showSidebarUpdateButton =
|
const showSidebarUpdateButton =
|
||||||
updateStore.available &&
|
updateStore.available &&
|
||||||
(updateStore.runtimeType === 'desktop' || updateStore.runtimeType === 'web');
|
(updateStore.runtimeType === 'desktop' || updateStore.runtimeType === 'web');
|
||||||
@@ -1520,7 +1527,7 @@ export const SessionSidebar: React.FC<SessionSidebarProps> = ({
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<SidebarFooter
|
<SidebarFooter
|
||||||
onOpenSettings={() => setSettingsDialogOpen(true)}
|
onOpenSettings={handleOpenSettings}
|
||||||
onOpenShortcuts={toggleHelpDialog}
|
onOpenShortcuts={toggleHelpDialog}
|
||||||
onOpenAbout={() => setAboutDialogOpen(true)}
|
onOpenAbout={() => setAboutDialogOpen(true)}
|
||||||
onOpenUpdate={handleOpenUpdateDialog}
|
onOpenUpdate={handleOpenUpdateDialog}
|
||||||
|
|||||||
@@ -281,9 +281,9 @@
|
|||||||
padding-bottom: var(--oc-safe-area-bottom-visual) !important;
|
padding-bottom: var(--oc-safe-area-bottom-visual) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Drawer safe area - only top/bottom padding, no positioning */
|
/* Drawer safe area - top already offset by header height */
|
||||||
.drawer-safe-area {
|
.drawer-safe-area {
|
||||||
padding-top: var(--oc-safe-area-top);
|
padding-top: 0;
|
||||||
padding-bottom: var(--oc-safe-area-bottom-visual);
|
padding-bottom: var(--oc-safe-area-bottom-visual);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user