Skip to content

🀯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

πŸ’„ style(settings): align every settings tab to the shared content column (#23052)

YuTengjingb8d53f67d7ba
diff --git a/src/components/Skeleton/Settings/tabs/Integrations.tsx b/src/components/Skeleton/Settings/tabs/Integrations.tsx
index ea48aa8ce09..813a2b40427 100644
--- a/src/components/Skeleton/Settings/tabs/Integrations.tsx
+++ b/src/components/Skeleton/Settings/tabs/Integrations.tsx
@@ -5,7 +5,6 @@ import { useTranslation } from 'react-i18next';
import {
IntegrationDetailSkeleton,
- IntegrationsColumn,
IntegrationsOverviewSkeleton,
} from '@/features/Integrations/Skeleton';
@@ -13,32 +12,23 @@ import SkeletonBar from '../../Bar';
import type { SettingsTabSkeleton, SettingsTabSkeletonProps } from './types';
/**
- * The directory: the intro line (static copy) above the overview, both in the
- * 760px reading column, 20px apart β€” the page body under the shared header.
+ * The directory: the intro line (static copy) above the overview, 20px apart β€”
+ * the page body under the shared header, filling the settings column.
* An integration page (`:sub`) draws its own hero instead of the intro.
*/
const Body = ({ sub }: SettingsTabSkeletonProps) => {
const { t, ready } = useTranslation('integration');
- if (sub)
- return (
- <IntegrationsColumn>
- <IntegrationDetailSkeleton />
- </IntegrationsColumn>
- );
+ if (sub) return <IntegrationDetailSkeleton />;
return (
<Flexbox gap={20}>
- <IntegrationsColumn>
- {ready ? (
- <Text type={'secondary'}>{t('overview.description')}</Text>
- ) : (
- <SkeletonBar height={14} width={360} />
- )}
- </IntegrationsColumn>
- <IntegrationsColumn>
- <IntegrationsOverviewSkeleton />
- </IntegrationsColumn>
+ {ready ? (
+ <Text type={'secondary'}>{t('overview.description')}</Text>
+ ) : (
+ <SkeletonBar height={14} width={360} />
+ )}
+ <IntegrationsOverviewSkeleton />
</Flexbox>
);
};
diff --git a/src/features/Integrations/Layout.tsx b/src/features/Integrations/Layout.tsx
index f35c35fe8ac..212e86b73ec 100644
--- a/src/features/Integrations/Layout.tsx
+++ b/src/features/Integrations/Layout.tsx
@@ -4,22 +4,15 @@ import { createStaticStyles } from '@lobehub/ui';
import { memo, type PropsWithChildren } from 'react';
const styles = createStaticStyles(({ css }) => ({
- column: css`
- width: 100%;
- max-width: 760px;
- margin-inline: auto;
- `,
page: css`
overflow-y: auto;
flex: 1;
`,
}));
-/** A reading-width column: settings content wider than a paragraph reads as a dashboard. */
+/** Fills the shared settings column, so switching tabs keeps the same content width. */
const IntegrationsLayout = memo<PropsWithChildren>(({ children }) => (
- <div className={styles.page}>
- <div className={styles.column}>{children}</div>
- </div>
+ <div className={styles.page}>{children}</div>
));
IntegrationsLayout.displayName = 'IntegrationsLayout';
diff --git a/src/features/Integrations/Skeleton.tsx b/src/features/Integrations/Skeleton.tsx
index 9a23f814d6a..ea9551a2842 100644
--- a/src/features/Integrations/Skeleton.tsx
+++ b/src/features/Integrations/Skeleton.tsx
@@ -3,7 +3,6 @@
import { Flexbox, Text } from '@lobehub/ui';
import { cssVar } from '@lobehub/ui/stylex/cssVar.stylex';
import * as stylex from '@stylexjs/stylex';
-import type { ReactNode } from 'react';
import { useTranslation } from 'react-i18next';
import SkeletonBar from '@/components/Skeleton/Bar';
@@ -16,11 +15,6 @@ const styles = stylex.create({
borderRadius: cssVar.borderRadiusLG,
backgroundColor: cssVar.colorFillQuaternary,
},
- column: {
- width: '100%',
- maxWidth: '760px',
- marginInline: 'auto',
- },
// `Connections` card: filled, rows 10px apart from its 2px inset.
connections: {
paddingBlock: '2px',
@@ -179,8 +173,3 @@ export const IntegrationDetailSkeleton = () => {
</Flexbox>
);
};
-
-/** `IntegrationsLayout`'s reading-width column, for skeletons outside the layout. */
-export const IntegrationsColumn = ({ children }: { children: ReactNode }) => (
- <div {...stylex.props(styles.column)}>{children}</div>
-);
diff --git a/src/features/Settings/integrations/index.tsx b/src/features/Settings/integrations/index.tsx
index aa0386420a1..c941e4f76de 100644
--- a/src/features/Settings/integrations/index.tsx
+++ b/src/features/Settings/integrations/index.tsx
@@ -1,15 +1,10 @@
import { Flexbox, Text } from '@lobehub/ui';
-import * as stylex from '@stylexjs/stylex';
import { useTranslation } from 'react-i18next';
import { useParams } from 'react-router';
import IntegrationsSettings from '@/features/Integrations';
import SettingHeader from '@/features/Settings/features/SettingHeader';
-const styles = stylex.create({
- header: { width: '100%', maxWidth: '760px', marginInline: 'auto' },
-});
-
interface PageProps {
showSettingHeader?: boolean;
}
@@ -25,9 +20,7 @@ const Page = ({ showSettingHeader = true }: PageProps) => {
return (
<>
{showIntro && (
- <div {...stylex.props(styles.header)}>
- <SettingHeader description={t('overview.description')} title={t('overview.title')} />
- </div>
+ <SettingHeader description={t('overview.description')} title={t('overview.title')} />
)}
<IntegrationsSettings />
</>
@@ -36,11 +29,7 @@ const Page = ({ showSettingHeader = true }: PageProps) => {
// Intro line and directory read as one block, like the messenger list.
return (
<Flexbox gap={20}>
- {showIntro && (
- <div {...stylex.props(styles.header)}>
- <Text type={'secondary'}>{t('overview.description')}</Text>
- </div>
- )}
+ {showIntro && <Text type={'secondary'}>{t('overview.description')}</Text>}
<IntegrationsSettings />
</Flexbox>
);
diff --git a/src/features/Settings/provider/_layout/Desktop/Container.tsx b/src/features/Settings/provider/_layout/Desktop/Container.tsx
index c8aa4aecde3..1ff0e56e448 100644
--- a/src/features/Settings/provider/_layout/Desktop/Container.tsx
+++ b/src/features/Settings/provider/_layout/Desktop/Container.tsx
@@ -25,7 +25,8 @@ const Container: FC<PropsWithChildren> = ({ children }) => {
<NavHeader />
<SettingContainer
maxWidth={1024}
- padding={24}
+ paddingBlock={'24px 128px'}
+ paddingInline={24}
ref={scrollRef}
style={{
minHeight: '100%',
diff --git a/src/features/Settings/skill/index.tsx b/src/features/Settings/skill/index.tsx
index 21df73edfa8..f69172af27a 100644
--- a/src/features/Settings/skill/index.tsx
+++ b/src/features/Settings/skill/index.tsx
@@ -30,8 +30,30 @@ export interface SelectedTool {
const styles = stylex.create({
detail: { overflowY: 'auto', flex: '1' },
- page: { overflowY: 'auto', display: 'flex', flex: '1', justifyContent: 'center', height: '100%' },
- pageBody: { display: 'flex', flexDirection: 'column', width: '100%', maxWidth: '960px' },
+ page: {
+ overflowY: 'auto',
+ display: 'flex',
+ flex: '1',
+ alignItems: 'flex-start',
+ justifyContent: 'center',
+ height: '100%',
+ paddingInline: '12px',
+ },
+ /**
+ * The connector list insets its rows and intro 12px, so the body is 12px wider
+ * than the shared 1024px settings column on each side: text then lines up with
+ * every other settings tab, and the bottom space matches their 128px. The body
+ * grows with its content (the page aligns it to the top instead of stretching it
+ * to the scroll box), otherwise the list overflows it and the bottom padding is lost.
+ */
+ pageBody: {
+ display: 'flex',
+ flexDirection: 'column',
+ width: '100%',
+ maxWidth: '1048px',
+ minHeight: '100%',
+ paddingBlockEnd: '104px',
+ },
root: { overflow: 'hidden', display: 'flex', flex: '1', height: '100%' },
});