Skip to content

Commit c729939

Browse files
🐛 fix: Fix extra network sidebar scroll
1 parent b0ae238 commit c729939

File tree

4 files changed

+64
-27
lines changed

4 files changed

+64
-27
lines changed

javascript/main.js

+25-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/features/ExtraNetworkSidebar/Inner.tsx

+16-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Skeleton, Slider } from 'antd';
33
import isEqual from 'fast-deep-equal';
44
import { ZoomIn, ZoomOut } from 'lucide-react';
55
import { memo, useState } from 'react';
6+
import { Flexbox } from 'react-layout-kit';
67

78
import { selectors, useAppStore } from '@/store';
89

@@ -25,17 +26,29 @@ const Inner = memo(() => {
2526
return (
2627
<>
2728
<DraggablePanelBody className={styles.body}>
28-
{isLoading && <Skeleton active />}
29+
{isLoading && (
30+
<Flexbox padding={16} width={'100%'}>
31+
<Skeleton active />
32+
</Flexbox>
33+
)}
2934
<div style={isLoading ? { display: 'none' } : {}}>
3035
<div
3136
id="txt2img-extra-network-sidebar"
3237
ref={txt2imgExtraNetworkSidebarReference}
33-
style={currentTab === 'tab_img2img' ? { display: 'none' } : {}}
38+
style={
39+
currentTab === 'tab_img2img' ?
40+
{ display: 'none' } :
41+
{ height: '100%', overflow: 'hidden', position: 'relative' }
42+
}
3443
/>
3544
<div
3645
id="img2img-extra-network-sidebar"
3746
ref={img2imgExtraNetworkSidebarReference}
38-
style={currentTab === 'tab_img2img' ? {} : { display: 'none' }}
47+
style={
48+
currentTab === 'tab_img2img' ?
49+
{ height: '100%' } :
50+
{ display: 'none', overflow: 'hidden', position: 'relative' }
51+
}
3952
/>
4053
</div>
4154
</DraggablePanelBody>

src/features/ExtraNetworkSidebar/style.ts

+22-10
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ import { createStyles } from 'antd-style';
33
export const useStyles = createStyles(
44
({ css, token }, { headerHeight = 64, size = 86 }: { headerHeight?: number; size?: number }) => ({
55
body: css`
6+
height: 100%;
7+
padding: 0;
8+
69
.hide {
710
display: none;
811
}
@@ -27,20 +30,26 @@ export const useStyles = createStyles(
2730
}
2831
2932
.tabitem {
33+
position: relative;
3034
padding: 0 !important;
3135
background: transparent;
3236
}
3337
}
3438
39+
.extra-network-pane {
40+
resize: none;
41+
height: 100%;
42+
}
43+
3544
.extra-network-cards {
36-
overflow: unset;
45+
overflow: hidden auto;
3746
display: grid;
3847
grid-template-columns: repeat(auto-fill, minmax(${size}px, 1fr));
3948
flex: none !important;
4049
gap: 8px;
4150
42-
height: unset;
43-
min-height: unset;
51+
max-height: 100%;
52+
padding: 16px;
4453
4554
border: unset !important;
4655
@@ -62,7 +71,7 @@ export const useStyles = createStyles(
6271
display: flex;
6372
flex-wrap: wrap;
6473
gap: 6px;
65-
margin-bottom: 12px;
74+
padding-inline: 16px;
6675
6776
> button.lg.secondary.gradio-button {
6877
padding: 4px 8px;
@@ -72,6 +81,11 @@ export const useStyles = createStyles(
7281
}
7382
7483
.extra-networks {
84+
position: relative;
85+
display: flex;
86+
flex-direction: column;
87+
height: 100%;
88+
7589
.pending {
7690
opacity: 1 !important;
7791
}
@@ -82,14 +96,12 @@ export const useStyles = createStyles(
8296
8397
.tab-nav {
8498
align-items: center;
85-
86-
> * {
87-
height: 40px !important;
88-
margin: 0 !important;
89-
font-size: var(--text-md) !important;
90-
}
99+
margin: 0;
100+
padding: 16px;
91101
92102
> button {
103+
font-size: 14px !important;
104+
93105
&:first-child {
94106
display: none;
95107
}

src/store/initialState.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const DEFAULT_SETTING: WebuiSetting = {
4848
i18n: 'en_US',
4949
layoutHideFooter: false,
5050
layoutSplitPreview: false,
51-
liteAnimation: false,
51+
liteAnimation: true,
5252
logoCustomTitle: '',
5353
logoCustomUrl: '',
5454
logoType: 'lobe',

0 commit comments

Comments
 (0)