Skip to content

Commit e640266

Browse files
committed
fix(LayoutShell): adjust layout styles for better responsiveness and overflow handling
1 parent f4b18fd commit e640266

3 files changed

Lines changed: 12 additions & 10 deletions

File tree

web/src/pages/PluginsPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ const PluginsPage = memo(function PluginsPage() {
521521
};
522522

523523
return (
524-
<div style={{ height: 'calc(100vh - 88px)', display: 'flex', flexDirection: 'column', minHeight: 0, overflow: 'hidden' }}>
524+
<div style={{ flex: 1, display: 'flex', flexDirection: 'column', minHeight: 0, overflow: 'hidden' }}>
525525
<div style={{ display: 'flex', alignItems: 'center', gap: 8, marginBottom: 12, flexWrap: 'wrap' }}>
526526
<Upload
527527
accept=".foxpkg"

web/src/pages/ProcessorsPage.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -554,23 +554,23 @@ const ProcessorsPage = memo(function ProcessorsPage() {
554554
return (
555555
<>
556556
{contextHolder}
557-
<Flex gap={16} style={{ height: 'calc(100vh - 88px)' }}>
557+
<Flex gap={16} style={{ flex: 1, minHeight: 0, overflow: 'hidden' }}>
558558
<Card
559-
style={{ flex: '0 0 320px', minWidth: 280, display: 'flex', flexDirection: 'column' }}
559+
style={{ flex: '0 0 320px', minWidth: 280, minHeight: 0, display: 'flex', flexDirection: 'column' }}
560560
title={t('Processor List')}
561561
extra={
562562
<Space size={8}>
563563
<Button size="small" onClick={loadList} loading={loadingList}>{t('Refresh')}</Button>
564564
<Button size="small" onClick={handleReloadProcessors} loading={reloading}>{t('Reload')}</Button>
565565
</Space>
566566
}
567-
styles={{ body: { padding: 0, flex: 1, display: 'flex' } }}
567+
styles={{ body: { padding: 0, flex: 1, minHeight: 0, display: 'flex' } }}
568568
>
569569
{renderProcessorList()}
570570
</Card>
571571

572572
<Card
573-
style={{ flex: 1, minWidth: 0, display: 'flex', flexDirection: 'column' }}
573+
style={{ flex: 1, minWidth: 0, minHeight: 0, display: 'flex', flexDirection: 'column' }}
574574
title={selectedProcessorMeta ? `${selectedProcessorMeta.name} (${selectedProcessorMeta.type})` : t('Select a processor')}
575575
extra={
576576
<Space size={8}>
@@ -582,7 +582,7 @@ const ProcessorsPage = memo(function ProcessorsPage() {
582582
</Button>
583583
</Space>
584584
}
585-
styles={{ body: { padding: 0, flex: 1, display: 'flex', flexDirection: 'column' } }}
585+
styles={{ body: { padding: 0, flex: 1, minHeight: 0, display: 'flex', flexDirection: 'column' } }}
586586
>
587587
<Tabs
588588
activeKey={activeTab}

web/src/router/LayoutShell.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const ShellBody = memo(function ShellBody() {
5151
};
5252

5353
return (
54-
<Layout style={{ minHeight: '100dvh', background: 'var(--ant-color-bg-layout)' }}>
54+
<Layout style={{ height: '100dvh', overflow: 'hidden', background: 'var(--ant-color-bg-layout)' }}>
5555
{!isMobile && (
5656
<SideNav
5757
collapsed={collapsed}
@@ -85,7 +85,7 @@ const ShellBody = memo(function ShellBody() {
8585
/>
8686
)}
8787

88-
<Layout style={{ background: 'var(--ant-color-bg-layout)', minWidth: 0 }}>
88+
<Layout style={{ background: 'var(--ant-color-bg-layout)', minWidth: 0, minHeight: 0, overflow: 'hidden' }}>
8989
<TopHeader
9090
collapsed={collapsed}
9191
onToggle={handleToggleNav}
@@ -94,15 +94,17 @@ const ShellBody = memo(function ShellBody() {
9494
/>
9595
<Layout.Content
9696
style={{
97+
flex: 1,
9798
padding: isMobile ? 12 : 16,
9899
background: 'var(--ant-color-bg-layout)',
99100
display: 'flex',
100101
flexDirection: 'column',
101102
minHeight: 0,
103+
overflow: 'hidden',
102104
}}
103105
>
104-
<div style={{ flex: 1, minHeight: 0, background: 'var(--ant-color-bg-layout)' }}>
105-
<Flex vertical gap={16} style={{ minHeight: '100%', height: '100%' }}>
106+
<div style={{ flex: 1, minHeight: 0, background: 'var(--ant-color-bg-layout)', overflow: 'hidden' }}>
107+
<Flex vertical style={{ minHeight: 0, height: '100%' }}>
106108
{navKey === 'adapters' && <AdaptersPage />}
107109
{navKey === 'files' && <FileExplorerPage />}
108110
{navKey === 'share' && <SharePage />}

0 commit comments

Comments
 (0)