🐛 fix: Fix extra network sidebar scroll

pull/568/head
canisminor1990 2024-05-16 10:58:58 +08:00
parent b0ae238c84
commit c729939105
4 changed files with 64 additions and 27 deletions

File diff suppressed because one or more lines are too long

View File

@ -3,6 +3,7 @@ import { Skeleton, Slider } from 'antd';
import isEqual from 'fast-deep-equal'; import isEqual from 'fast-deep-equal';
import { ZoomIn, ZoomOut } from 'lucide-react'; import { ZoomIn, ZoomOut } from 'lucide-react';
import { memo, useState } from 'react'; import { memo, useState } from 'react';
import { Flexbox } from 'react-layout-kit';
import { selectors, useAppStore } from '@/store'; import { selectors, useAppStore } from '@/store';
@ -25,17 +26,29 @@ const Inner = memo(() => {
return ( return (
<> <>
<DraggablePanelBody className={styles.body}> <DraggablePanelBody className={styles.body}>
{isLoading && <Skeleton active />} {isLoading && (
<Flexbox padding={16} width={'100%'}>
<Skeleton active />
</Flexbox>
)}
<div style={isLoading ? { display: 'none' } : {}}> <div style={isLoading ? { display: 'none' } : {}}>
<div <div
id="txt2img-extra-network-sidebar" id="txt2img-extra-network-sidebar"
ref={txt2imgExtraNetworkSidebarReference} ref={txt2imgExtraNetworkSidebarReference}
style={currentTab === 'tab_img2img' ? { display: 'none' } : {}} style={
currentTab === 'tab_img2img' ?
{ display: 'none' } :
{ height: '100%', overflow: 'hidden', position: 'relative' }
}
/> />
<div <div
id="img2img-extra-network-sidebar" id="img2img-extra-network-sidebar"
ref={img2imgExtraNetworkSidebarReference} ref={img2imgExtraNetworkSidebarReference}
style={currentTab === 'tab_img2img' ? {} : { display: 'none' }} style={
currentTab === 'tab_img2img' ?
{ height: '100%' } :
{ display: 'none', overflow: 'hidden', position: 'relative' }
}
/> />
</div> </div>
</DraggablePanelBody> </DraggablePanelBody>

View File

@ -3,6 +3,9 @@ import { createStyles } from 'antd-style';
export const useStyles = createStyles( export const useStyles = createStyles(
({ css, token }, { headerHeight = 64, size = 86 }: { headerHeight?: number; size?: number }) => ({ ({ css, token }, { headerHeight = 64, size = 86 }: { headerHeight?: number; size?: number }) => ({
body: css` body: css`
height: 100%;
padding: 0;
.hide { .hide {
display: none; display: none;
} }
@ -27,20 +30,26 @@ export const useStyles = createStyles(
} }
.tabitem { .tabitem {
position: relative;
padding: 0 !important; padding: 0 !important;
background: transparent; background: transparent;
} }
} }
.extra-network-pane {
resize: none;
height: 100%;
}
.extra-network-cards { .extra-network-cards {
overflow: unset; overflow: hidden auto;
display: grid; display: grid;
grid-template-columns: repeat(auto-fill, minmax(${size}px, 1fr)); grid-template-columns: repeat(auto-fill, minmax(${size}px, 1fr));
flex: none !important; flex: none !important;
gap: 8px; gap: 8px;
height: unset; max-height: 100%;
min-height: unset; padding: 16px;
border: unset !important; border: unset !important;
@ -62,7 +71,7 @@ export const useStyles = createStyles(
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 6px; gap: 6px;
margin-bottom: 12px; padding-inline: 16px;
> button.lg.secondary.gradio-button { > button.lg.secondary.gradio-button {
padding: 4px 8px; padding: 4px 8px;
@ -72,6 +81,11 @@ export const useStyles = createStyles(
} }
.extra-networks { .extra-networks {
position: relative;
display: flex;
flex-direction: column;
height: 100%;
.pending { .pending {
opacity: 1 !important; opacity: 1 !important;
} }
@ -82,14 +96,12 @@ export const useStyles = createStyles(
.tab-nav { .tab-nav {
align-items: center; align-items: center;
margin: 0;
> * { padding: 16px;
height: 40px !important;
margin: 0 !important;
font-size: var(--text-md) !important;
}
> button { > button {
font-size: 14px !important;
&:first-child { &:first-child {
display: none; display: none;
} }

View File

@ -48,7 +48,7 @@ export const DEFAULT_SETTING: WebuiSetting = {
i18n: 'en_US', i18n: 'en_US',
layoutHideFooter: false, layoutHideFooter: false,
layoutSplitPreview: false, layoutSplitPreview: false,
liteAnimation: false, liteAnimation: true,
logoCustomTitle: '', logoCustomTitle: '',
logoCustomUrl: '', logoCustomUrl: '',
logoType: 'lobe', logoType: 'lobe',