π€― 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.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
π style(settings): match settings skeletons to their settled layouts (#22382)
YuTengjing39c181414db0
diff --git a/src/components/Skeleton/Settings/Frame.tsx b/src/components/Skeleton/Settings/Frame.tsxnew file mode 100644index 00000000000..52ee305ba46--- /dev/null+++ b/src/components/Skeleton/Settings/Frame.tsx@@ -0,0 +1,53 @@+'use client';++import { Flexbox, Text } from '@lobehub/ui';+import type { ReactNode } from 'react';++import NavHeader from '@/features/NavHeader';+import SettingContainer from '@/features/Setting/SettingContainer';+import { getSettingsContainerMaxWidth } from '@/features/Settings/features/ownFrameTabs';+import { SettingsPageActionsRow } from '@/features/Settings/features/SettingsPageActions';+import { useSettingsTabTitle } from '@/features/Settings/features/tabTitles';++import SkeletonBar from '../Bar';++/**+ * The shared settings navigation header in its loading state. The title is+ * static copy, so it renders as the same text the settled header shows.+ */+export const SettingsSkeletonHeader = ({ tab }: { tab: string }) => {+ const title = useSettingsTabTitle(tab);++ return (+ <NavHeader styles={{ center: { alignItems: 'center' } }}>+ {title ? <Text weight={500}>{title}</Text> : <SkeletonBar height={16} width={88} />}+ </NavHeader>+ );+};++/**+ * Same header + padded container (1024px, or full width for `FULL_WIDTH_TABS`)+ * `SettingsContent` draws around a tab body, with the page-action placeholders+ * in the same row at the top of the content column.+ */+export const SettingsSkeletonFrame = ({+ actions,+ children,+ tab,+}: {+ actions?: ReactNode;+ children: ReactNode;+ tab: string;+}) => (+ <Flexbox aria-busy flex={1} height={'100%'} style={{ minHeight: 0, overflow: 'hidden' }}>+ <SettingsSkeletonHeader tab={tab} />+ <SettingContainer+ maxWidth={getSettingsContainerMaxWidth(tab)}+ paddingBlock={'24px 128px'}+ paddingInline={24}+ >+ {actions && <SettingsPageActionsRow>{actions}</SettingsPageActionsRow>}+ {children}+ </SettingContainer>+ </Flexbox>+);diff --git a/src/components/Skeleton/Settings/MessengerDetail.tsx b/src/components/Skeleton/Settings/MessengerDetail.tsxindex c14cb229456..295856df4f0 100644--- a/src/components/Skeleton/Settings/MessengerDetail.tsx+++ b/src/components/Skeleton/Settings/MessengerDetail.tsx@@ -1,11 +1,22 @@'use client';-import { Block, Flexbox, Skeleton } from '@lobehub/ui';+import { Block, Flexbox, Text } from '@lobehub/ui';import { cssVar } from '@lobehub/ui/stylex/cssVar.stylex';import * as stylex from '@stylexjs/stylex';import { memo } from 'react';+import { useTranslation } from 'react-i18next';++import {+ type MessengerPlatform,+ PlatformAvatar,+ SUPPORTED_MESSENGER_PLATFORMS,+} from '@/features/Messenger/constants';+import CommandsSection from '@/features/Messenger/IntegrationDetail/CommandsSection';++import SkeletonBar from '../Bar';const styles = stylex.create({+ // Same frame as the detail page's `card` (shared.tsx).card: {padding: '16px',borderWidth: '1px',@@ -13,65 +24,170 @@ const styles = stylex.create({borderColor: cssVar.colorBorder,borderRadius: cssVar.borderRadius,},+ grid: {+ display: 'grid',+ gridTemplateColumns: {+ '@media (width <= 720px)': '1fr',+ 'default': 'repeat(2, 1fr)',+ },+ gap: '12px',+ },+ listCard: {+ padding: '16px',+ borderWidth: '1px',+ borderStyle: 'solid',+ borderColor: cssVar.colorBorderSecondary,+ borderRadius: cssVar.borderRadiusLG,+ },});-const ConnectionsSkeleton = memo<{ withNestedContent?: boolean }>(- ({ withNestedContent = false }) => (- <Flexbox gap={12}>- {Array.from({ length: 2 }).map((_, index) => (- <Block className={stylex.props(styles.card).className} key={index}>- <Flexbox gap={12}>- <Flexbox horizontal align="center" gap={12}>- <Skeleton.Avatar shape={'square'} size={36} />- <Flexbox flex={1} gap={6}>- <Skeleton height={28} width={56} />- <Skeleton height={18} width={'40%'} />- </Flexbox>- <Skeleton height={28} width={72} />- <Skeleton height={28} width={84} />- </Flexbox>- {withNestedContent && (- <Flexbox gap={6} style={{ paddingInlineStart: 48 }}>- <Skeleton height={28} width={72} />- <Skeleton height={32} width={'100%'} />- </Flexbox>- )}+const isPlatform = (value: string | undefined): value is MessengerPlatform =>+ SUPPORTED_MESSENGER_PLATFORMS.some((platform) => platform.id === value);++/** A text placeholder centered in the line box of the text it stands in for. */+const Line = ({ bar, height, width }: { bar: number; height: number; width: number | string }) => (+ <Flexbox height={height} justify={'center'}>+ <SkeletonBar height={bar} width={width} />+ </Flexbox>+);++/**+ * The platform cards of `IntegrationList`: a two-column grid (one column under+ * 720px) of outlined cards with a 48px avatar, a name + description stack and a+ * chevron. Which platforms the server offers is data, so the cards are bars.+ */+export const MessengerListGridSkeleton = ({ cards = 4 }: { cards?: number }) => (+ <div aria-busy data-testid={'messenger-list-skeleton'} {...stylex.props(styles.grid)}>+ {Array.from({ length: cards }, (_, index) => (+ <div key={index} {...stylex.props(styles.listCard)}>+ <Flexbox horizontal align={'center'} gap={16}>+ <SkeletonBar height={48} radius={'50%'} width={48} />+ <Flexbox flex={1} gap={2} style={{ minWidth: 0 }}>+ <Line bar={15} height={24} width={88 + (index % 2) * 24} />+ <Line bar={12} height={22} width={'80%'} /></Flexbox>- </Block>- ))}- </Flexbox>- ),+ <SkeletonBar height={16} width={16} />+ </Flexbox>+ </div>+ ))}+ </div>);-ConnectionsSkeleton.displayName = 'MessengerConnectionsSkeleton';-export const IntegrationDetailSkeleton = memo<{ withNestedContent?: boolean }>(- ({ withNestedContent = false }) => (+/** `/settings/messenger`: the subtitle (static copy) above the platform grid. */+export const MessengerListSkeleton = () => {+ const { t, ready } = useTranslation('messenger');++ return (<Flexbox gap={20}>+ {ready ? (+ <Text type={'secondary'}>{t('messenger.subtitle')}</Text>+ ) : (+ <Line bar={14} height={22} width={360} />+ )}+ <MessengerListGridSkeleton />+ </Flexbox>+ );+};++const ConnectionSkeleton = memo<{ withNestedContent?: boolean }>(({ withNestedContent }) => (+ <Block className={stylex.props(styles.card).className}>+ <Flexbox gap={12}><Flexbox horizontal align="center" gap={12}>- <Skeleton height={28} width={20} />- <Skeleton height={28} width={96} />+ <SkeletonBar height={36} radius={8} width={36} />+ <Flexbox flex={1} gap={2}>+ <Line bar={12} height={20} width={64} />+ <Line bar={14} height={22} width={'36%'} />+ </Flexbox>+ <SkeletonBar height={22} width={72} />+ <SkeletonBar height={24} width={84} /></Flexbox>+ {withNestedContent && (+ <Flexbox horizontal gap={12} style={{ paddingInlineStart: 48 }}>+ {[0, 1].map((key) => (+ <Flexbox flex={1} gap={6} key={key}>+ <Line bar={12} height={20} width={56} />+ <SkeletonBar height={32} />+ </Flexbox>+ ))}+ </Flexbox>+ )}+ </Flexbox>+ </Block>+));+ConnectionSkeleton.displayName = 'MessengerConnectionSkeleton';++interface IntegrationDetailSkeletonProps {+ /** Static copy (name, avatar, description, commands) renders for a known platform. */+ platform?: string;+ /** Connections carry the scope + active-agent selects (every platform but Slack). */+ withNestedContent?: boolean;+}++/**+ * `DetailLayout` while the platform's connections load: back + name heading,+ * the platform card with its link button, one connection card and the static+ * Commands section, which renders for real since it needs no data.+ */+export const IntegrationDetailSkeleton = memo<IntegrationDetailSkeletonProps>(+ ({ platform, withNestedContent = false }) => {+ const { t } = useTranslation('messenger');+ const known = isPlatform(platform) ? platform : undefined;+ const name = SUPPORTED_MESSENGER_PLATFORMS.find((item) => item.id === known)?.name;- <Block className={stylex.props(styles.card).className}>- <Flexbox horizontal align="center" gap={16}>- <Skeleton.Avatar shape={'square'} size={48} />- <Flexbox flex={1} gap={6}>- <Skeleton height={28} width={64} />- <Skeleton.Text rows={1} width={'65%'} />+ return (+ <Flexbox aria-busy data-testid={'messenger-detail-skeleton'} gap={20}>+ <Flexbox horizontal align="center" gap={8}>+ <SkeletonBar height={16} width={16} />+ {name ? (+ <Text strong style={{ fontSize: 20 }}>+ {name}+ </Text>+ ) : (+ <Line bar={20} height={30} width={96} />+ )}+ </Flexbox>++ <Block className={stylex.props(styles.card).className}>+ <Flexbox horizontal align="center" gap={16}>+ {known ? (+ <PlatformAvatar platform={known} size={48} />+ ) : (+ <SkeletonBar height={48} radius={'50%'} width={48} />+ )}+ <Flexbox flex={1} gap={2}>+ {name ? (+ <Text strong style={{ fontSize: 15 }}>+ {name}+ </Text>+ ) : (+ <Line bar={15} height={24} width={88} />+ )}+ {known ? (+ <Text style={{ fontSize: 13 }} type="secondary">+ {t(`messenger.list.${known}.description` as any)}+ </Text>+ ) : (+ <Line bar={12} height={22} width={'60%'} />+ )}+ </Flexbox>+ <SkeletonBar height={32} width={120} /></Flexbox>- <Skeleton height={40} width={120} />+ </Block>++ <Flexbox gap={8}>+ <Text strong style={{ fontSize: 15 }}>+ {t('messenger.detail.connections.title')}+ </Text>+ <ConnectionSkeleton withNestedContent={withNestedContent} /></Flexbox>- </Block>- <Flexbox gap={8}>- <Skeleton height={28} width={72} />- <ConnectionsSkeleton withNestedContent={withNestedContent} />+ {known && <CommandsSection platform={known} />}</Flexbox>- </Flexbox>- ),+ );+ },);IntegrationDetailSkeleton.displayName = 'MessengerIntegrationDetailSkeleton';export const MessengerPlatformDetailSkeleton = ({ platform }: { platform: string }) => (- <IntegrationDetailSkeleton withNestedContent={platform !== 'slack'} />+ <IntegrationDetailSkeleton platform={platform} withNestedContent={platform !== 'slack'} />);diff --git a/src/components/Skeleton/Settings/Page.test.ts b/src/components/Skeleton/Settings/Page.test.tsindex a144d520b25..3eb9c92a741 100644--- a/src/components/Skeleton/Settings/Page.test.ts+++ b/src/components/Skeleton/Settings/Page.test.ts@@ -1,32 +1,40 @@import { describe, expect, it } from 'vitest';-import { resolveSettingsSkeletonBody } from './Page';+import { OWN_FRAME_TABS } from '@/features/Settings/features/ownFrameTabs';+import type { SettingsTabs } from '@/store/global/initialState';-describe('resolveSettingsSkeletonBody', () => {- it('uses the platform detail shape for a messenger platform page', () => {- expect(resolveSettingsSkeletonBody('/settings/messenger/discord')).toEqual({- kind: 'messengerDetail',- platform: 'discord',+import { resolveSettingsSkeletonTab } from './Page';+import { getSettingsTabSkeleton, SETTINGS_TAB_SKELETONS } from './tabs';++describe('resolveSettingsSkeletonTab', () => {+ it('reads the tab and its sub-segment', () => {+ expect(resolveSettingsSkeletonTab('/settings/messenger/discord')).toEqual({+ sub: 'discord',+ tab: 'messenger',});+ expect(resolveSettingsSkeletonTab('/settings/billing')).toEqual({ tab: 'billing' });});- it('keeps the section shape for the messenger list and other tabs', () => {- expect(resolveSettingsSkeletonBody('/settings/messenger')).toEqual({ kind: 'section' });- expect(resolveSettingsSkeletonBody('/settings/common')).toEqual({ kind: 'section' });+ it('opens the profile for the bare settings path', () => {+ expect(resolveSettingsSkeletonTab('/settings')).toEqual({ tab: 'profile' });});+});- it('uses a per-tab sections shape for tabs that are not plain forms', () => {- for (const tab of ['billing', 'credits', 'plans', 'referral', 'usage']) {- expect(resolveSettingsSkeletonBody(`/settings/${tab}`)).toEqual({ kind: 'sections', tab });- }+describe('SETTINGS_TAB_SKELETONS', () => {+ it('ignores inherited object keys', () => {+ expect(getSettingsTabSkeleton('toString')).toBeUndefined();});- it('ignores inherited object keys when looking up a tab shape', () => {- expect(resolveSettingsSkeletonBody('/settings/toString')).toEqual({ kind: 'section' });+ it('gives every own-frame tab with a registered skeleton a page', () => {+ for (const tab of OWN_FRAME_TABS) {+ const skeleton = SETTINGS_TAB_SKELETONS[tab as SettingsTabs];+ if (skeleton) expect(skeleton.Page, tab).toBeDefined();+ }});- it('uses the profile shape for the default tab', () => {- expect(resolveSettingsSkeletonBody('/settings')).toEqual({ kind: 'profile' });- expect(resolveSettingsSkeletonBody('/settings/profile')).toEqual({ kind: 'profile' });+ it('only gives own-frame tabs a page of their own', () => {+ for (const [tab, skeleton] of Object.entries(SETTINGS_TAB_SKELETONS)) {+ if (skeleton?.Page) expect(OWN_FRAME_TABS.has(tab), tab).toBe(true);+ }});});diff --git a/src/components/Skeleton/Settings/Page.tsx b/src/components/Skeleton/Settings/Page.tsxindex 158c9b6a30c..bfd0692a715 100644--- a/src/components/Skeleton/Settings/Page.tsx+++ b/src/components/Skeleton/Settings/Page.tsx@@ -1,59 +1,84 @@'use client';-import { Flexbox } from '@lobehub/ui';import { useLocation } from 'react-router';-import NavHeader from '@/features/NavHeader';import SettingContainer from '@/features/Setting/SettingContainer';+import { OWN_FRAME_TABS } from '@/features/Settings/features/ownFrameTabs';+import SettingsPageActions from '@/features/Settings/features/SettingsPageActions';import type { RouteSkeletonProps } from '@/spa/router/routeMeta';+import { isMobileSurface } from '@/utils/mobileSurface';-import SkeletonBar from '../Bar';-import { MessengerPlatformDetailSkeleton } from './MessengerDetail';-import SettingsProfileSkeleton from './Profile';+import { SettingsSkeletonFrame } from './Frame';import SettingsSectionSkeleton from './Section';-import { SettingsSectionsBody } from './Sections';-import { SETTINGS_SECTION_SHAPES } from './sectionShapes';+import { getSettingsTabSkeleton, type SettingsTabSkeleton } from './tabs';-type SettingsSkeletonBody =- | { kind: 'messengerDetail'; platform: string }- | { kind: 'profile' }- | { kind: 'section' }- | { kind: 'sections'; tab: string };+const GENERIC: SettingsTabSkeleton = { Body: () => <SettingsSectionSkeleton /> };-export const resolveSettingsSkeletonBody = (pathname: string): SettingsSkeletonBody => {+/** The tab and sub-segment a settings pathname renders; `/settings` opens the profile. */+export const resolveSettingsSkeletonTab = (pathname: string): { sub?: string; tab: string } => {const [, tab = 'profile', sub] = pathname.match(/\/settings\/([^/]+)(?:\/([^/]+))?/) ?? [];+ return { sub, tab };+};- if (tab === 'profile') return { kind: 'profile' };- if (tab === 'messenger' && sub) return { kind: 'messengerDetail', platform: sub };- if (Object.hasOwn(SETTINGS_SECTION_SHAPES, tab)) return { kind: 'sections', tab };- return { kind: 'section' };+const useTabSkeleton = () => {+ const { sub, tab } = resolveSettingsSkeletonTab(useLocation().pathname);+ return { skeleton: getSettingsTabSkeleton(tab) ?? GENERIC, sub, tab };};+/** The active tab's body alone, for hosts that already draw the header and container. */export const SettingsBodySkeleton = () => {- const body = resolveSettingsSkeletonBody(useLocation().pathname);-- if (body.kind === 'profile') return <SettingsProfileSkeleton />;- if (body.kind === 'messengerDetail')- return <MessengerPlatformDetailSkeleton platform={body.platform} />;- if (body.kind === 'sections')- return <SettingsSectionsBody shape={SETTINGS_SECTION_SHAPES[body.tab]} />;- return <SettingsSectionSkeleton />;+ const { skeleton, sub } = useTabSkeleton();+ return <skeleton.Body sub={sub} />;};-const SettingsPageSkeleton = ({ chrome = 'page' }: RouteSkeletonProps) => {- const profile = resolveSettingsSkeletonBody(useLocation().pathname).kind === 'profile';+/**+ * Chunk fallback of a settings tab component. `SettingsContent` draws the frame+ * around in-frame tabs before their chunk loads, so they get the body plus their+ * page-action placeholders in the real page-actions row; own-frame tabs get their whole+ * page, except under the mobile layout.+ */+export const SettingsChunkSkeleton = () => {+ const { skeleton, sub, tab } = useTabSkeleton();+ if (OWN_FRAME_TABS.has(tab) && skeleton.Page && !isMobileSurface())+ return <skeleton.Page sub={sub} />;return (- <Flexbox aria-busy flex={1} height={'100%'} style={{ minHeight: 0, overflow: 'hidden' }}>- {chrome !== 'body' && (- <NavHeader styles={{ center: { alignItems: 'center' } }}>- <SkeletonBar height={16} width={profile ? 52 : 88} />- </NavHeader>+ <>+ {skeleton.PageActions && (+ <SettingsPageActions>+ <skeleton.PageActions sub={sub} />+ </SettingsPageActions>)}+ <skeleton.Body sub={sub} />+ </>+ );+};++/**+ * Route fallback of a settings tab: the shared header with the real tab title,+ * the padded container and the tab body. Under `chrome='body'` the host layout+ * already draws the header, so only the container and body render.+ */+const SettingsPageSkeleton = ({ chrome = 'page' }: RouteSkeletonProps) => {+ const { skeleton, sub, tab } = useTabSkeleton();+ const body = <skeleton.Body sub={sub} />;++ if (chrome === 'body')+ return (<SettingContainer maxWidth={1024} paddingBlock={'24px 128px'} paddingInline={24}>- <SettingsBodySkeleton />+ {body}</SettingContainer>- </Flexbox>+ );++ if (OWN_FRAME_TABS.has(tab) && skeleton.Page) return <skeleton.Page sub={sub} />;++ return (+ <SettingsSkeletonFrame+ actions={skeleton.PageActions && <skeleton.PageActions sub={sub} />}+ tab={tab}+ >+ {body}+ </SettingsSkeletonFrame>);};diff --git a/src/components/Skeleton/Settings/Profile.tsx b/src/components/Skeleton/Settings/Profile.tsxindex ec16b835b71..5bc4f638aba 100644--- a/src/components/Skeleton/Settings/Profile.tsx+++ b/src/components/Skeleton/Settings/Profile.tsx@@ -1,16 +1,22 @@'use client';-import { Flexbox } from '@lobehub/ui';+import { isDesktop } from '@lobechat/const';+import { Block, Flexbox, Icon, Text } from '@lobehub/ui';import { Form } from '@lobehub/ui/form';import { cssVar } from '@lobehub/ui/stylex/cssVar.stylex';import { media } from '@lobehub/ui/stylex/media.stylex';import * as stylex from '@stylexjs/stylex';+import { BriefcaseIcon } from 'lucide-react';import { type ReactNode } from 'react';+import { useTranslation } from 'react-i18next';+import { INTEREST_AREAS } from '@/features/Onboarding/config';+import { serverConfigSelectors, useServerConfigStore } from '@/store/serverConfig';import { useUserStore } from '@/store/user';import { authSelectors, userProfileSelectors } from '@/store/user/selectors';import SkeletonBar from '../Bar';+import { useSkeletonText } from './useSkeletonText';const styles = stylex.create({action: { flexShrink: 0, marginInlineStart: 'auto' },@@ -49,6 +55,8 @@ interface SettingsProfileRowSkeletonProps {body?: ReactNode;bodyWidth?: number;height?: number;+ /** The row's real label; static copy renders as text instead of a bar. */+ label?: ReactNode;labelWidth?: number;}@@ -58,6 +66,7 @@ export const SettingsProfileRowSkeleton = ({body,bodyWidth = 160,height,+ label,labelWidth = 80,}: SettingsProfileRowSkeletonProps) => (<div@@ -65,7 +74,11 @@ export const SettingsProfileRowSkeleton = ({style={height ? { minHeight: height } : undefined}><div {...stylex.props(styles.label)}>- <SkeletonBar height={22} width={labelWidth} />+ {label === undefined ? (+ <SkeletonBar height={22} width={labelWidth} />+ ) : (+ <Text strong>{label}</Text>+ )}</div><div {...stylex.props(styles.body)}>{body === undefined ? <SkeletonBar height={22} width={bodyWidth} /> : body}@@ -78,51 +91,122 @@ export const SettingsProfileRowSkeleton = ({</div>);-const INTEREST_WIDTHS = [- 128, 188, 152, 148, 148, 164, 164, 188, 148, 100, 120, 136, 144, 144, 120, 128, 104, 104,-];+/**+ * The interest chips are static copy (the onboarding interest areas plus+ * "Other"), so they render as the same outlined chips the row shows; only the+ * user's selection is unknown and stays unhighlighted.+ */+const InterestsSkeleton = () => {+ const { t, ready } = useTranslation('onboarding');+ const chips = [+ ...INTEREST_AREAS.map(({ icon, key }) => ({ icon, key, label: t(`interests.area.${key}`) })),+ { icon: BriefcaseIcon, key: 'other', label: t('interests.area.other') },+ ];-const InterestsSkeleton = () => (- <Flexbox horizontal gap={8} style={{ width: '100%' }} wrap={'wrap'}>- {INTEREST_WIDTHS.map((width, index) => (- <SkeletonBar height={34} key={index} radius={cssVar.borderRadius} width={width} />- ))}- </Flexbox>-);+ return (+ <Flexbox horizontal align={'center'} gap={8} style={{ width: '100%' }} wrap={'wrap'}>+ {chips.map(({ icon, key, label }) => (+ <Block horizontal gap={8} key={key} padding={8} variant={'outlined'}>+ <Icon color={cssVar.colorTextSecondary} icon={icon} size={14} />+ {ready ? (+ <Text fontSize={13} weight={500}>+ {label}+ </Text>+ ) : (+ <SkeletonBar height={13} width={56} />+ )}+ </Block>+ ))}+ </Flexbox>+ );+};+/**+ * The profile tab's account group: same title and row labels as the settled+ * group, with placeholders only for the user's values. Rows the settled page+ * shows conditionally (password, email) follow the same conditions.+ */const SettingsProfileSkeleton = () => {const isLogin = useUserStore(authSelectors.isLogin);const email = useUserStore(userProfileSelectors.email);+ const disableEmailPassword = useServerConfigStore(serverConfigSelectors.disableEmailPassword);+ const text = useSkeletonText('auth');+ const label = (key: string, width: number) => {+ const node = text(key, width, 22);+ return typeof node === 'string' ? node : undefined;+ };+ const showPassword = !isDesktop && isLogin && !disableEmailPassword;return (<Form.Grouparia-busycollapsible={false}data-testid={'settings-profile-skeleton'}- title={<SkeletonBar height={18} width={80} />}+ title={text('profile.account', 80, 18)}variant={'filled'}><Flexbox><SettingsProfileRowSkeleton- actionNode={<SkeletonBar height={46} radius={cssVar.borderRadius} width={46} />}+ actionNode={<SkeletonBar height={40} radius={'50%'} width={40} />}body={null}- height={78}+ height={72}+ label={label('profile.avatar', 48)}/><div {...stylex.props(styles.divider)} />- <SettingsProfileRowSkeleton action={false} bodyWidth={194} height={68} labelWidth={72} />+ <SettingsProfileRowSkeleton+ action={false}+ bodyWidth={194}+ height={68}+ label={label('profile.fullName', 72)}+ labelWidth={72}+ /><div {...stylex.props(styles.divider)} />- <SettingsProfileRowSkeleton action={false} bodyWidth={194} height={68} labelWidth={88} />+ <SettingsProfileRowSkeleton+ action={false}+ bodyWidth={194}+ height={68}+ label={label('profile.username', 88)}+ labelWidth={88}+ /><div {...stylex.props(styles.divider)} /><SettingsProfileRowSkeletonaction={false}body={<InterestsSkeleton />}- height={210}+ label={label('profile.interests', 64)}labelWidth={64}/>+ {showPassword && (+ <>+ <div {...stylex.props(styles.divider)} />+ <SettingsProfileRowSkeleton+ actionNode={<SkeletonBar height={24} radius={cssVar.borderRadius} width={88} />}+ body={null}+ height={56}+ label={label('profile.password', 48)}+ labelWidth={48}+ />+ </>+ )}{isLogin && email && (<><div {...stylex.props(styles.divider)} />- <SettingsProfileRowSkeleton bodyWidth={184} height={54} labelWidth={96} />+ <SettingsProfileRowSkeleton+ bodyWidth={184}+ height={54}+ label={label('profile.email', 96)}+ labelWidth={96}+ />+ </>+ )}+ {isLogin && !isDesktop && (+ <>+ <div {...stylex.props(styles.divider)} />+ <SettingsProfileRowSkeleton+ action={false}+ bodyWidth={120}+ label={label('profile.sso.providers', 96)}+ labelWidth={96}+ /></>)}</Flexbox>diff --git a/src/components/Skeleton/Settings/Section.tsx b/src/components/Skeleton/Settings/Section.tsxindex 4a910be7d81..6726e6d61bb 100644--- a/src/components/Skeleton/Settings/Section.tsx+++ b/src/components/Skeleton/Settings/Section.tsx@@ -3,9 +3,12 @@import './Section.css';import { Flexbox } from '@lobehub/ui';-import { Form } from '@lobehub/ui/form';+import { Form, type FormGroupItem, useForm } from '@lobehub/ui/form';import { cssVar } from '@lobehub/ui/stylex/cssVar.stylex';import * as stylex from '@stylexjs/stylex';+import { type ReactNode } from 'react';++import { FORM_STYLE } from '@/const/layoutTokens';import SkeletonBar from '../Bar';@@ -34,17 +37,19 @@ export interface SettingsSectionSkeletonControl {const Row = ({control,index,+ label,withDesc,}: {control?: SettingsSectionSkeletonControl;index: number;+ label?: ReactNode;withDesc: boolean;}) => (<div {...stylex.props(styles.row)}>{/* Line boxes match the loaded label (14px / 22px) and description (12px / 13px) stack. */}<Flexbox gap={4}><Flexbox height={22} justify={'center'}>- <SkeletonBar height={16} width={112 + (index % 2) * 40} />+ {label ?? <SkeletonBar height={16} width={112 + (index % 2) * 40} />}</Flexbox>{withDesc && (<Flexbox height={13} justify={'center'}>@@ -68,12 +73,23 @@ export interface SettingsSectionSkeletonGroup {* (e.g. an image picker). The row grows with the control, as the loaded row does.*/controls?: Record<number, SettingsSectionSkeletonControl>;+ /** The group's description line under its title; `true` draws a placeholder bar. */+ desc?: ReactNode;+ /** Right side of the group head, e.g. a placeholder for the real group's action. */+ extra?: ReactNode;+ /** Real row labels by index. Static copy renders as text instead of a bar. */+ labels?: ReactNode[];/** Number of form rows, ideally the real group's field count. */rows: number;+ /** Real group title. Static copy renders as text instead of a bar. */+ title?: ReactNode;/** Width of the group title bar, close to the real title's rendered width. */titleWidth?: number;- /** Render the description line under each label. Hotkey-style forms have none. */- withDesc?: boolean;+ /**+ * Render the description line under each label. Hotkey-style forms have none;+ * pass an array to decide per row.+ */+ withDesc?: boolean | boolean[];}const DEFAULT_GROUPS: SettingsSectionSkeletonGroup[] = [@@ -84,26 +100,47 @@ const DEFAULT_GROUPS: SettingsSectionSkeletonGroup[] = [const Group = ({control,controls,+ desc,+ extra,+ labels,rows,+ title,titleWidth = 120,withDesc = true,}: SettingsSectionSkeletonGroup) => (<Form.GroupclassName={'lobe-section-96565f37-group'}collapsible={false}+ extra={extra}variant={'filled'}+ desc={+ desc === true ? (+ <Flexbox height={19} justify={'center'}>+ <SkeletonBar height={12} width={220} />+ </Flexbox>+ ) : (+ desc || undefined+ )+ }title={- // The loaded 16px bold title sits in a 25px line box.- <Flexbox height={25} justify={'center'}>- <SkeletonBar height={18} width={titleWidth} />- </Flexbox>+ title ?? (+ // The loaded 16px bold title sits in a 25px line box.+ <Flexbox height={25} justify={'center'}>+ <SkeletonBar height={18} width={titleWidth} />+ </Flexbox>+ )}><Flexbox>{Array.from({ length: rows }).map((_, index) => (<Flexbox key={index}>{index > 0 && <div {...stylex.props(styles.divider)} />}- <Row control={controls?.[index] ?? control} index={index} withDesc={withDesc} />+ <Row+ control={controls?.[index] ?? control}+ index={index}+ label={labels?.[index]}+ withDesc={Array.isArray(withDesc) ? (withDesc[index] ?? true) : withDesc}+ /></Flexbox>))}</Flexbox>@@ -111,6 +148,11 @@ const Group = ({);export interface SettingsSectionSkeletonProps {+ /**+ * Gap between groups. Groups of one `<Form itemsType="group">` sit 16px apart;+ * separate forms stacked in the settings container sit 36px apart.+ */+ gap?: number;/** One entry per `Form.Group` in the loaded form. Defaults to a 2-row + 3-row pair. */groups?: SettingsSectionSkeletonGroup[];}@@ -120,8 +162,11 @@ export interface SettingsSectionSkeletonProps {* `variant="filled"`: same filled group chrome, one label/description/control row* per field, so the real form swaps in without relayout.*/-const SettingsSectionSkeleton = ({ groups = DEFAULT_GROUPS }: SettingsSectionSkeletonProps) => (- <Flexbox aria-busy data-testid={'settings-section-skeleton'} gap={36}>+const SettingsSectionSkeleton = ({+ gap = 36,+ groups = DEFAULT_GROUPS,+}: SettingsSectionSkeletonProps) => (+ <Flexbox aria-busy data-testid={'settings-section-skeleton'} gap={gap}>{groups.map((group, index) => (<Group key={index} {...group} />))}@@ -129,3 +174,70 @@ const SettingsSectionSkeleton = ({ groups = DEFAULT_GROUPS }: SettingsSectionSke);export default SettingsSectionSkeleton;++export interface SettingsFormSkeletonItem {+ /** Placeholder for the field's control; defaults to a 32px input filling the control column. */+ control?: { height: number; radius?: number | string; width?: number | string } | ReactNode;+ /** The field's real description (static copy). */+ desc?: ReactNode;+ /** The field's real label (static copy). */+ label: ReactNode;+ /** The loaded field's layout, e.g. `vertical` for a full-width preview. */+ layout?: 'horizontal' | 'vertical';+ /** `FormItem` minWidth of the loaded field; switches pass `undefined` explicitly. */+ minWidth?: number | string;+}++export interface SettingsFormSkeletonGroup {+ desc?: ReactNode;+ extra?: ReactNode;+ items: SettingsFormSkeletonItem[];+ title: ReactNode;+}++/** A 36x22 placeholder in the shape of a `Switch`. */+export const SWITCH_CONTROL = { height: 22, radius: 11, width: 36 };++const isControlSize = (+ control: SettingsFormSkeletonItem['control'],+): control is { height: number; radius?: number | string; width?: number | string } =>+ !!control && typeof control === 'object' && 'height' in (control as object);++/**+ * Loading stand-in that renders the real settings `Form` (filled groups, real+ * titles, labels and descriptions) with placeholder bars in the control slots,+ * so the settled form replaces only the controls. Use it for tabs whose copy is+ * static; `SettingsSectionSkeleton` remains for forms whose rows are not known.+ */+export const SettingsFormSkeleton = ({ groups }: { groups: SettingsFormSkeletonGroup[] }) => {+ const form = useForm();+ const items: FormGroupItem[] = groups.map((group) => ({+ children: group.items.map(({ control, desc, label, layout, ...rest }) => ({+ children: isControlSize(control) ? (+ <SkeletonBar height={control.height} radius={control.radius} width={control.width} />+ ) : (+ (control ?? <SkeletonBar height={32} />)+ ),+ desc,+ label,+ layout,+ ...('minWidth' in rest ? { minWidth: rest.minWidth } : {}),+ })),+ desc: group.desc,+ extra: group.extra,+ title: group.title,+ }));++ return (+ <div aria-busy data-testid={'settings-form-skeleton'}>+ <Form+ collapsible={false}+ form={form}+ items={items}+ itemsType={'group'}+ variant={'filled'}+ {...FORM_STYLE}+ />+ </div>+ );+};diff --git a/src/components/Skeleton/Settings/Sections.tsx b/src/components/Skeleton/Settings/Sections.tsxindex 07b12f17475..a42b442f943 100644--- a/src/components/Skeleton/Settings/Sections.tsx+++ b/src/components/Skeleton/Settings/Sections.tsx@@ -7,6 +7,7 @@ import { Form } from '@lobehub/ui/form';import { cssVar } from '@lobehub/ui/stylex/cssVar.stylex';import * as stylex from '@stylexjs/stylex';import type { ComponentType, ReactNode } from 'react';+import { useTranslation } from 'react-i18next';import NavHeader from '@/features/NavHeader';import SettingContainer from '@/features/Setting/SettingContainer';@@ -15,15 +16,33 @@ import { sx } from '@/styles/sx';import SkeletonBar from '../Bar';+/** A static copy key: `[namespace, key]`. */+export type SettingsSkeletonTextKey = readonly [namespace: string, key: string];+/** Shared head options of every section rendered as a filled `Form.Group`. */interface GroupHeadOptions {/** The real group shows a description line under its title. */desc?: boolean;- /** The real group shows an action button on the right of its head. */- extra?: boolean;+ /** The real description is static copy: render it instead of a bar. */+ descKey?: SettingsSkeletonTextKey;+ /**+ * The real group shows an action on the right of its head; `true` is a+ * 120Γ32 button, or pass the action's size.+ */+ extra?: boolean | { height: number; width: number };+ /** The real title is static copy: render it instead of a bar. */+ heading?: SettingsSkeletonTextKey;titleWidth?: number;}+/** One captioned quota block: a two-column row of cells of `cellHeight`. */+interface QuotaBlockShape {+ caption?: SettingsSkeletonTextKey;+ cellHeight: number;+ /** Static label of each cell; the figures under it stay placeholders. */+ labels?: SettingsSkeletonTextKey[];+}+/*** One block of a settings page. Every variant except `cards` (ungrouped) and* `banner` is a filled `Form.Group`, so the skeleton reuses the real group@@ -31,13 +50,19 @@ interface GroupHeadOptions {*/export type SettingsSectionSkeleton =| (GroupHeadOptions & {- /** One full-width input with a trailing button instead of labelled rows. */- field?: boolean;+ /**+ * One full-width control instead of labelled rows: `true` is a 38px input+ * with a trailing button, `input` a 32px input, `snippet` a 38px copyable+ * snippet (its copy button sits inside).+ */+ field?: boolean | 'input' | 'snippet';/** Label + description on the left, control on the right. */rows?: number;variant: 'form';})| (GroupHeadOptions & {+ /** Number of table columns (default 5). */+ columns?: number;/** Table rows below the header row. */rows?: number;/** A filter / search bar above the table. */@@ -48,6 +73,11 @@ export type SettingsSectionSkeleton =})| (GroupHeadOptions & {columns?: number;+ /**+ * Borderless tiles 8px apart inside the padded group body, instead of+ * bordered tiles edge to edge.+ */+ inset?: boolean;/** Height of one tile; defaults to a two-line tile. */tileHeight?: number;/** Compact label + value tiles laid out edge to edge. */@@ -59,14 +89,33 @@ export type SettingsSectionSkeleton =aside?: { height: number; width: number };/** A second label/value pair plus a divider and a link row below the figure. */secondary?: boolean;+ /** A second column (label + link) right of a vertical rule. */+ split?: boolean;/** Label, one large figure and a caption line. */variant: 'summary';})| (GroupHeadOptions & {+ /** Checklist columns (default 1); `lines` are split across them. */+ columns?: number;+ /** The header starts with an icon tile (default true). */+ icon?: boolean;/** Icon + title header followed by a checklist. */lines?: number;variant: 'detail';})+ | (GroupHeadOptions & {+ /**+ * Captioned quota blocks edge to edge, each a two-column row of cells+ * of `cellHeight`.+ */+ blocks: QuotaBlockShape[];+ variant: 'quota';+ })+ | (GroupHeadOptions & {+ /** A numbered list of rule lines. */+ lines: number;+ variant: 'rules';+ })| (GroupHeadOptions & {cards?: number;columns?: number;@@ -126,6 +175,18 @@ const styles = stylex.create({backgroundImage: 'none',},grid: { display: 'grid' },+ quotaBlock: {+ borderBlockStartWidth: { 'default': '1px', ':first-child': '0' },+ borderBlockStartStyle: 'solid',+ borderBlockStartColor: cssVar.colorBorderSecondary,+ },+ rule: {+ flexShrink: 0,+ width: '1px',+ borderInlineStartWidth: '1px',+ borderInlineStartStyle: 'dashed',+ borderInlineStartColor: cssVar.colorBorderSecondary,+ },tile: {borderBlockEndWidth: '1px',borderBlockEndStyle: 'solid',@@ -152,24 +213,39 @@ const GroupDesc = () => (</Flexbox>);+/** Static copy as text once its namespace has loaded; `undefined` until then. */+const useStaticText = (key?: SettingsSkeletonTextKey) => {+ // Keys come from shape data, so they are untyped against the i18n resources.+ const { t, ready } = useTranslation((key?.[0] ?? 'common') as any);+ return key && ready ? (t(key[1] as any, { ns: key[0] as any }) as string) : undefined;+};+const Group = ({children,desc,+ descKey,extra,flush,+ heading,titleWidth,-}: GroupHeadOptions & { children: ReactNode; flush?: boolean }) => (- <Form.Group- className={flush ? 'lobe-sections-05ee388b-flush' : undefined}- collapsible={false}- desc={desc ? <GroupDesc /> : undefined}- extra={extra ? <SkeletonBar height={32} width={120} /> : undefined}- title={<GroupTitle width={titleWidth} />}- variant={'filled'}- >- {children}- </Form.Group>-);+}: GroupHeadOptions & { children: ReactNode; flush?: boolean }) => {+ const title = useStaticText(heading);+ const description = useStaticText(descKey);+ const extraSize = extra === true ? { height: 32, width: 120 } : extra || undefined;++ return (+ <Form.Group+ className={flush ? 'lobe-sections-05ee388b-flush' : undefined}+ collapsible={false}+ desc={description ?? (desc || descKey ? <GroupDesc /> : undefined)}+ extra={extraSize ? <SkeletonBar {...extraSize} /> : undefined}+ title={title ?? <GroupTitle width={titleWidth} />}+ variant={'filled'}+ >+ {children}+ </Form.Group>+ );+};const FormRows = ({ rows }: { rows: number }) => (<Flexbox>@@ -196,66 +272,102 @@ const FormRows = ({ rows }: { rows: number }) => (const TABLE_COLUMNS = [18, 12, 14, 16, 12];+const tableColumns = (count = TABLE_COLUMNS.length) =>+ Array.from({ length: count }, (_, index) => TABLE_COLUMNS[index % TABLE_COLUMNS.length]);+const TableBody = ({+ columns,rows,tabs,toolbar,}: {+ columns?: number;rows: number;tabs?: boolean;toolbar?: boolean;-}) => (- <Flexbox>- {tabs && (- <Flexbox horizontal align={'center'} gap={24} height={48} paddingInline={16}>- <SkeletonBar height={14} width={64} />- <SkeletonBar height={14} width={72} />- <SkeletonBar height={14} width={64} />- </Flexbox>- )}- {toolbar && (- <Flexbox horizontal align={'center'} gap={8} height={61} paddingInline={16}>- <Flexbox flex={2}>- <SkeletonBar height={32} />- </Flexbox>- <Flexbox flex={1}>- <SkeletonBar height={32} />+}) => {+ const flexes = tableColumns(columns);++ return (+ <Flexbox>+ {tabs && (+ <Flexbox horizontal align={'center'} gap={24} height={48} paddingInline={16}>+ <SkeletonBar height={14} width={64} />+ <SkeletonBar height={14} width={72} />+ <SkeletonBar height={14} width={64} /></Flexbox>- <Flexbox flex={1.5}>- <SkeletonBar height={32} />+ )}+ {toolbar && (+ <Flexbox horizontal align={'center'} gap={8} height={61} paddingInline={16}>+ <Flexbox flex={2}>+ <SkeletonBar height={32} />+ </Flexbox>+ <Flexbox flex={1}>+ <SkeletonBar height={32} />+ </Flexbox>+ <Flexbox flex={1.5}>+ <SkeletonBar height={32} />+ </Flexbox>+ <SkeletonBar height={32} width={72} /></Flexbox>- <SkeletonBar height={32} width={72} />+ )}+ <Flexbox horizontal align={'center'} gap={24} height={40} paddingInline={16}>+ {flexes.map((flex, index) => (+ <Flexbox flex={flex} key={index}>+ <SkeletonBar height={12} width={'48%'} />+ </Flexbox>+ ))}</Flexbox>- )}- <Flexbox horizontal align={'center'} gap={24} height={40} paddingInline={16}>- {TABLE_COLUMNS.map((flex, index) => (- <Flexbox flex={flex} key={index}>- <SkeletonBar height={12} width={'48%'} />+ {Array.from({ length: rows }).map((_, row) => (+ <Flexbox key={row}>+ <div {...stylex.props(styles.divider)} />+ <Flexbox horizontal align={'center'} gap={24} height={52} paddingInline={16}>+ {flexes.map((flex, index) => (+ <Flexbox flex={flex} key={index}>+ <SkeletonBar height={14} width={`${56 + ((row + index) % 3) * 14}%`} />+ </Flexbox>+ ))}+ </Flexbox></Flexbox>))}</Flexbox>- {Array.from({ length: rows }).map((_, row) => (- <Flexbox key={row}>- <div {...stylex.props(styles.divider)} />- <Flexbox horizontal align={'center'} gap={24} height={52} paddingInline={16}>- {TABLE_COLUMNS.map((flex, index) => (- <Flexbox flex={flex} key={index}>- <SkeletonBar height={14} width={`${56 + ((row + index) % 3) * 14}%`} />- </Flexbox>- ))}- </Flexbox>- </Flexbox>- ))}- </Flexbox>-);+ );+};-const Field = () => (- <Flexbox horizontal align={'center'} gap={8}>- <Flexbox flex={1}>- <SkeletonBar height={38} />+const Field = ({ kind }: { kind: true | 'input' | 'snippet' }) =>+ kind === true ? (+ <Flexbox horizontal align={'center'} gap={8}>+ <Flexbox flex={1}>+ <SkeletonBar height={38} />+ </Flexbox>+ <SkeletonBar height={38} width={88} /></Flexbox>- <SkeletonBar height={38} width={88} />- </Flexbox>+ ) : (+ <SkeletonBar height={kind === 'input' ? 32 : 38} />+ );++const InsetTiles = ({+ columns,+ tileHeight,+ tiles,+}: {+ columns: number;+ tileHeight: number;+ tiles: number;+}) => (+ <div+ {...sx([styles.grid], undefined, {+ gap: 8,+ gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`,+ })}+ >+ {Array.from({ length: tiles }).map((_, index) => (+ <Flexbox gap={12} height={tileHeight} justify={'center'} key={index}>+ <SkeletonBar height={14} width={widthAt(index, [56, 72, 64])} />+ <SkeletonBar height={24} width={widthAt(index, [32, 40, 72])} />+ </Flexbox>+ ))}+ </div>);const Tiles = ({@@ -292,9 +404,11 @@ const Tiles = ({const Summary = ({aside,secondary,+ split,}: {aside?: { height: number; width: number };secondary?: boolean;+ split?: boolean;}) => {const figures = secondary ? (<Flexbox flex={1} gap={16}>@@ -313,6 +427,17 @@ const Summary = ({</Flexbox>);+ if (split)+ return (+ <Flexbox horizontal gap={16}>+ {figures}+ <div {...stylex.props(styles.rule)} />+ <Flexbox flex={1} gap={19}>+ <SkeletonBar height={16} width={64} />+ <SkeletonBar height={14} width={72} />+ </Flexbox>+ </Flexbox>+ );if (!aside) return figures;return (<Flexbox horizontal gap={16}>@@ -333,17 +458,90 @@ const Checklist = ({ lines }: { lines: number }) => (</Flexbox>);-const Detail = ({ lines }: { lines: number }) => (+const Detail = ({+ columns = 1,+ icon = true,+ lines,+}: {+ columns?: number;+ icon?: boolean;+ lines: number;+}) => (<Flexbox gap={19}><Flexbox horizontal align={'center'} gap={12}>- <SkeletonBar height={40} radius={cssVar.borderRadiusLG} width={40} />+ {icon && <SkeletonBar height={40} radius={cssVar.borderRadiusLG} width={40} />}<Flexbox gap={6}><SkeletonBar height={16} width={96} />- <SkeletonBar height={12} width={200} />+ <SkeletonBar height={12} width={icon ? 200 : 96} /></Flexbox></Flexbox><div {...stylex.props(styles.divider)} />- <Checklist lines={lines} />+ <div+ {...sx([styles.grid], undefined, {+ columnGap: 24,+ gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`,+ })}+ >+ {Array.from({ length: columns }).map((_, column) => (+ <Checklist key={column} lines={Math.ceil(lines / columns)} />+ ))}+ </div>+ </Flexbox>+);++const QuotaCaption = ({ caption }: { caption?: SettingsSkeletonTextKey }) => {+ const text = useStaticText(caption);+ return (+ <Flexbox+ height={31}+ justify={'flex-end'}+ paddingInline={16}+ style={{ color: cssVar.colorTextSecondary, fontSize: 12, fontWeight: 500 }}+ >+ {text ?? (caption && <SkeletonBar height={12} width={48} />)}+ </Flexbox>+ );+};++const QuotaCellLabel = ({ index, label }: { index: number; label?: SettingsSkeletonTextKey }) => {+ const text = useStaticText(label);+ return text ? (+ <Flexbox height={22} justify={'center'}>+ {text}+ </Flexbox>+ ) : (+ <SkeletonBar height={14} width={widthAt(index, [48, 72])} />+ );+};++const Quota = ({ blocks }: { blocks: QuotaBlockShape[] }) => (+ <Flexbox>+ {blocks.map(({ caption, cellHeight, labels }, index) => (+ <div key={index} {...stylex.props(styles.quotaBlock)}>+ <QuotaCaption caption={caption} />+ <div+ {...sx([styles.grid], undefined, { gridTemplateColumns: 'repeat(2, minmax(0, 1fr))' })}+ >+ {[0, 1].map((cell) => (+ <Flexbox gap={10} height={cellHeight} justify={'center'} key={cell} paddingInline={16}>+ <QuotaCellLabel index={cell} label={labels?.[cell]} />+ <SkeletonBar height={18} width={widthAt(cell + index, [120, 96])} />+ </Flexbox>+ ))}+ </div>+ </div>+ ))}+ </Flexbox>+);++const Rules = ({ lines }: { lines: number }) => (+ <Flexbox gap={14}>+ {Array.from({ length: lines }).map((_, index) => (+ <Flexbox horizontal align={'center'} gap={12} height={22} key={index}>+ <SkeletonBar height={20} radius={'50%'} width={20} />+ <SkeletonBar height={14} width={`${52 + (index % 4) * 11}%`} />+ </Flexbox>+ ))}</Flexbox>);@@ -474,32 +672,61 @@ const Section = ({ section }: { section: SettingsSectionSkeleton }) => {case 'detail': {return (<Group {...section}>- <Detail lines={section.lines ?? 8} />+ <Detail columns={section.columns} icon={section.icon} lines={section.lines ?? 8} />+ </Group>+ );+ }+ case 'quota': {+ return (+ <Group {...section} flush>+ <Quota blocks={section.blocks} />+ </Group>+ );+ }+ case 'rules': {+ return (+ <Group {...section}>+ <Rules lines={section.lines} /></Group>);}case 'form': {return (<Group {...section}>- {section.field ? <Field /> : <FormRows rows={section.rows ?? 2} />}+ {section.field ? <Field kind={section.field} /> : <FormRows rows={section.rows ?? 2} />}</Group>);}case 'summary': {return (<Group {...section}>- <Summary aside={section.aside} secondary={section.secondary} />+ <Summary aside={section.aside} secondary={section.secondary} split={section.split} /></Group>);}case 'table': {return (<Group {...section} flush>- <TableBody rows={section.rows ?? 3} tabs={section.tabs} toolbar={section.toolbar} />+ <TableBody+ columns={section.columns}+ rows={section.rows ?? 3}+ tabs={section.tabs}+ toolbar={section.toolbar}+ /></Group>);}case 'tiles': {+ if (section.inset)+ return (+ <Group {...section}>+ <InsetTiles+ columns={section.columns ?? 2}+ tileHeight={section.tileHeight ?? 61}+ tiles={section.tiles ?? 4}+ />+ </Group>+ );return (<Group {...section} flush><Tilesdiff --git a/src/components/Skeleton/Settings/sectionShapes.ts b/src/components/Skeleton/Settings/sectionShapes.tsindex 90b01039519..bc0db92db14 100644--- a/src/components/Skeleton/Settings/sectionShapes.ts+++ b/src/components/Skeleton/Settings/sectionShapes.ts@@ -5,32 +5,61 @@ import type { SettingsSectionsShape } from './Sections';* Measured against the settled pages at a 1440px-wide window: filled group heads* are 57px (76px with a description, 64px with an action button), sections are* 36px apart, and the first section starts 24px below the navigation header.- * Rows below the first viewport are a plausible fill, not a promise.+ * Group titles and descriptions are static copy, so they render as text+ * (`heading` / `descKey`). Rows below the first viewport are a plausible fill.*/export const SETTINGS_SECTION_SHAPES: Record<string, SettingsSectionsShape> = {billing: {sections: [- { titleWidth: 72, variant: 'summary' },- { extra: true, lines: 13, titleWidth: 72, variant: 'detail' },- { rows: 1, titleWidth: 72, variant: 'table' },+ { heading: ['subscription', 'summary.title'], split: true, variant: 'summary' },+ {+ columns: 2,+ extra: { height: 32, width: 56 },+ heading: ['subscription', 'currentPlan.title'],+ icon: false,+ lines: 14,+ variant: 'detail',+ },+ { columns: 4, heading: ['subscription', 'billing.history'], rows: 1, variant: 'table' },],},credits: {sections: [- { aside: { height: 200, width: 350 }, secondary: true, titleWidth: 40, variant: 'summary' },+ {+ aside: { height: 200, width: 350 },+ heading: ['subscription', 'balance.title'],+ secondary: true,+ variant: 'summary',+ },{cards: 6,columns: 3,footer: true,gap: 8,grouped: true,+ heading: ['subscription', 'credits.topUp.titleUsd'],size: 'small',- titleWidth: 72,variant: 'cards',},- { desc: true, field: true, titleWidth: 112, variant: 'form' },- { desc: true, field: true, titleWidth: 72, variant: 'form' },- { tabs: true, rows: 2, titleWidth: 88, variant: 'table' },+ {+ descKey: ['subscription', 'credits.costEstimateHint.desc'],+ field: 'input',+ heading: ['subscription', 'credits.costEstimateHint.title'],+ variant: 'form',+ },+ {+ descKey: ['subscription', 'credits.autoTopUp.descUsd'],+ field: 'input',+ heading: ['subscription', 'credits.autoTopUp.title'],+ variant: 'form',+ },+ {+ extra: { height: 32, width: 348 },+ heading: ['subscription', 'credits.packages.titleUsd'],+ rows: 2,+ tabs: true,+ variant: 'table',+ },],},plans: {@@ -39,7 +68,7 @@ export const SETTINGS_SECTION_SHAPES: Record<string, SettingsSectionsShape> = {cards: 3,columns: 3,gap: 12,- toolbar: { gap: 24, height: 44, width: 304 },+ toolbar: { gap: 24, height: 44, width: 437 },variant: 'cards',},],@@ -47,16 +76,63 @@ export const SETTINGS_SECTION_SHAPES: Record<string, SettingsSectionsShape> = {referral: {sections: [{ variant: 'banner' },- { desc: true, field: true, titleWidth: 104, variant: 'form' },- { desc: true, field: true, titleWidth: 88, variant: 'form' },- { columns: 4, desc: true, tileHeight: 95, tiles: 4, titleWidth: 72, variant: 'tiles' },- { rows: 1, titleWidth: 72, variant: 'table' },+ {+ descKey: ['subscription', 'referral.inviteLink.description'],+ field: 'snippet',+ heading: ['subscription', 'referral.inviteLink.title'],+ variant: 'form',+ },+ {+ descKey: ['subscription', 'referral.inviteCode.description'],+ extra: { height: 24, width: 24 },+ field: 'snippet',+ heading: ['subscription', 'referral.inviteCode.title'],+ variant: 'form',+ },+ {+ columns: 4,+ descKey: ['subscription', 'referral.stats.description'],+ heading: ['subscription', 'referral.stats.title'],+ inset: true,+ tileHeight: 61,+ tiles: 4,+ variant: 'tiles',+ },+ { columns: 5, heading: ['subscription', 'referral.table.title'], rows: 1, variant: 'table' },+ {+ descKey: ['subscription', 'referral.rules.description'],+ heading: ['subscription', 'referral.rules.title'],+ lines: 7,+ variant: 'rules',+ },],},usage: {sections: [- { columns: 2, tiles: 4, titleWidth: 40, variant: 'tiles' },- { rows: 4, titleWidth: 40, toolbar: true, variant: 'table' },+ {+ blocks: [+ {+ caption: ['subscription', 'usage.overview.section.balance'],+ cellHeight: 95,+ labels: [+ ['subscription', 'usage.window.credits'],+ ['subscription', 'usage.window.referral'],+ ],+ },+ {+ caption: ['subscription', 'usage.overview.section.storage'],+ cellHeight: 70,+ labels: [+ ['subscription', 'usage.storage.file.used'],+ ['subscription', 'usage.storage.embeddings.used'],+ ],+ },+ ],+ extra: { height: 24, width: 146 },+ heading: ['subscription', 'usage.overview.title'],+ variant: 'quota',+ },+ { columns: 8, heading: ['spend', 'table.title'], rows: 10, toolbar: true, variant: 'table' },],},};diff --git a/src/components/Skeleton/Settings/tabs/APIKey.tsx b/src/components/Skeleton/Settings/tabs/APIKey.tsxnew file mode 100644index 00000000000..e741c5226f3--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/APIKey.tsx@@ -0,0 +1,74 @@+'use client';++import { Flexbox, Text } from '@lobehub/ui';+import { cssVar } from '@lobehub/ui/stylex/cssVar.stylex';++import LiteTable, { type LiteTableColumn } from '@/components/LiteTable';++import SkeletonBar from '../../Bar';+import { useSkeletonText } from '../useSkeletonText';+import type { SettingsTabSkeleton } from './types';++/** A header-only column: the skeleton rows never call `render`. */+const headColumn = (column: Partial<LiteTableColumn<never>> & { key: string }) =>+ ({ render: () => null, title: '', ...column }) as LiteTableColumn<never>;++/**+ * The API key list: the titled header with its docs and create buttons above+ * the table, whose column heads are static copy. `LiteTable` draws the same+ * skeleton rows it shows while the list loads, so the hand-off is a cell swap.+ */+const Body = () => {+ const text = useSkeletonText('auth');++ const columns = [+ headColumn({ key: 'name', listSlot: 'title', title: text('apikey.list.columns.name', 40, 14) }),+ headColumn({ key: 'key', title: text('apikey.list.columns.key', 40, 14), width: 220 }),+ headColumn({ key: 'scopes', title: text('apikey.list.columns.scopes', 40, 14), width: 110 }),+ headColumn({+ key: 'expiresAt',+ title: text('apikey.list.columns.expiresAt', 56, 14),+ width: 130,+ }),+ headColumn({ key: 'lastUsedAt', title: text('apikey.list.columns.lastUsedAt', 56, 14) }),+ headColumn({ key: 'actions', listSlot: 'extra', width: 48 }),+ ];++ return (+ <div+ aria-busy+ style={{+ background: cssVar.colorBgContainer,+ borderRadius: cssVar.borderRadius,+ overflow: 'hidden',+ paddingBlock: 16,+ }}+ >+ <Flexbox+ horizontal+ align={'flex-start'}+ gap={16}+ justify={'space-between'}+ style={{ paddingBlockEnd: 16, paddingInline: 24 }}+ >+ <Flexbox gap={4}>+ <Text as={'h3'} style={{ fontSize: 16, fontWeight: 500, margin: 0 }}>+ {text('apikey.list.title', 72)}+ </Text>+ <Text style={{ fontSize: 13 }} type={'secondary'}>+ {text('apikey.list.desc', 280, 13)}+ </Text>+ </Flexbox>+ <Flexbox horizontal gap={8}>+ <SkeletonBar height={32} radius={8} width={96} />+ <SkeletonBar height={32} radius={8} width={88} />+ </Flexbox>+ </Flexbox>+ <LiteTable loading columns={columns} rowKey={() => ''} />+ </div>+ );+};++const APIKeySkeleton: SettingsTabSkeleton = { Body };++export default APIKeySkeleton;diff --git a/src/components/Skeleton/Settings/tabs/About.tsx b/src/components/Skeleton/Settings/tabs/About.tsxnew file mode 100644index 00000000000..d4644b545c6--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/About.tsx@@ -0,0 +1,108 @@+'use client';++import { BRANDING_NAME } from '@lobechat/business-const';+import { Divider, Flexbox, Grid } from '@lobehub/ui';+import { Form } from '@lobehub/ui/form';+import { cssVar } from '@lobehub/ui/stylex/cssVar.stylex';+import { useTranslation } from 'react-i18next';++import SkeletonBar from '../../Bar';+import { SettingsFormSkeleton, SWITCH_CONTROL } from '../Section';+import { useSkeletonText } from '../useSkeletonText';+import type { SettingsTabSkeleton } from './types';++const SOCIAL_COUNT = 5;++const sectionTitle = {+ color: cssVar.colorTextSecondary,+ fontSize: 14,+ fontWeight: 'bold',+} as const;++/** A row of external links (contact / legal); the labels are static copy. */+const LinkRow = ({ keys }: { keys: string[] }) => {+ const common = useSkeletonText('common');+ return (+ <Flexbox horizontal align={'center'} gap={24} wrap={'wrap'}>+ {keys.map((key) => (+ <Flexbox horizontal align={'center'} gap={8} key={key}>+ {common(key, 56, 14)}+ <SkeletonBar height={14} width={14} />+ </Flexbox>+ ))}+ </Flexbox>+ );+};++/**+ * The "About" group (logo + version row, the five social cards, contact and+ * legal links) above the single-row analytics group.+ */+const Body = () => {+ const { t, ready } = useTranslation('common');+ const setting = useSkeletonText('setting');+ const { t: tSetting, ready: settingReady } = useTranslation('setting');++ return (+ <>+ <Form.Group+ collapsible={false}+ style={{ maxWidth: '1024px', width: '100%' }}+ title={ready ? `${t('about')} ${BRANDING_NAME}` : <SkeletonBar height={18} width={104} />}+ variant={'filled'}+ >+ <Flexbox gap={20} paddingBlock={20} width={'100%'}>+ <Flexbox horizontal align={'center'} gap={16} justify={'space-between'} width={'100%'}>+ <Flexbox horizontal align={'center'} gap={16}>+ <SkeletonBar height={64} radius={16} width={64} />+ <Flexbox align={'flex-start'} gap={6}>+ <div style={{ fontSize: 18, fontWeight: 'bolder' }}>{BRANDING_NAME}</div>+ <SkeletonBar height={22} width={56} />+ </Flexbox>+ </Flexbox>+ <SkeletonBar height={32} radius={8} width={80} />+ </Flexbox>+ <Divider style={{ marginBlock: 0 }} />+ <Grid gap={8} maxItemWidth={160} rows={SOCIAL_COUNT} width={'100%'}>+ {Array.from({ length: SOCIAL_COUNT }, (_, index) => (+ <SkeletonBar height={46} key={index} radius={8} />+ ))}+ </Grid>+ <Divider style={{ marginBlock: 0 }} />+ <div style={sectionTitle}>+ {ready ? t('contact') : <SkeletonBar height={14} width={56} />}+ </div>+ <LinkRow keys={['officialSite', 'mail.support', 'mail.business']} />+ <Divider style={{ marginBlock: 0 }} />+ <div style={sectionTitle}>+ {ready ? t('legal') : <SkeletonBar height={14} width={56} />}+ </div>+ <LinkRow keys={['terms', 'privacy']} />+ </Flexbox>+ </Form.Group>+ <SettingsFormSkeleton+ groups={[+ {+ items: [+ {+ control: SWITCH_CONTROL,+ desc: settingReady ? (+ tSetting('analytics.telemetry.desc', { appName: BRANDING_NAME })+ ) : (+ <SkeletonBar height={12} width={220} />+ ),+ label: setting('analytics.telemetry.title', 112, 14),+ minWidth: undefined,+ },+ ],+ title: setting('analytics.title', 64),+ },+ ]}+ />+ </>+ );+};++const AboutSkeleton: SettingsTabSkeleton = { Body };++export default AboutSkeleton;diff --git a/src/components/Skeleton/Settings/tabs/Advanced.tsx b/src/components/Skeleton/Settings/tabs/Advanced.tsxnew file mode 100644index 00000000000..6d6b39afbef--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/Advanced.tsx@@ -0,0 +1,60 @@+'use client';++import { isDesktop } from '@lobechat/const';++import { serverConfigSelectors, useServerConfigStore } from '@/store/serverConfig';++import { SettingsFormSkeleton, SWITCH_CONTROL } from '../Section';+import { useSkeletonText } from '../useSkeletonText';+import type { SettingsTabSkeleton } from './types';++/** Tools group (dev mode + gateway mode when enabled) and, on desktop, the update channel. */+const Body = () => {+ const text = useSkeletonText('setting');+ const enableGatewayMode = useServerConfigStore(serverConfigSelectors.enableGatewayMode);++ return (+ <SettingsFormSkeleton+ groups={[+ {+ items: [+ {+ control: SWITCH_CONTROL,+ desc: text('settingCommon.devMode.desc', 240, 12),+ label: text('settingCommon.devMode.title', 96),+ minWidth: undefined,+ },+ ...(enableGatewayMode+ ? [+ {+ control: SWITCH_CONTROL,+ desc: text('tab.advanced.gatewayMode.desc', 280, 12),+ label: text('tab.advanced.gatewayMode.title', 112),+ minWidth: undefined,+ },+ ]+ : []),+ ],+ title: text('tab.advanced.toolsAndDiagnostics.title', 160, 16),+ },+ ...(isDesktop+ ? [+ {+ items: [+ {+ desc: text('tab.advanced.updateChannel.desc', 240, 12),+ label: text('tab.advanced.updateChannel.title', 96),+ },+ ],+ title: text('tab.advanced.appUpdates.title', 112, 16),+ },+ ]+ : []),+ ]}+ />+ );+};++const AdvancedSkeleton: SettingsTabSkeleton = { Body };++export default AdvancedSkeleton;diff --git a/src/components/Skeleton/Settings/tabs/Appearance.tsx b/src/components/Skeleton/Settings/tabs/Appearance.tsxnew file mode 100644index 00000000000..9a1428d6bfa--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/Appearance.tsx@@ -0,0 +1,259 @@+'use client';++import { isDesktop } from '@lobechat/const';+import { Flexbox } from '@lobehub/ui';+import { Form } from '@lobehub/ui/form';++import SkeletonBar from '../../Bar';+import { SettingsFormSkeleton, SWITCH_CONTROL } from '../Section';+import { useSkeletonText } from '../useSkeletonText';+import type { SettingsTabSkeleton } from './types';++/** The idle auto-save hint ("loaded the latest version") on the right of a group head. */+const SAVE_HINT = <SkeletonBar height={20} width={102} />;++/** A `Select` at 50% of the 335px control column, right-aligned as the loaded one. */+const HALF_SELECT = (+ <Flexbox horizontal justify={'flex-end'} width={'100%'}>+ <SkeletonBar height={32} width={'50%'} />+ </Flexbox>+);++/** General: theme picker, language, motion, context menu and reply language. */+export const CommonSectionSkeleton = () => {+ const text = useSkeletonText('setting');++ return (+ <SettingsFormSkeleton+ groups={[+ {+ extra: SAVE_HINT,+ items: [+ {+ control: { height: 86, radius: 8, width: 332 },+ label: text('settingCommon.themeMode.title', 32, 14),+ minWidth: undefined,+ },+ { control: HALF_SELECT, label: text('settingCommon.lang.title', 32, 14) },+ {+ control: { height: 38, radius: 8, width: 230 },+ label: text('settingAppearance.animationMode.title', 64, 14),+ minWidth: undefined,+ },+ {+ control: { height: 38, radius: 8, width: 165 },+ label: text('settingAppearance.contextMenuMode.title', 84, 14),+ minWidth: undefined,+ },+ {+ control: HALF_SELECT,+ label: text('settingCommon.responseLanguage.title', 64, 14),+ },+ ],+ title: text('settingCommon.title', 72),+ },+ ]}+ />+ );+};++/** Theme: the 332x200 preview, then the primary and neutral swatch rows. */+export const AppearanceSectionSkeleton = () => {+ const text = useSkeletonText('setting');++ return (+ <SettingsFormSkeleton+ groups={[+ {+ extra: SAVE_HINT,+ items: [+ {+ control: { height: 200, radius: 8, width: 332 },+ label: text('settingAppearance.preview.title', 48, 14),+ minWidth: undefined,+ },+ {+ control: { height: 24, radius: 12, width: 425 },+ label: text('settingAppearance.primaryColor.title', 48, 14),+ minWidth: undefined,+ },+ {+ control: { height: 24, radius: 12, width: 174 },+ label: text('settingAppearance.neutralColor.title', 48, 14),+ minWidth: undefined,+ },+ ],+ title: text('settingAppearance.title', 72),+ },+ ]}+ />+ );+};++/** Electron only: the tray-icon switch. */+const DesktopSectionSkeleton = () => {+ const text = useSkeletonText('setting');+ if (!isDesktop) return null;++ return (+ <SettingsFormSkeleton+ groups={[+ {+ items: [+ {+ control: SWITCH_CONTROL,+ label: text('settingAppearance.appTray.title', 96, 14),+ minWidth: undefined,+ },+ ],+ title: text('settingAppearance.desktop.title', 48),+ },+ ]}+ />+ );+};++/**+ * Fonts: the four font-stack rows (Electron only), antialiasing, and the+ * vertical font-size slider with its preview line.+ */+export const FontSectionSkeleton = () => {+ const text = useSkeletonText('setting');+ const fontRow = (key: string) => ({+ control: { height: 32, width: 320 },+ desc: text(`settingAppearance.font.${key}.desc`, 240, 12),+ label: text(`settingAppearance.font.${key}.title`, 96, 14),+ minWidth: undefined,+ });++ return (+ <SettingsFormSkeleton+ groups={[+ {+ extra: SAVE_HINT,+ items: [+ ...(isDesktop+ ? ['fontFamily', 'fallback', 'monospace', 'monospaceFallback'].map(fontRow)+ : []),+ {+ control: SWITCH_CONTROL,+ desc: text('settingAppearance.font.antialiasing.desc', 360, 12),+ label: text('settingAppearance.font.antialiasing.title', 72, 14),+ minWidth: undefined,+ },+ {+ control: (+ <Flexbox gap={16} width={'100%'}>+ <Flexbox gap={24}>+ <SkeletonBar height={4} />+ <Flexbox horizontal align={'center'} justify={'space-between'}>+ <SkeletonBar height={14} width={12} />+ <SkeletonBar height={14} width={40} />+ <SkeletonBar height={14} width={12} />+ </Flexbox>+ </Flexbox>+ <Flexbox justify={'center'} style={{ height: 30 }}>+ <SkeletonBar height={16} width={340} />+ </Flexbox>+ </Flexbox>+ ),+ desc: text('settingChatAppearance.fontSize.desc', 72, 12),+ label: text('settingChatAppearance.fontSize.title', 56, 14),+ layout: 'vertical',+ minWidth: '100%',+ },+ ],+ title: text('settingAppearance.font.title', 32),+ },+ ]}+ />+ );+};++/**+ * Chat appearance: four separate blocks (36px apart in the settings container):+ * transition preview, chat-behaviour switches, code and Mermaid theme previews.+ */+export const ChatAppearanceSectionSkeleton = () => {+ const text = useSkeletonText('setting');++ return (+ <>+ <Form.Group+ collapsible={false}+ extra={<SkeletonBar height={38} radius={8} width={151} />}+ title={text('settingChatAppearance.transitionMode.title', 64)}+ variant={'filled'}+ >+ <SkeletonBar height={182} radius={8} />+ </Form.Group>+ <SettingsFormSkeleton+ groups={[+ {+ items: [+ {+ control: SWITCH_CONTROL,+ label: text('settingChatAppearance.autoScrollOnStreaming.title', 120, 14),+ minWidth: undefined,+ },+ {+ control: SWITCH_CONTROL,+ label: text('settingChatAppearance.workflowStreamingExpand.title', 120, 14),+ minWidth: undefined,+ },+ {+ control: SWITCH_CONTROL,+ // The loaded description is a two-line link preview.+ desc: (+ <Flexbox gap={6} paddingBlock={4}>+ <SkeletonBar height={14} width={160} />+ <SkeletonBar height={14} width={200} />+ </Flexbox>+ ),+ label: text('settingChatAppearance.linkIcon.title', 120, 14),+ minWidth: undefined,+ },+ {+ control: SWITCH_CONTROL,+ desc: text('settingChatAppearance.pasteAutoConvert.desc', 360, 12),+ label: text('settingChatAppearance.pasteAutoConvert.title', 120, 14),+ minWidth: undefined,+ },+ ],+ title: text('settingChatAppearance.chatBehavior.title', 64),+ },+ ]}+ />+ <Form.Group+ collapsible={false}+ extra={<SkeletonBar height={32} width={240} />}+ title={text('settingChatAppearance.highlighterTheme.title', 96)}+ variant={'filled'}+ >+ <SkeletonBar height={167} radius={8} />+ </Form.Group>+ <Form.Group+ extra={<SkeletonBar height={32} width={240} />}+ title={text('settingChatAppearance.mermaidTheme.title', 96)}+ variant={'filled'}+ >+ <SkeletonBar height={295} radius={8} />+ </Form.Group>+ </>+ );+};++/** The five appearance sections, as direct children of the 36px-gap settings container. */+const Body = () => (+ <>+ <CommonSectionSkeleton />+ <AppearanceSectionSkeleton />+ <DesktopSectionSkeleton />+ <FontSectionSkeleton />+ <ChatAppearanceSectionSkeleton />+ </>+);++const AppearanceSkeleton: SettingsTabSkeleton = { Body };++export default AppearanceSkeleton;diff --git a/src/components/Skeleton/Settings/tabs/Billing.tsx b/src/components/Skeleton/Settings/tabs/Billing.tsxnew file mode 100644index 00000000000..15b9dd81bba--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/Billing.tsx@@ -0,0 +1,11 @@+'use client';++import { SettingsSectionsBody } from '../Sections';+import { SETTINGS_SECTION_SHAPES } from '../sectionShapes';+import type { SettingsTabSkeleton } from './types';++const Body = () => <SettingsSectionsBody shape={SETTINGS_SECTION_SHAPES.billing} />;++const BillingSkeleton: SettingsTabSkeleton = { Body };++export default BillingSkeleton;diff --git a/src/components/Skeleton/Settings/tabs/Connector.tsx b/src/components/Skeleton/Settings/tabs/Connector.tsxnew file mode 100644index 00000000000..18fb5678d4c--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/Connector.tsx@@ -0,0 +1,116 @@+'use client';++import { cssVar, Flexbox, Text } from '@lobehub/ui';+import { useTranslation } from 'react-i18next';++import SkeletonBar from '../../Bar';+import { SettingsSkeletonHeader } from '../Frame';+import { SkillNavListSkeleton } from './Skill';+import type { SettingsTabSkeleton } from './types';++const SECTIONS = [+ { key: 'skillGroup.builtinTools', rows: 5 },+ { key: 'skillGroup.communityConnectors', rows: 4 },+] as const;++const Line = ({ bar, height, width }: { bar: number; height: number; width: number | string }) => (+ <Flexbox height={height} justify={'center'} style={{ minWidth: 0 }}>+ <SkeletonBar height={bar} width={width} />+ </Flexbox>+);++/** The Store icon button and "Add Custom Connector" button on the intro row. */+const PageActions = () => (+ <Flexbox horizontal flex={'none'} gap={8}>+ <SkeletonBar height={32} width={32} />+ <SkeletonBar height={32} width={176} />+ </Flexbox>+);++/**+ * The connector page list (`LeftPanel` in page mode): the intro line with the+ * page actions, then+ * per group a 13px heading with its count and `SkillListRow` page rows β a 36px+ * icon tile, title + summary, status and chevron in a 60px row. Headings and+ * the intro are static copy.+ */+const PageList = () => {+ const { t } = useTranslation('setting');++ return (+ <Flexbox aria-busy data-testid={'settings-connector-skeleton'}>+ <Flexbox+ horizontal+ align={'center'}+ gap={16}+ justify={'space-between'}+ paddingInline={12}+ style={{ flexShrink: 0, paddingBlock: '24px 4px' }}+ >+ <Text type={'secondary'}>{t('skillView.connectorsDesc')}</Text>+ <PageActions />+ </Flexbox>+ <Flexbox gap={2} style={{ paddingBlockEnd: 24 }}>+ {SECTIONS.map(({ key, rows }) => (+ <Flexbox gap={2} key={key}>+ <Flexbox+ horizontal+ align={'center'}+ gap={8}+ paddingInline={12}+ style={{ paddingBlock: '24px 8px' }}+ >+ <Text fontSize={13} weight={600}>+ {t(key)}+ </Text>+ <SkeletonBar height={12} width={16} />+ </Flexbox>+ {Array.from({ length: rows }, (_, index) => (+ <Flexbox+ horizontal+ align={'center'}+ gap={12}+ key={index}+ paddingBlock={10}+ paddingInline={12}+ style={{ minHeight: 60 }}+ >+ <SkeletonBar height={36} radius={cssVar.borderRadius} width={36} />+ <Flexbox flex={1} gap={2} style={{ minWidth: 0 }}>+ <Line bar={14} height={22} width={96 + (index % 3) * 32} />+ <Line bar={12} height={18} width={`${48 + (index % 2) * 16}%`} />+ </Flexbox>+ <Line bar={12} height={20} width={56} />+ <SkeletonBar height={16} width={16} />+ </Flexbox>+ ))}+ </Flexbox>+ ))}+ </Flexbox>+ </Flexbox>+ );+};++/**+ * `ToolSettings` in connector mode draws its own header over a centred 960px+ * column, so the skeleton draws that frame itself.+ */+const Page = () => (+ <Flexbox aria-busy flex={1} height={'100%'} style={{ minHeight: 0, overflow: 'hidden' }}>+ <SettingsSkeletonHeader tab={'connector'} />+ <Flexbox horizontal flex={1} justify={'center'} style={{ overflow: 'hidden' }}>+ <Flexbox style={{ maxWidth: 960, width: '100%' }}>+ <PageList />+ </Flexbox>+ </Flexbox>+ </Flexbox>+);++/** Mobile renders the nav-style list (title + add + store buttons) under the mobile header. */+const Body = () => (+ <SkillNavListSkeleton fullWidth sections={[...SECTIONS]} titleKey={'skillView.connectors'} />+);++const ConnectorSkeleton: SettingsTabSkeleton = { Body, Page };++export default ConnectorSkeleton;diff --git a/src/components/Skeleton/Settings/tabs/Credits.tsx b/src/components/Skeleton/Settings/tabs/Credits.tsxnew file mode 100644index 00000000000..694da759697--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/Credits.tsx@@ -0,0 +1,11 @@+'use client';++import { SettingsSectionsBody } from '../Sections';+import { SETTINGS_SECTION_SHAPES } from '../sectionShapes';+import type { SettingsTabSkeleton } from './types';++const Body = () => <SettingsSectionsBody shape={SETTINGS_SECTION_SHAPES.credits} />;++const CreditsSkeleton: SettingsTabSkeleton = { Body };++export default CreditsSkeleton;diff --git a/src/components/Skeleton/Settings/tabs/Creds.tsx b/src/components/Skeleton/Settings/tabs/Creds.tsxnew file mode 100644index 00000000000..b7ff096ec33--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/Creds.tsx@@ -0,0 +1,57 @@+'use client';++import { cssVar, Flexbox } from '@lobehub/ui';++import SkeletonBar from '../../Bar';+import type { SettingsTabSkeleton } from './types';++const ROW_WIDTHS = [+ [120, 168],+ [96, 216],+ [144, 136],+ [112, 184],+];++/**+ * Credential rows as `CredItem` lays them out: 12px block padding, a 48px icon+ * tile, a name + type-tag line over a key line, and the "..." menu button. Rows+ * sit edge to edge (gap 0), like the settled list.+ */+export const CredsListSkeleton = ({ rows = 4 }: { rows?: number }) => (+ <Flexbox aria-busy data-testid={'settings-creds-skeleton'} gap={0} width={'100%'}>+ {Array.from({ length: rows }, (_, index) => {+ const [title, key] = ROW_WIDTHS[index % ROW_WIDTHS.length];+ return (+ <Flexbox+ horizontal+ align={'center'}+ gap={16}+ justify={'space-between'}+ key={index}+ style={{ paddingBlock: 12 }}+ >+ <Flexbox horizontal align={'center'} flex={1} gap={16}>+ <SkeletonBar height={48} radius={12} width={48} />+ <Flexbox gap={4}>+ <Flexbox horizontal align={'center'} gap={8} height={22}>+ <SkeletonBar height={15} width={title} />+ <SkeletonBar height={22} radius={cssVar.borderRadiusSM} width={52} />+ </Flexbox>+ <Flexbox height={18} justify={'center'}>+ <SkeletonBar height={12} width={key} />+ </Flexbox>+ </Flexbox>+ </Flexbox>+ <SkeletonBar height={32} width={32} />+ </Flexbox>+ );+ })}+ </Flexbox>+);++/** The small primary "Create" button the page portals into the header. */+const PageActions = () => <SkeletonBar height={32} width={96} />;++const CredsSkeleton: SettingsTabSkeleton = { Body: () => <CredsListSkeleton />, PageActions };++export default CredsSkeleton;diff --git a/src/components/Skeleton/Settings/tabs/Devices.tsx b/src/components/Skeleton/Settings/tabs/Devices.tsxnew file mode 100644index 00000000000..997142abaaa--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/Devices.tsx@@ -0,0 +1,30 @@+'use client';++import { Flexbox } from '@lobehub/ui';++import { DeviceDetailSkeleton, DeviceGridSkeleton } from '@/features/DeviceManager/Skeleton';++import SkeletonBar from '../../Bar';+import type { SettingsTabSkeleton, SettingsTabSkeletonProps } from './types';++/**+ * `/settings/devices` is the card grid (the personal pool has no visibility+ * tabs, so its refresh + connect actions sit in the settings header);+ * `/settings/devices/:id` is one device's detail page. Both reuse the skeletons+ * `DeviceManager` and `DeviceDetailPage` show while their data loads.+ */+const Body = ({ sub }: SettingsTabSkeletonProps) =>+ sub ? <DeviceDetailSkeleton /> : <DeviceGridSkeleton />;++/** Small refresh + "Connect device" buttons, list page only. */+const PageActions = ({ sub }: SettingsTabSkeletonProps) =>+ sub ? null : (+ <Flexbox horizontal align={'center'} gap={8}>+ <SkeletonBar height={32} width={32} />+ <SkeletonBar height={32} width={112} />+ </Flexbox>+ );++const DevicesSkeleton: SettingsTabSkeleton = { Body, PageActions };++export default DevicesSkeleton;diff --git a/src/components/Skeleton/Settings/tabs/Environments.tsx b/src/components/Skeleton/Settings/tabs/Environments.tsxnew file mode 100644index 00000000000..bac60122354--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/Environments.tsx@@ -0,0 +1,17 @@+'use client';++import { Flexbox } from '@lobehub/ui';++import { EnvironmentManagerSkeleton } from '@/features/EnvironmentManager/Skeleton';++import type { SettingsTabSkeleton } from './types';++const Body = () => (+ <Flexbox style={{ maxWidth: 1024, width: '100%' }}>+ <EnvironmentManagerSkeleton />+ </Flexbox>+);++const EnvironmentsSkeleton: SettingsTabSkeleton = { Body };++export default EnvironmentsSkeleton;diff --git a/src/components/Skeleton/Settings/tabs/Hotkey.tsx b/src/components/Skeleton/Settings/tabs/Hotkey.tsxnew file mode 100644index 00000000000..c271cb106bf--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/Hotkey.tsx@@ -0,0 +1,95 @@+'use client';++import { isDesktop } from '@lobechat/const';+import { HotkeyGroupEnum } from '@lobechat/const/hotkeys';++import { DESKTOP_HOTKEYS_REGISTRATION } from '@/const/desktopGlobalShortcuts';+import { HOTKEYS_REGISTRATION } from '@/const/hotkeys';++import SkeletonBar from '../../Bar';+import { SettingsFormSkeleton } from '../Section';+import { useSkeletonText } from '../useSkeletonText';+import type { SettingsTabSkeleton } from './types';++/** Hotkey recorder inputs settle at 335x36. */+const RECORDER = { height: 36, radius: 8, width: 335 };++/** One hotkey group: real group title and shortcut names, recorder placeholders. */+const HotkeyGroupSkeleton = ({+ desc,+ labelKeys,+ rows,+ titleKey,+}: {+ desc?: string;+ labelKeys?: string[];+ rows?: number;+ titleKey: string;+}) => {+ const setting = useSkeletonText('setting');+ const hotkey = useSkeletonText('hotkey');+ const labels = labelKeys+ ? labelKeys.map((key) => hotkey(key, 96, 14))+ : Array.from({ length: rows ?? 0 }, (_, index) => (+ <SkeletonBar height={14} key={index} width={96 + (index % 3) * 24} />+ ));++ return (+ <SettingsFormSkeleton+ groups={[+ {+ desc: desc && setting(desc, 220, 12),+ items: labels.map((label) => ({ control: RECORDER, label })),+ title: setting(titleKey, 96),+ },+ ]}+ />+ );+};++const groupKeys = (group: (typeof HotkeyGroupEnum)[keyof typeof HotkeyGroupEnum]) =>+ HOTKEYS_REGISTRATION.filter((item) => item.group === group).map((item) => `${item.id}.title`);++export const EssentialHotkeysSkeleton = () => (+ <HotkeyGroupSkeleton+ labelKeys={groupKeys(HotkeyGroupEnum.Essential)}+ titleKey={'hotkey.group.essential'}+ />+);++export const ConversationHotkeysSkeleton = () => (+ <HotkeyGroupSkeleton+ labelKeys={groupKeys(HotkeyGroupEnum.Conversation)}+ titleKey={'hotkey.group.conversation'}+ />+);++export const DesktopHotkeysSkeleton = () => (+ <HotkeyGroupSkeleton+ labelKeys={DESKTOP_HOTKEYS_REGISTRATION.map((item) => `desktop.${item.id}.title`)}+ titleKey={'hotkey.group.desktop'}+ />+);++/** The app-menu shortcuts come from the live Electron menu, so their names are unknown here. */+export const AppMenuHotkeysSkeleton = () => (+ <HotkeyGroupSkeleton+ desc={'hotkey.group.appMenuDesc'}+ rows={8}+ titleKey={'hotkey.group.appMenu'}+ />+);++/** Desktop shortcuts (Electron), essential, conversation and app-menu (Electron) groups. */+const Body = () => (+ <>+ {isDesktop && <DesktopHotkeysSkeleton />}+ <EssentialHotkeysSkeleton />+ <ConversationHotkeysSkeleton />+ {isDesktop && <AppMenuHotkeysSkeleton />}+ </>+);++const HotkeySkeleton: SettingsTabSkeleton = { Body };++export default HotkeySkeleton;diff --git a/src/components/Skeleton/Settings/tabs/Integrations.tsx b/src/components/Skeleton/Settings/tabs/Integrations.tsxnew file mode 100644index 00000000000..ea48aa8ce09--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/Integrations.tsx@@ -0,0 +1,48 @@+'use client';++import { Flexbox, Text } from '@lobehub/ui';+import { useTranslation } from 'react-i18next';++import {+ IntegrationDetailSkeleton,+ IntegrationsColumn,+ IntegrationsOverviewSkeleton,+} from '@/features/Integrations/Skeleton';++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.+ * 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>+ );++ return (+ <Flexbox gap={20}>+ <IntegrationsColumn>+ {ready ? (+ <Text type={'secondary'}>{t('overview.description')}</Text>+ ) : (+ <SkeletonBar height={14} width={360} />+ )}+ </IntegrationsColumn>+ <IntegrationsColumn>+ <IntegrationsOverviewSkeleton />+ </IntegrationsColumn>+ </Flexbox>+ );+};++const IntegrationsSkeleton: SettingsTabSkeleton = { Body };++export default IntegrationsSkeleton;diff --git a/src/components/Skeleton/Settings/tabs/Labels.tsx b/src/components/Skeleton/Settings/tabs/Labels.tsxnew file mode 100644index 00000000000..90c80871b43--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/Labels.tsx@@ -0,0 +1,110 @@+'use client';++import { Flexbox, Tabs, Text } from '@lobehub/ui';++import { LABEL_COLUMN_WIDTHS } from '@/features/WorkspaceSetting/Labels/constants';++import SkeletonBar from '../../Bar';+import { useSkeletonText } from '../useSkeletonText';+import type { SettingsTabSkeleton } from './types';++const ROWS = 4;++/**+ * The label table while the registry loads: the static column header, then+ * 42px rows (color dot + name, description, usage, created date, menu) on the+ * same column widths as the loaded rows.+ */+export const LabelsListSkeleton = () => {+ const text = useSkeletonText('setting');+ const head = (key: string, width: number) =>+ text(`workspaceSetting.labels.columns.${key}`, width, 12);++ return (+ <Flexbox aria-busy gap={2}>+ <Flexbox horizontal align={'center'} gap={12} paddingInline={12} style={{ paddingBlock: 4 }}>+ <Text+ fontSize={12}+ style={{ flex: 'none', width: LABEL_COLUMN_WIDTHS.name }}+ type={'secondary'}+ >+ {head('name', 32)}+ </Text>+ <Text ellipsis fontSize={12} style={{ flex: 1, minWidth: 0 }} type={'secondary'}>+ {head('description', 48)}+ </Text>+ <Text+ fontSize={12}+ style={{ flex: 'none', textAlign: 'end', width: LABEL_COLUMN_WIDTHS.usage }}+ type={'secondary'}+ >+ {head('usage', 40)}+ </Text>+ <Text+ fontSize={12}+ style={{ flex: 'none', textAlign: 'end', width: LABEL_COLUMN_WIDTHS.created }}+ type={'secondary'}+ >+ {head('created', 48)}+ </Text>+ <span style={{ flex: 'none', width: LABEL_COLUMN_WIDTHS.action }} />+ </Flexbox>+ {Array.from({ length: ROWS }, (_, index) => (+ <Flexbox horizontal align={'center'} gap={12} height={42} key={index} paddingInline={12}>+ <Flexbox+ horizontal+ align={'center'}+ flex={'none'}+ gap={12}+ style={{ width: LABEL_COLUMN_WIDTHS.name }}+ >+ <SkeletonBar height={10} radius={'50%'} width={10} />+ <SkeletonBar height={14} width={72 + (index % 3) * 24} />+ </Flexbox>+ <Flexbox flex={1} style={{ minWidth: 0 }}>+ <SkeletonBar height={12} width={`${40 + (index % 2) * 20}%`} />+ </Flexbox>+ <Flexbox align={'flex-end'} flex={'none'} style={{ width: LABEL_COLUMN_WIDTHS.usage }}>+ <SkeletonBar height={12} width={48} />+ </Flexbox>+ <Flexbox align={'flex-end'} flex={'none'} style={{ width: LABEL_COLUMN_WIDTHS.created }}>+ <SkeletonBar height={12} width={72} />+ </Flexbox>+ <span style={{ flex: 'none', width: LABEL_COLUMN_WIDTHS.action }} />+ </Flexbox>+ ))}+ </Flexbox>+ );+};++/**+ * The agent/task label tabs, then the toolbar (search, scope filter, create+ * button) above the label table.+ */+const Body = () => {+ const text = useSkeletonText('setting');++ return (+ <Flexbox gap={16}>+ <Tabs+ activeKey={'agent'}+ items={[+ { key: 'agent', label: text('taskLabels.tabs.agent', 56, 14) },+ { key: 'task', label: text('taskLabels.tabs.task', 56, 14) },+ ]}+ />+ <Flexbox horizontal align={'center'} gap={12} justify={'space-between'}>+ <Flexbox horizontal align={'center'} gap={8}>+ <SkeletonBar height={32} radius={8} width={200} />+ <SkeletonBar height={32} radius={8} width={76} />+ </Flexbox>+ <SkeletonBar height={32} radius={8} width={104} />+ </Flexbox>+ <LabelsListSkeleton />+ </Flexbox>+ );+};++const LabelsSkeleton: SettingsTabSkeleton = { Body };++export default LabelsSkeleton;diff --git a/src/components/Skeleton/Settings/tabs/Labs.tsx b/src/components/Skeleton/Settings/tabs/Labs.tsxnew file mode 100644index 00000000000..c50fde96942--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/Labs.tsx@@ -0,0 +1,92 @@+'use client';++import { isDesktop } from '@lobechat/const';+import { Alert, Flexbox, Tag } from '@lobehub/ui';+import { FlaskConicalIcon } from 'lucide-react';+import { useTranslation } from 'react-i18next';++import { LAB_FEATURES, type LabFeatureItem } from '@/features/Settings/labs/features';+import { serverConfigSelectors, useServerConfigStore } from '@/store/serverConfig';++import SkeletonBar from '../../Bar';+import { SettingsFormSkeleton, type SettingsFormSkeletonItem, SWITCH_CONTROL } from '../Section';+import type { SettingsTabSkeleton } from './types';++/**+ * The experiment groups with the same General / Workspace / Desktop split and+ * every experiment's real title and description. The labs page renders it+ * below its settled intro alert while user state loads.+ */+export const LabsFormSkeleton = () => {+ const { t, ready } = useTranslation('labs');+ const enableWorkspace = useServerConfigStore(serverConfigSelectors.enableWorkspace);+ const text = (key: string, width: number, height = 14) =>+ ready ? (t(key as any) as string) : <SkeletonBar height={height} width={width} />;++ const toItem = ({ i18nKey, noteI18nKey, stage }: LabFeatureItem): SettingsFormSkeletonItem => ({+ control: SWITCH_CONTROL,+ desc: noteI18nKey ? (+ <Flexbox>+ <span>{text(`features.${i18nKey}.desc`, 280, 12)}</span>+ <span>{text(`features.${noteI18nKey}.note`, 200, 12)}</span>+ </Flexbox>+ ) : (+ text(`features.${i18nKey}.desc`, 280, 12)+ ),+ label: (+ <Flexbox horizontal align={'center'} gap={8}>+ {text(`features.${i18nKey}.title`, 120)}+ {ready && (+ <Tag color={stage === 'alpha' ? 'warning' : 'info'} size={'small'}>+ {t(`stage.${stage}.label`)}+ </Tag>+ )}+ </Flexbox>+ ),+ minWidth: undefined,+ });++ const general = LAB_FEATURES.filter((f) => !f.desktopOnly && !f.workspaceOnly);+ const workspace = enableWorkspace ? LAB_FEATURES.filter((f) => f.workspaceOnly) : [];+ const desktop = LAB_FEATURES.filter((f) => f.desktopOnly);++ return (+ <SettingsFormSkeleton+ groups={[+ { items: general.map(toItem), title: text('group.general', 72, 16) },+ ...(workspace.length > 0+ ? [{ items: workspace.map(toItem), title: text('group.workspace', 72, 16) }]+ : []),+ ...(isDesktop+ ? [{ items: desktop.map(toItem), title: text('group.desktop', 72, 16) }]+ : []),+ ]}+ />+ );+};++/** The intro alert (static copy) above the experiment groups. */+const Body = () => {+ const { t, ready } = useTranslation('labs');++ return (+ <Flexbox gap={16}>+ {ready ? (+ <Alert+ showIcon+ icon={FlaskConicalIcon}+ title={t('description')}+ type={'info'}+ variant={'filled'}+ />+ ) : (+ <SkeletonBar height={40} radius={8} />+ )}+ <LabsFormSkeleton />+ </Flexbox>+ );+};++const LabsSkeleton: SettingsTabSkeleton = { Body };++export default LabsSkeleton;diff --git a/src/components/Skeleton/Settings/tabs/Memory.tsx b/src/components/Skeleton/Settings/tabs/Memory.tsxnew file mode 100644index 00000000000..b9e7283d71d--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/Memory.tsx@@ -0,0 +1,40 @@+'use client';++import { SettingsFormSkeleton, SWITCH_CONTROL } from '../Section';+import { useSkeletonText } from '../useSkeletonText';+import type { SettingsTabSkeleton } from './types';++/** One filled group: the enable switch and the effort slider (~180x44 with its marks). */+const Body = () => {+ const text = useSkeletonText('setting');++ return (+ <SettingsFormSkeleton+ groups={[+ {+ items: [+ {+ control: SWITCH_CONTROL,+ desc: text('memory.enabled.desc', 240, 12),+ label: text('memory.enabled.title', 96, 14),+ layout: 'horizontal',+ minWidth: undefined,+ },+ {+ control: { height: 44, width: 180 },+ desc: text('memory.effort.desc', 240, 12),+ label: text('memory.effort.title', 96, 14),+ layout: 'horizontal',+ minWidth: undefined,+ },+ ],+ title: text('memory.title', 80, 16),+ },+ ]}+ />+ );+};++const MemorySkeleton: SettingsTabSkeleton = { Body };++export default MemorySkeleton;diff --git a/src/components/Skeleton/Settings/tabs/Messenger.tsx b/src/components/Skeleton/Settings/tabs/Messenger.tsxnew file mode 100644index 00000000000..31031021de7--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/Messenger.tsx@@ -0,0 +1,12 @@+'use client';++import { MessengerListSkeleton, MessengerPlatformDetailSkeleton } from '../MessengerDetail';+import type { SettingsTabSkeleton, SettingsTabSkeletonProps } from './types';++/** `/settings/messenger` lists the platforms; `/settings/messenger/:platform` is one platform. */+const Body = ({ sub }: SettingsTabSkeletonProps) =>+ sub ? <MessengerPlatformDetailSkeleton platform={sub} /> : <MessengerListSkeleton />;++const MessengerSkeleton: SettingsTabSkeleton = { Body };++export default MessengerSkeleton;diff --git a/src/components/Skeleton/Settings/tabs/Notification.tsx b/src/components/Skeleton/Settings/tabs/Notification.tsxnew file mode 100644index 00000000000..95e581e954d--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/Notification.tsx@@ -0,0 +1,164 @@+'use client';++import { Flexbox } from '@lobehub/ui';+import { Form, useForm } from '@lobehub/ui/form';+import { cssVar } from '@lobehub/ui/stylex/cssVar.stylex';+import type { ReactNode } from 'react';+import { useTranslation } from 'react-i18next';++import { FORM_STYLE } from '@/const/layoutTokens';+import { SUPPORTED_MESSENGER_PLATFORMS } from '@/features/Messenger/platforms';++import SkeletonBar from '../../Bar';+import { SettingsFormSkeleton, SWITCH_CONTROL } from '../Section';+import { useSkeletonText } from '../useSkeletonText';+import type { SettingsTabSkeleton, SettingsTabSkeletonProps } from './types';++const BASE_CHANNELS = ['inbox', 'email', 'push'] as const;++/**+ * Types listed on a channel page when the caller cannot supply them (the route+ * skeleton). The real list comes from the deployment's notification registry.+ */+const TYPE_ROWS = 6;++const platformName = (id: string) => SUPPORTED_MESSENGER_PLATFORMS.find((p) => p.id === id)?.name;++/** One channel row: 40px icon tile, real channel name, status line and chevron. */+const ChannelRow = ({ divider, title }: { divider: boolean; title: ReactNode }) => (+ <div style={{ marginInline: -8, paddingInline: 8 }}>+ <Form.Field+ avatar={<SkeletonBar height={40} width={40} />}+ divider={divider}+ label={title}+ layout={'horizontal'}+ desc={+ <Flexbox horizontal align={'center'} gap={8}>+ <span+ style={{+ background: cssVar.colorTextQuaternary,+ borderRadius: '50%',+ flex: 'none',+ height: 6,+ width: 6,+ }}+ />+ <SkeletonBar height={12} width={88} />+ </Flexbox>+ }+ >+ <SkeletonBar height={16} width={16} />+ </Form.Field>+ </div>+);++/** Channel index: the base channels and messenger platforms, then the summary switch. */+const IndexSkeleton = () => {+ const text = useSkeletonText('setting');+ const form = useForm();++ const rows = (+ <>+ {BASE_CHANNELS.map((channel, index) => (+ <ChannelRow+ divider={index > 0}+ key={channel}+ title={text(`notification.${channel}.title`, 64, 14)}+ />+ ))}+ {SUPPORTED_MESSENGER_PLATFORMS.map(({ id, name }) => (+ <ChannelRow divider key={id} title={name} />+ ))}+ </>+ );++ return (+ <div aria-busy data-testid={'settings-form-skeleton'}>+ <Form+ collapsible={false}+ form={form}+ itemsType={'group'}+ variant={'filled'}+ items={[+ { children: rows, title: text('notification.title', 64) },+ {+ children: [+ {+ children: <SkeletonBar {...SWITCH_CONTROL} />,+ desc: text('notification.content.scheduledTaskSummary.desc', 280, 12),+ label: text('notification.content.scheduledTaskSummary.title', 120, 14),+ layout: 'horizontal',+ minWidth: undefined,+ },+ ],+ title: text('notification.content.title', 64),+ },+ ]}+ {...FORM_STYLE}+ />+ </div>+ );+};++/** Channel page: back + title row, description, the enable group and the type switches. */+const DetailSkeleton = ({ channel, typeLabels }: { channel: string; typeLabels?: ReactNode[] }) => {+ const { t, ready } = useTranslation('setting');+ const text = useSkeletonText('setting');+ const platform = platformName(channel);+ const title =+ platform ??+ ((BASE_CHANNELS as readonly string[]).includes(channel) && ready+ ? t(`notification.${channel as (typeof BASE_CHANNELS)[number]}.title`)+ : undefined);++ return (+ <Flexbox aria-busy gap={16}>+ <Flexbox horizontal align={'center'} gap={4}>+ <SkeletonBar height={24} width={24} />+ <Flexbox height={25} justify={'center'}>+ {title ? (+ <span style={{ fontSize: 16, fontWeight: 600 }}>{title}</span>+ ) : (+ <SkeletonBar height={18} width={96} />+ )}+ </Flexbox>+ </Flexbox>+ <SkeletonBar height={14} width={320} />+ <SettingsFormSkeleton+ groups={[+ {+ items: [+ {+ control: SWITCH_CONTROL,+ label: <SkeletonBar height={14} width={120} />,+ minWidth: undefined,+ },+ ],+ title: title ?? <SkeletonBar height={18} width={96} />,+ },+ {+ items: (+ typeLabels ??+ Array.from({ length: TYPE_ROWS }, (_, index) => (+ <SkeletonBar height={14} key={index} width={96 + (index % 3) * 32} />+ ))+ ).map((label) => ({ control: SWITCH_CONTROL, label, minWidth: undefined })),+ title: text('notification.channel.types.title', 64),+ },+ ]}+ />+ </Flexbox>+ );+};++interface NotificationSkeletonProps extends SettingsTabSkeletonProps {+ /** The channel page's type labels, when the page already knows them. */+ typeLabels?: ReactNode[];+}++const Body = ({ sub, typeLabels }: NotificationSkeletonProps) =>+ sub ? <DetailSkeleton channel={sub} typeLabels={typeLabels} /> : <IndexSkeleton />;++const NotificationSkeleton = { Body } satisfies SettingsTabSkeleton;++export default NotificationSkeleton;diff --git a/src/components/Skeleton/Settings/tabs/OAuthApps.tsx b/src/components/Skeleton/Settings/tabs/OAuthApps.tsxnew file mode 100644index 00000000000..69c5f12804b--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/OAuthApps.tsx@@ -0,0 +1,19 @@+'use client';++import AppDetailSkeleton from '@/features/Settings/oauth-apps/features/AppDetailSkeleton';+import AppListSkeleton from '@/features/Settings/oauth-apps/features/AppListSkeleton';++import SkeletonBar from '../../Bar';+import type { SettingsTabSkeleton, SettingsTabSkeletonProps } from './types';++/** The list is one bordered card of app rows; `/settings/oauth-apps/:id` is one app's page. */+const Body = ({ sub }: SettingsTabSkeletonProps) =>+ sub ? <AppDetailSkeleton /> : <AppListSkeleton />;++/** The small "Create" button the list portals into the header; app pages have none. */+const PageActions = ({ sub }: SettingsTabSkeletonProps) =>+ sub ? null : <SkeletonBar height={32} width={112} />;++const OAuthAppsSkeleton: SettingsTabSkeleton = { Body, PageActions };++export default OAuthAppsSkeleton;diff --git a/src/components/Skeleton/Settings/tabs/Plans.tsx b/src/components/Skeleton/Settings/tabs/Plans.tsxnew file mode 100644index 00000000000..2d00d1a1f69--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/Plans.tsx@@ -0,0 +1,11 @@+'use client';++import { SettingsSectionsBody } from '../Sections';+import { SETTINGS_SECTION_SHAPES } from '../sectionShapes';+import type { SettingsTabSkeleton } from './types';++const Body = () => <SettingsSectionsBody shape={SETTINGS_SECTION_SHAPES.plans} />;++const PlansSkeleton: SettingsTabSkeleton = { Body };++export default PlansSkeleton;diff --git a/src/components/Skeleton/Settings/tabs/Profile.tsx b/src/components/Skeleton/Settings/tabs/Profile.tsxnew file mode 100644index 00000000000..58af367e63c--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/Profile.tsx@@ -0,0 +1,8 @@+'use client';++import SettingsProfileSkeleton from '../Profile';+import type { SettingsTabSkeleton } from './types';++const ProfileSkeleton: SettingsTabSkeleton = { Body: SettingsProfileSkeleton };++export default ProfileSkeleton;diff --git a/src/components/Skeleton/Settings/tabs/Proxy.tsx b/src/components/Skeleton/Settings/tabs/Proxy.tsxnew file mode 100644index 00000000000..ec16e26590b--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/Proxy.tsx@@ -0,0 +1,55 @@+'use client';++import SettingsSectionSkeleton from '../Section';+import { useSkeletonText } from '../useSkeletonText';+import type { SettingsTabSkeleton } from './types';++/**+ * The proxy form: enable, basic settings (type / server / port), auth and+ * connection-test groups of one grouped form, 16px apart. Credentials stay+ * hidden until the proxy and auth are enabled, so the auth group has one row.+ */+const Body = () => {+ const text = useSkeletonText('electron');++ return (+ <SettingsSectionSkeleton+ gap={16}+ groups={[+ {+ control: { height: 22, width: 44 },+ labels: [text('proxy.enable', 64)],+ rows: 1,+ title: text('proxy.enable', 64, 18),+ },+ {+ controls: {+ 0: { height: 22, width: 220 },+ 1: { height: 32, width: 336 },+ 2: { height: 32, width: 120 },+ },+ labels: [text('proxy.type', 40), text('proxy.server', 56), text('proxy.port', 40)],+ rows: 3,+ title: text('proxy.basicSettings', 80, 18),+ withDesc: [false, true, true],+ },+ {+ control: { height: 22, width: 44 },+ labels: [text('proxy.auth', 72)],+ rows: 1,+ title: text('proxy.authSettings', 80, 18),+ },+ {+ control: { height: 32, width: 264 },+ labels: [text('proxy.testUrl', 72)],+ rows: 1,+ title: text('proxy.connectionTest', 80, 18),+ },+ ]}+ />+ );+};++const ProxySkeleton: SettingsTabSkeleton = { Body };++export default ProxySkeleton;diff --git a/src/components/Skeleton/Settings/tabs/Referral.tsx b/src/components/Skeleton/Settings/tabs/Referral.tsxnew file mode 100644index 00000000000..3f0ee8c0174--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/Referral.tsx@@ -0,0 +1,11 @@+'use client';++import { SettingsSectionsBody } from '../Sections';+import { SETTINGS_SECTION_SHAPES } from '../sectionShapes';+import type { SettingsTabSkeleton } from './types';++const Body = () => <SettingsSectionsBody shape={SETTINGS_SECTION_SHAPES.referral} />;++const ReferralSkeleton: SettingsTabSkeleton = { Body };++export default ReferralSkeleton;diff --git a/src/components/Skeleton/Settings/tabs/Security.tsx b/src/components/Skeleton/Settings/tabs/Security.tsxnew file mode 100644index 00000000000..8053f50c05d--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/Security.tsx@@ -0,0 +1,9 @@+'use client';++import ProfileSkeleton from './Profile';+import type { SettingsTabSkeleton } from './types';++/** `/settings/security` redirects to `/settings`, which opens the profile. */+const SecuritySkeleton: SettingsTabSkeleton = { Body: ProfileSkeleton.Body };++export default SecuritySkeleton;diff --git a/src/components/Skeleton/Settings/tabs/ServiceModel.tsx b/src/components/Skeleton/Settings/tabs/ServiceModel.tsxnew file mode 100644index 00000000000..41540e3e0f9--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/ServiceModel.tsx@@ -0,0 +1,128 @@+'use client';++import { Flexbox } from '@lobehub/ui';+import { Form } from '@lobehub/ui/form';+import { cssVar } from '@lobehub/ui/stylex/cssVar.stylex';++import {+ featureFlagsSelectors,+ serverConfigSelectors,+ useServerConfigStore,+} from '@/store/serverConfig';++import SkeletonBar from '../../Bar';+import SettingsSectionSkeleton from '../Section';+import { useSkeletonText } from '../useSkeletonText';+import type { SettingsTabSkeleton } from './types';++/** Width of the settled tier picker (`PICKER_WIDTH` is the advanced column; the picker is close). */+const PICKER = { height: 32, width: 260 };++type Text = ReturnType<typeof useSkeletonText>;++/** One model card: tier title + description head, the picker row, and optionally the γι«ηΊ§γ line. */+const TierGroup = ({+ advanced,+ desc,+ label,+ text,+ title,+}: {+ advanced?: boolean;+ desc: string;+ label?: string;+ text: Text;+ title: string;+}) => (+ <Form.Group+ className={'lobe-section-96565f37-group'}+ collapsible={false}+ desc={text(desc, 220, 12)}+ title={text(title, 80, 18)}+ variant={'filled'}+ >+ <Flexbox paddingInline={16}>+ <Flexbox horizontal align={'center'} height={64} justify={'space-between'}>+ <span style={{ fontSize: 14 }}>{text(label ?? 'serviceModel.tierPicker', 32, 14)}</span>+ <SkeletonBar height={PICKER.height} radius={cssVar.borderRadius} width={PICKER.width} />+ </Flexbox>+ {advanced && (+ <Flexbox horizontal align={'center'} gap={8} height={24} style={{ marginBottom: 16 }}>+ <span style={{ color: cssVar.colorTextSecondary, fontSize: 12, fontWeight: 500 }}>+ {text('serviceModel.advanced.title', 28, 12)}+ </span>+ <SkeletonBar height={12} width={240} />+ </Flexbox>+ )}+ </Flexbox>+ </Form.Group>+);++/** The image-generation form below the model cards: one default-count slider row. */+export const ImageSettingsSkeleton = () => {+ const text = useSkeletonText('setting');++ return (+ <SettingsSectionSkeleton+ groups={[+ {+ control: { height: 32, width: 335 },+ labels: [text('settingImage.defaultCount.label', 96)],+ rows: 1,+ title: text('settingImage.defaultCount.title', 32, 18),+ },+ ]}+ />+ );+};++/**+ * The service-model tab: one grouped form of model cards 16px apart (main and+ * flash carry a folded γι«ηΊ§γ line), then the image form 36px below.+ */+export const ServiceModelFormSkeleton = () => {+ const text = useSkeletonText('setting');+ const enableChannels = useServerConfigStore(serverConfigSelectors.enableChannels);++ return (+ <Flexbox aria-busy gap={16}>+ {(['main', 'flash', 'verify', 'embedding'] as const).map((tier) => (+ <TierGroup+ advanced={tier === 'main' || tier === 'flash'}+ desc={`serviceModel.tier.${tier}.desc`}+ key={tier}+ text={text}+ title={`serviceModel.tier.${tier}.title`}+ />+ ))}+ <TierGroup+ desc={'serviceModel.voice.desc'}+ label={'systemAgent.asr.title'}+ text={text}+ title={'serviceModel.voice.title'}+ />+ {enableChannels && (+ <TierGroup+ desc={'systemAgent.channelRouting.modelDesc'}+ text={text}+ title={'systemAgent.channelRouting.title'}+ />+ )}+ </Flexbox>+ );+};++const Body = () => {+ const { showAiImage } = useServerConfigStore(featureFlagsSelectors);++ return (+ <>+ <ServiceModelFormSkeleton />+ {showAiImage && <ImageSettingsSkeleton />}+ </>+ );+};++const ServiceModelSkeleton: SettingsTabSkeleton = { Body };++export default ServiceModelSkeleton;diff --git a/src/components/Skeleton/Settings/tabs/Skill.tsx b/src/components/Skeleton/Settings/tabs/Skill.tsxnew file mode 100644index 00000000000..56278b7420f--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/Skill.tsx@@ -0,0 +1,130 @@+'use client';++import { cssVar, Flexbox, Text } from '@lobehub/ui';+import { ChevronDownIcon } from 'lucide-react';+import { useTranslation } from 'react-i18next';++import NavHeader from '@/features/NavHeader';++import SkeletonBar from '../../Bar';+import { SkeletonItem } from '../../NavPanel/List';+import type { SettingsTabSkeleton } from './types';++interface NavSection {+ key: string;+ rows: number;+}++const SKILL_SECTIONS: NavSection[] = [+ { key: 'skillGroup.builtinSkills', rows: 6 },+ { key: 'skillGroup.communitySkills', rows: 4 },+];++/**+ * The list column of `LeftPanel` in nav mode: a 42px head with the view title+ * and its small action buttons, then collapsible group headings over nav rows.+ * Title and headings are static copy. Also the mobile connector list.+ */+export const SkillNavListSkeleton = ({+ actions = 2,+ fullWidth,+ sections = SKILL_SECTIONS,+ titleKey = 'skillView.skills',+}: {+ actions?: number;+ fullWidth?: boolean;+ sections?: NavSection[];+ titleKey?: string;+}) => {+ const { t } = useTranslation('setting');++ return (+ <Flexbox+ style={{+ borderInlineEnd: fullWidth ? undefined : `1px solid ${cssVar.colorBorderSecondary}`,+ minWidth: 260,+ overflow: 'hidden',+ width: fullWidth ? '100%' : 300,+ }}+ >+ <Flexbox+ horizontal+ align={'center'}+ gap={8}+ height={42}+ justify={'space-between'}+ paddingInline={16}+ style={{ borderBlockEnd: `1px solid ${cssVar.colorBorderSecondary}`, flexShrink: 0 }}+ >+ <Text strong style={{ fontSize: 14 }}>+ {t(titleKey as any)}+ </Text>+ <Flexbox horizontal gap={6}>+ {Array.from({ length: actions }, (_, index) => (+ <SkeletonBar height={24} key={index} width={24} />+ ))}+ </Flexbox>+ </Flexbox>+ <Flexbox gap={2} paddingBlock={4} paddingInline={8}>+ {sections.map(({ key, rows }) => (+ <Flexbox gap={2} key={key}>+ <Flexbox+ horizontal+ align={'center'}+ gap={4}+ paddingInline={4}+ style={{+ color: cssVar.colorTextSecondary,+ fontSize: 12,+ fontWeight: 500,+ paddingBlock: '12px 4px',+ }}+ >+ <ChevronDownIcon size={10} />+ {t(key as any)}+ </Flexbox>+ {Array.from({ length: rows }, (_, index) => (+ <SkeletonItem avatarSize={20} key={index} />+ ))}+ </Flexbox>+ ))}+ </Flexbox>+ </Flexbox>+ );+};++/** The detail pane opened on the first built-in skill: icon + title head over its text. */+const DetailPane = () => (+ <Flexbox flex={1} gap={24} padding={24} style={{ minWidth: 0 }}>+ <Flexbox horizontal align={'center'} gap={12}>+ <SkeletonBar height={40} radius={cssVar.borderRadius} width={40} />+ <Flexbox flex={1} gap={6}>+ <SkeletonBar height={18} width={160} />+ <SkeletonBar height={12} width={'48%'} />+ </Flexbox>+ </Flexbox>+ <Flexbox gap={12}>+ {[100, 92, 96, 64, 88, 72].map((width, index) => (+ <SkeletonBar height={14} key={index} width={`${width}%`} />+ ))}+ </Flexbox>+ </Flexbox>+);++/** Mobile shows the list full width under the mobile header. */+const Body = () => <SkillNavListSkeleton fullWidth />;++/** Desktop is a split pane under an empty navigation header, like `ToolSettings`. */+const Page = () => (+ <Flexbox aria-busy flex={1} height={'100%'} style={{ minHeight: 0, overflow: 'hidden' }}>+ <NavHeader />+ <Flexbox horizontal flex={1} style={{ overflow: 'hidden' }}>+ <SkillNavListSkeleton />+ <DetailPane />+ </Flexbox>+ </Flexbox>+);++const SkillSkeleton: SettingsTabSkeleton = { Body, Page };++export default SkillSkeleton;diff --git a/src/components/Skeleton/Settings/tabs/Stats.tsx b/src/components/Skeleton/Settings/tabs/Stats.tsxnew file mode 100644index 00000000000..d53751a9f1d--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/Stats.tsx@@ -0,0 +1,118 @@+'use client';++import { cssVar, Divider, Flexbox } from '@lobehub/ui';+import { Form } from '@lobehub/ui/form';+import type { ReactNode } from 'react';++import SkeletonBar from '../../Bar';+import { useSkeletonText } from '../useSkeletonText';+import type { SettingsTabSkeleton } from './types';++/** A 96px figure tile: label, large figure and a "last month" caption. */+const Tile = ({ label }: { label?: ReactNode }) => (+ <Flexbox flex={1} gap={12} height={96} style={{ minWidth: 0 }}>+ <Flexbox height={22} justify={'center'}>+ {label ?? <SkeletonBar height={14} width={56} />}+ </Flexbox>+ <SkeletonBar height={28} width={64} />+ <SkeletonBar height={12} width={72} />+ </Flexbox>+);++const Rank = ({ title }: { title: ReactNode }) => (+ <Flexbox flex={1} gap={16} height={261} style={{ minWidth: 0 }}>+ <Flexbox height={22} justify={'center'} style={{ fontSize: 16, fontWeight: 600 }}>+ {title}+ </Flexbox>+ <Flexbox horizontal justify={'space-between'}>+ <SkeletonBar height={12} width={40} />+ <SkeletonBar height={12} width={40} />+ </Flexbox>+ {[0, 1, 2, 3, 4].map((index) => (+ <Flexbox horizontal align={'center'} gap={8} key={index}>+ <SkeletonBar height={20} radius={'50%'} width={20} />+ <SkeletonBar height={14} width={`${48 + (index % 3) * 12}%`} />+ </Flexbox>+ ))}+ </Flexbox>+);++/**+ * The stats tab: the overview group (figures, activity heatmap, rankings) and+ * the usage group (spend cards, trend chart, table), 36px apart like the two+ * settled `Form.Group`s. Group and section titles are static copy.+ */+const Body = () => {+ const text = useSkeletonText('auth');++ return (+ <Flexbox aria-busy gap={36}>+ <Form.Group+ collapsible={false}+ extra={<SkeletonBar height={32} width={32} />}+ variant={'filled'}+ title={+ <Flexbox gap={6} height={44} justify={'center'}>+ <SkeletonBar height={18} width={420} />+ <SkeletonBar height={12} width={240} />+ </Flexbox>+ }+ >+ <Flexbox horizontal gap={8}>+ <Tile label={text('stats.assistants', 56)} />+ <Tile label={text('stats.topics', 56)} />+ <Tile label={text('stats.messages', 56)} />+ <Tile label={text('stats.heatmapStats.totalTokens', 88)} />+ </Flexbox>+ <Divider dashed style={{ marginBlock: 24 }} />+ <Flexbox gap={16}>+ <Flexbox horizontal align={'center'} height={32} justify={'space-between'}>+ <Flexbox horizontal align={'center'} gap={12}>+ <span style={{ fontSize: 16, fontWeight: 600 }}>+ {text('stats.lastYearActivity', 112)}+ </span>+ <SkeletonBar height={32} width={156} />+ </Flexbox>+ <SkeletonBar height={24} width={112} />+ </Flexbox>+ <SkeletonBar height={88} radius={cssVar.borderRadiusLG} />+ <SkeletonBar height={173} radius={cssVar.borderRadiusLG} />+ </Flexbox>+ <Divider dashed style={{ marginBlock: 24 }} />+ <Flexbox horizontal gap={16} style={{ paddingBottom: 12 }}>+ <Rank title={text('stats.modelsRank.title', 80)} />+ <Rank title={text('stats.assistantsRank.title', 80)} />+ <Rank title={text('stats.topicsRank.title', 80)} />+ </Flexbox>+ </Form.Group>+ <Form.Group+ collapsible={false}+ title={<span style={{ lineHeight: '35px' }}>{text('tab.usage', 32)}</span>}+ variant={'filled'}+ extra={+ <Flexbox horizontal align={'center'} gap={8}>+ <SkeletonBar height={32} width={140} />+ <SkeletonBar height={38} width={188} />+ </Flexbox>+ }+ >+ <Flexbox horizontal gap={16}>+ <Tile />+ <Tile />+ <Tile />+ </Flexbox>+ <Divider style={{ marginBlock: 24 }} />+ <Flexbox gap={16}>+ <SkeletonBar height={38} width={140} />+ <SkeletonBar height={280} radius={cssVar.borderRadiusLG} />+ </Flexbox>+ <div style={{ height: 24 }} />+ <SkeletonBar height={194} radius={cssVar.borderRadiusLG} />+ </Form.Group>+ </Flexbox>+ );+};++const StatsSkeleton: SettingsTabSkeleton = { Body };++export default StatsSkeleton;diff --git a/src/components/Skeleton/Settings/tabs/Storage.tsx b/src/components/Skeleton/Settings/tabs/Storage.tsxnew file mode 100644index 00000000000..1ec593544a7--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/Storage.tsx@@ -0,0 +1,71 @@+'use client';++import { Flexbox } from '@lobehub/ui';++import {+ featureFlagsSelectors,+ serverConfigSelectors,+ useServerConfigStore,+} from '@/store/serverConfig';++import SettingsSectionSkeleton, { type SettingsSectionSkeletonGroup } from '../Section';+import { useSkeletonText } from '../useSkeletonText';+import type { SettingsTabSkeleton } from './types';++/**+ * The storage tab: the actions group (import, export on Cloud, reset), the+ * analytics group when docs are hidden, and on Cloud the account-deletion group+ * 16px below. Group titles and row labels are static copy.+ */+const Body = () => {+ const text = useSkeletonText('setting');+ const enableBusinessFeatures = useServerConfigStore(serverConfigSelectors.enableBusinessFeatures);+ const { hideDocs } = useServerConfigStore(featureFlagsSelectors);++ const actions: SettingsSectionSkeletonGroup = {+ control: { height: 32, width: 88 },+ labels: [+ text('storage.actions.import.title', 64),+ ...(enableBusinessFeatures ? [text('storage.actions.export.title', 64)] : []),+ text('danger.reset.title', 96),+ ],+ rows: enableBusinessFeatures ? 3 : 2,+ title: text('storage.actions.title', 64, 18),+ withDesc: enableBusinessFeatures ? [false, false, true] : [false, true],+ };+ const analytics: SettingsSectionSkeletonGroup = {+ control: { height: 22, width: 44 },+ labels: [text('analytics.telemetry.title', 96)],+ rows: 1,+ title: text('analytics.title', 64, 18),+ };++ return (+ <Flexbox aria-busy gap={16}>+ <SettingsSectionSkeleton gap={16} groups={[...(hideDocs ? [analytics] : []), actions]} />+ {enableBusinessFeatures && <AccountDeletionSkeleton />}+ </Flexbox>+ );+};++/** Cloud's account-deletion group: one labelled row with a description and a danger button. */+export const AccountDeletionSkeleton = () => {+ const text = useSkeletonText('setting');++ return (+ <SettingsSectionSkeleton+ groups={[+ {+ control: { height: 32, width: 112 },+ labels: [text('accountDeletion.title', 64)],+ rows: 1,+ title: text('accountDeletion.sectionTitle', 64, 18),+ },+ ]}+ />+ );+};++const StorageSkeleton: SettingsTabSkeleton = { Body };++export default StorageSkeleton;diff --git a/src/components/Skeleton/Settings/tabs/SystemTools.tsx b/src/components/Skeleton/Settings/tabs/SystemTools.tsxnew file mode 100644index 00000000000..f8c135c7c2d--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/SystemTools.tsx@@ -0,0 +1,58 @@+'use client';++import SettingsSectionSkeleton from '../Section';+import { useSkeletonText } from '../useSkeletonText';+import type { SettingsTabSkeleton } from './types';++const RUNTIME_TOOLS = ['lobehub', 'node', 'python', 'npm', 'bun', 'bunx', 'pnpm', 'uv'];+const CLI_AGENTS = ['claude', 'codex', 'gemini', 'qwen', 'kimi', 'aider'];++/**+ * The system-tools page: the shell form, then the tool detector's category+ * groups (16px apart inside one form), 36px below. Tool names are fixed, so+ * the rows show them; only the detection status is a placeholder. Categories+ * below the first viewport are left out.+ */+const Body = () => {+ const text = useSkeletonText('setting');+ const status = { height: 22, width: 96 };++ return (+ <>+ <SettingsSectionSkeleton+ groups={[+ {+ control: { height: 32, width: 160 },+ desc: text('settingSystemTools.shell.desc', 220, 12),+ labels: [text('settingSystemTools.shell.mode.title', 80)],+ rows: 1,+ title: text('settingSystemTools.shell.title', 64, 18),+ },+ ]}+ />+ <SettingsSectionSkeleton+ gap={16}+ groups={[+ {+ control: status,+ desc: text('settingSystemTools.category.runtimeEnvironment.desc', 220, 12),+ labels: RUNTIME_TOOLS,+ rows: RUNTIME_TOOLS.length,+ title: text('settingSystemTools.category.runtimeEnvironment', 96, 18),+ },+ {+ control: status,+ desc: text('settingSystemTools.category.cliAgents.desc', 220, 12),+ labels: CLI_AGENTS,+ rows: CLI_AGENTS.length,+ title: text('settingSystemTools.category.cliAgents', 96, 18),+ },+ ]}+ />+ </>+ );+};++const SystemToolsSkeleton: SettingsTabSkeleton = { Body };++export default SystemToolsSkeleton;diff --git a/src/components/Skeleton/Settings/tabs/Tools.tsx b/src/components/Skeleton/Settings/tabs/Tools.tsxnew file mode 100644index 00000000000..107ab49bb40--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/Tools.tsx@@ -0,0 +1,69 @@+'use client';++import { Block, Flexbox, Text } from '@lobehub/ui';+import { useTranslation } from 'react-i18next';++import SkeletonBar from '../../Bar';+import type { SettingsTabSkeleton } from './types';++const SECTIONS = [+ { key: 'search', rows: 5 },+ { key: 'crawler', rows: 4 },+] as const;++/**+ * `ToolSetting`'s two channel sections: real title + description (static+ * copy) above an outlined, 4px-inset list of `ChannelItem` rows (drag handle,+ * rank, 24px icon, name, small switch). Rendered as the page's own loading+ * state too, so the swap is in place.+ */+export const ToolsChannelsSkeleton = () => {+ const { t } = useTranslation('setting');++ return (+ <Flexbox+ aria-busy+ data-testid={'settings-tools-skeleton'}+ gap={32}+ style={{ paddingBlock: 16 }}+ >+ {SECTIONS.map(({ key, rows }) => (+ <Flexbox gap={8} key={key}>+ <Text strong fontSize={16}>+ {t(`settingTool.${key}.title`)}+ </Text>+ <Text fontSize={13} type={'secondary'}>+ {t(`settingTool.${key}.desc`)}+ </Text>+ <Block padding={4} style={{ marginBlockStart: 8 }} variant={'outlined'}>+ {Array.from({ length: rows }, (_, index) => (+ <Flexbox+ horizontal+ align={'center'}+ gap={8}+ justify={'space-between'}+ key={index}+ paddingBlock={8}+ paddingInline={12}+ >+ <Flexbox horizontal align={'center'} gap={8}>+ <SkeletonBar height={16} width={16} />+ <span style={{ minWidth: 16 }} />+ <Flexbox horizontal align={'center'} gap={10} height={24}>+ <SkeletonBar height={24} radius={'50%'} width={24} />+ <SkeletonBar height={14} width={80 + (index % 3) * 24} />+ </Flexbox>+ </Flexbox>+ <SkeletonBar height={16} radius={8} width={28} />+ </Flexbox>+ ))}+ </Block>+ </Flexbox>+ ))}+ </Flexbox>+ );+};++const ToolsSkeleton: SettingsTabSkeleton = { Body: ToolsChannelsSkeleton };++export default ToolsSkeleton;diff --git a/src/components/Skeleton/Settings/tabs/Trash.tsx b/src/components/Skeleton/Settings/tabs/Trash.tsxnew file mode 100644index 00000000000..59cedf9fb0d--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/Trash.tsx@@ -0,0 +1,86 @@+'use client';++import { TRASH_RETENTION_DAYS } from '@lobechat/const';+import { Flexbox, Text } from '@lobehub/ui';+import { cssVar } from '@lobehub/ui/stylex/cssVar.stylex';+import { useTranslation } from 'react-i18next';++import LiteTable, { type LiteTableColumn } from '@/components/LiteTable';++import SkeletonBar from '../../Bar';+import { useSkeletonText } from '../useSkeletonText';+import type { SettingsTabSkeleton } from './types';++/** A header-only column: the skeleton rows never call `render`. */+const headColumn = (column: Partial<LiteTableColumn<never>> & { key: string }) =>+ ({ render: () => null, title: '', ...column }) as LiteTableColumn<never>;++/** Leading type icon (28px) + gap (10px) the name column header is inset by. */+const NAME_INSET = 38;++/**+ * The retention note above the bin: type filter and "Empty" button over the+ * fixed-layout table, whose column heads are static copy. `LiteTable` draws the+ * same skeleton rows `TrashList` shows while its first page loads.+ */+const Body = () => {+ const { t, ready } = useTranslation('setting');+ const text = useSkeletonText('setting');++ const columns = [+ headColumn({+ key: 'name',+ listSlot: 'title',+ title: (+ <span style={{ paddingInlineStart: NAME_INSET }}>{text('trash.columns.name', 32, 14)}</span>+ ),+ width: 'clamp(320px, 36cqw, 420px)',+ }),+ headColumn({ key: 'type', title: text('trash.columns.type', 32, 14) }),+ headColumn({ key: 'deletedAt', title: text('trash.columns.deletedAt', 56, 14) }),+ headColumn({ key: 'expiresAt', title: text('trash.columns.expiresIn', 56, 14) }),+ headColumn({ key: 'actions', listSlot: 'actions', width: 200 }),+ ];++ return (+ <Flexbox aria-busy gap={12}>+ <Text type={'secondary'}>+ {ready ? (+ t('trash.desc', { days: TRASH_RETENTION_DAYS })+ ) : (+ <SkeletonBar height={14} width={320} />+ )}+ </Text>+ <div+ style={{+ background: cssVar.colorBgContainer,+ borderRadius: cssVar.borderRadius,+ overflow: 'hidden',+ paddingBlock: 16,+ }}+ >+ <Flexbox+ horizontal+ align={'center'}+ gap={12}+ justify={'space-between'}+ style={{ paddingBlockEnd: 16, paddingInline: 24 }}+ >+ <SkeletonBar height={32} radius={8} width={56} />+ <SkeletonBar height={32} radius={8} width={112} />+ </Flexbox>+ <LiteTable+ loading+ columns={columns}+ listBreakpoint={800}+ rowKey={() => ''}+ tableLayout={'fixed'}+ />+ </div>+ </Flexbox>+ );+};++const TrashSkeleton: SettingsTabSkeleton = { Body };++export default TrashSkeleton;diff --git a/src/components/Skeleton/Settings/tabs/Usage.tsx b/src/components/Skeleton/Settings/tabs/Usage.tsxnew file mode 100644index 00000000000..7172d2b8b98--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/Usage.tsx@@ -0,0 +1,11 @@+'use client';++import { SettingsSectionsBody } from '../Sections';+import { SETTINGS_SECTION_SHAPES } from '../sectionShapes';+import type { SettingsTabSkeleton } from './types';++const Body = () => <SettingsSectionsBody shape={SETTINGS_SECTION_SHAPES.usage} />;++const UsageSkeleton: SettingsTabSkeleton = { Body };++export default UsageSkeleton;diff --git a/src/components/Skeleton/Settings/tabs/index.ts b/src/components/Skeleton/Settings/tabs/index.tsnew file mode 100644index 00000000000..aec81223568--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/index.ts@@ -0,0 +1,76 @@+import { SettingsTabs } from '@/store/global/initialState';++import AboutSkeleton from './About';+import AdvancedSkeleton from './Advanced';+import APIKeySkeleton from './APIKey';+import AppearanceSkeleton from './Appearance';+import BillingSkeleton from './Billing';+import ConnectorSkeleton from './Connector';+import CreditsSkeleton from './Credits';+import CredsSkeleton from './Creds';+import DevicesSkeleton from './Devices';+import EnvironmentsSkeleton from './Environments';+import HotkeySkeleton from './Hotkey';+import IntegrationsSkeleton from './Integrations';+import LabelsSkeleton from './Labels';+import LabsSkeleton from './Labs';+import MemorySkeleton from './Memory';+import MessengerSkeleton from './Messenger';+import NotificationSkeleton from './Notification';+import OAuthAppsSkeleton from './OAuthApps';+import PlansSkeleton from './Plans';+import ProfileSkeleton from './Profile';+import ProxySkeleton from './Proxy';+import ReferralSkeleton from './Referral';+import SecuritySkeleton from './Security';+import ServiceModelSkeleton from './ServiceModel';+import SkillSkeleton from './Skill';+import StatsSkeleton from './Stats';+import StorageSkeleton from './Storage';+import SystemToolsSkeleton from './SystemTools';+import ToolsSkeleton from './Tools';+import TrashSkeleton from './Trash';+import type { SettingsTabSkeleton } from './types';+import UsageSkeleton from './Usage';++export type { SettingsTabSkeleton, SettingsTabSkeletonProps } from './types';++/** One loading shape per settings tab; tabs without an entry use the generic form. */+export const SETTINGS_TAB_SKELETONS: Partial<Record<SettingsTabs, SettingsTabSkeleton>> = {+ [SettingsTabs.About]: AboutSkeleton,+ [SettingsTabs.Advanced]: AdvancedSkeleton,+ [SettingsTabs.APIKey]: APIKeySkeleton,+ [SettingsTabs.Appearance]: AppearanceSkeleton,+ [SettingsTabs.Billing]: BillingSkeleton,+ [SettingsTabs.Connector]: ConnectorSkeleton,+ [SettingsTabs.Credits]: CreditsSkeleton,+ [SettingsTabs.Creds]: CredsSkeleton,+ [SettingsTabs.Devices]: DevicesSkeleton,+ [SettingsTabs.Environments]: EnvironmentsSkeleton,+ [SettingsTabs.Hotkey]: HotkeySkeleton,+ [SettingsTabs.Integrations]: IntegrationsSkeleton,+ [SettingsTabs.Labels]: LabelsSkeleton,+ [SettingsTabs.Labs]: LabsSkeleton,+ [SettingsTabs.Memory]: MemorySkeleton,+ [SettingsTabs.Messenger]: MessengerSkeleton,+ [SettingsTabs.Notification]: NotificationSkeleton,+ [SettingsTabs.OAuthApps]: OAuthAppsSkeleton,+ [SettingsTabs.Plans]: PlansSkeleton,+ [SettingsTabs.Profile]: ProfileSkeleton,+ [SettingsTabs.Proxy]: ProxySkeleton,+ [SettingsTabs.Referral]: ReferralSkeleton,+ [SettingsTabs.Security]: SecuritySkeleton,+ [SettingsTabs.ServiceModel]: ServiceModelSkeleton,+ [SettingsTabs.Skill]: SkillSkeleton,+ [SettingsTabs.Stats]: StatsSkeleton,+ [SettingsTabs.Storage]: StorageSkeleton,+ [SettingsTabs.SystemTools]: SystemToolsSkeleton,+ [SettingsTabs.Tools]: ToolsSkeleton,+ [SettingsTabs.Trash]: TrashSkeleton,+ [SettingsTabs.Usage]: UsageSkeleton,+};++export const getSettingsTabSkeleton = (tab: string): SettingsTabSkeleton | undefined =>+ Object.hasOwn(SETTINGS_TAB_SKELETONS, tab)+ ? SETTINGS_TAB_SKELETONS[tab as SettingsTabs]+ : undefined;diff --git a/src/components/Skeleton/Settings/tabs/types.ts b/src/components/Skeleton/Settings/tabs/types.tsnew file mode 100644index 00000000000..dd0534ffa30--- /dev/null+++ b/src/components/Skeleton/Settings/tabs/types.ts@@ -0,0 +1,26 @@+import type { ComponentType } from 'react';++export interface SettingsTabSkeletonProps {+ /** The second path segment, e.g. a messenger platform or an OAuth app id. */+ sub?: string;+}++/**+ * The one loading shape of a settings tab. The route fallback, the chunk+ * fallback and the tab's own data-loading branch all render it, so the page+ * never swaps between differently shaped skeletons.+ */+export interface SettingsTabSkeleton {+ /** The tab body inside the shared header + container frame. */+ Body: ComponentType<SettingsTabSkeletonProps>;+ /**+ * The whole page, for tabs that draw their own header and container+ * (`OWN_FRAME_TABS`). Mobile still renders `Body` under the mobile header.+ */+ Page?: ComponentType<SettingsTabSkeletonProps>;+ /**+ * Placeholders for the actions the settled page portals into the page-actions+ * row at the top of the content column (see `SettingsPageActions`).+ */+ PageActions?: ComponentType<SettingsTabSkeletonProps>;+}diff --git a/src/components/Skeleton/Settings/useSkeletonText.tsx b/src/components/Skeleton/Settings/useSkeletonText.tsxnew file mode 100644index 00000000000..d1b29953856--- /dev/null+++ b/src/components/Skeleton/Settings/useSkeletonText.tsx@@ -0,0 +1,22 @@+'use client';++import { type ReactNode, useCallback } from 'react';+import { useTranslation } from 'react-i18next';++import SkeletonBar from '../Bar';++/**+ * Static copy (page, group and row titles) is known before any data loads, so a+ * skeleton shows the real text. Until the namespace has loaded it falls back to+ * a bar of roughly the text's width.+ */+export const useSkeletonText = (ns: string | string[]) => {+ // Callers pass namespace names as plain strings; the typed overload only accepts literals.+ const { t, ready } = useTranslation(ns as any);++ return useCallback(+ (key: string, width: number, height = 16): ReactNode =>+ ready ? (t(key as any) as string) : <SkeletonBar height={height} width={width} />,+ [ready, t],+ );+};diff --git a/src/features/DeviceManager/DeviceDetailPage.tsx b/src/features/DeviceManager/DeviceDetailPage.tsxindex c6bc2dc9281..266d4f00246 100644--- a/src/features/DeviceManager/DeviceDetailPage.tsx+++ b/src/features/DeviceManager/DeviceDetailPage.tsx@@ -2,7 +2,7 @@import { isDesktop } from '@lobechat/const';import type { DeviceListItem, DeviceScope } from '@lobechat/types';-import { Button, Flexbox, Icon, Skeleton, Text } from '@lobehub/ui';+import { Button, Flexbox, Icon, Text } from '@lobehub/ui';import { ArrowLeftIcon, MonitorXIcon } from 'lucide-react';import { memo } from 'react';import { useTranslation } from 'react-i18next';@@ -13,21 +13,7 @@ import { useElectronStore } from '@/store/electron';import DeviceDetail from './DeviceDetail';import { deviceDetailKey, getDeviceListBoundary } from './deviceListBoundary';--const DetailSkeleton = memo(() => (- <Flexbox gap={24}>- <Skeleton height={24} width={120} />- <Flexbox horizontal align={'center'} gap={16}>- <Skeleton.Avatar shape={'square'} size={56} />- <Flexbox flex={1} gap={8}>- <Skeleton height={20} width={200} />- <Skeleton height={14} width={120} />- </Flexbox>- </Flexbox>- <Skeleton height={32} width={'100%'} />- <Skeleton.Text rows={6} />- </Flexbox>-));+import { DeviceDetailSkeleton } from './Skeleton';interface DeviceDetailPageProps {deviceId: string;@@ -81,7 +67,7 @@ const DeviceDetailPage = memo<DeviceDetailPageProps>(({ deviceId, onBack, scopeerrorVariant={'block'}isEmpty={!device}isLoading={boundary.isLoading}- loading={<DetailSkeleton />}+ loading={<DeviceDetailSkeleton />}onRetry={() => mutate()}>{device && (diff --git a/src/features/DeviceManager/DeviceManager.tsx b/src/features/DeviceManager/DeviceManager.tsxindex 479f2299192..cc06ba156b1 100644--- a/src/features/DeviceManager/DeviceManager.tsx+++ b/src/features/DeviceManager/DeviceManager.tsx@@ -19,6 +19,7 @@ import { useTranslation } from 'react-i18next';import ManagedDeviceCreateEntry from '@/business/client/features/ManagedDeviceCreateEntry';import AsyncBoundary from '@/components/AsyncBoundary';+import SettingsPageActions from '@/features/Settings/features/SettingsPageActions';import { useDeviceList } from '@/store/device';import { useElectronStore } from '@/store/electron';import { serverConfigSelectors, useServerConfigStore } from '@/store/serverConfig';@@ -336,36 +337,56 @@ const DeviceManager = memo<DeviceManagerProps>((props) => {// Workspace machines are headless, so that pool enrolls through the CLI// only; the personal wizard also offers the desktop app.+ const renderActions = (size?: 'small') => (+ <Flexbox horizontal align={'center'} gap={8} style={{ flex: 'none' }}>+ <Button+ icon={<Icon icon={RefreshCwIcon} />}+ loading={isValidating}+ size={size}+ title={t('devices.actions.refresh')}+ onClick={() => mutate()}+ />+ {showManagedDeviceCreate && (+ <ManagedDeviceCreateEntry placement={'toolbar'} scope={scope} visibility={visibility} />+ )}+ {isWorkspace ? (+ <Button+ icon={<Icon icon={TerminalIcon} />}+ size={size}+ type={'primary'}+ onClick={() => onConnect('cli')}+ >+ {t('devices.empty.methodCli.title')}+ </Button>+ ) : (+ <Button+ icon={<Icon icon={MonitorUpIcon} />}+ size={size}+ type={'primary'}+ onClick={() => onConnect()}+ >+ {t('devices.connectWizard.button')}+ </Button>+ )}+ </Flexbox>+ );+const toolbar = (<Flexbox horizontal align={'center'} gap={16} justify={'space-between'}><div style={{ minWidth: 0 }}>{toolbarLeading}</div>- <Flexbox horizontal align={'center'} gap={8} style={{ flex: 'none' }}>- <Button- icon={<Icon icon={RefreshCwIcon} />}- loading={isValidating}- title={t('devices.actions.refresh')}- onClick={() => mutate()}- />- {showManagedDeviceCreate && (- <ManagedDeviceCreateEntry placement={'toolbar'} scope={scope} visibility={visibility} />- )}- {isWorkspace ? (- <Button- icon={<Icon icon={TerminalIcon} />}- type={'primary'}- onClick={() => onConnect('cli')}- >- {t('devices.empty.methodCli.title')}- </Button>- ) : (- <Button icon={<Icon icon={MonitorUpIcon} />} type={'primary'} onClick={() => onConnect()}>- {t('devices.connectWizard.button')}- </Button>- )}- </Flexbox>+ {renderActions()}</Flexbox>);+ // With nothing on the left (the personal pool), the actions join the shared+ // settings header instead of leaving a half-empty toolbar row; hosts without+ // that header (workspace settings, mobile) keep the toolbar.+ const toolbarSlot = toolbarLeading ? (+ toolbar+ ) : (+ <SettingsPageActions fallback={toolbar}>{renderActions()}</SettingsPageActions>+ );+const list = (<AsyncBoundarydata={boundary.data}@@ -392,7 +413,7 @@ const DeviceManager = memo<DeviceManagerProps>((props) => {return (<Flexbox gap={16}>- {toolbar}+ {toolbarSlot}{list}</Flexbox>);diff --git a/src/features/DeviceManager/Skeleton.tsx b/src/features/DeviceManager/Skeleton.tsxindex d31bae87c5d..019da245464 100644--- a/src/features/DeviceManager/Skeleton.tsx+++ b/src/features/DeviceManager/Skeleton.tsx@@ -1,7 +1,8 @@'use client';-import { createStaticStyles, cssVar, Flexbox } from '@lobehub/ui';+import { createStaticStyles, cssVar, Flexbox, Text } from '@lobehub/ui';import { memo } from 'react';+import { useTranslation } from 'react-i18next';import SkeletonBar from '@/components/Skeleton/Bar';@@ -14,6 +15,39 @@ const styles = createStaticStyles(({ css }) => ({padding-block: 20px 16px;padding-inline: 20px;`,+ // Same frame as `DetailCard` in `DeviceOverview`.+ detailCard: css`+ overflow: hidden;+ display: flex;+ flex-direction: column;++ min-width: 0;+ border: 1px solid ${cssVar.colorBorderSecondary};+ border-radius: ${cssVar.borderRadiusLG};+ `,+ detailCardHeader: css`+ padding-block: 10px;+ padding-inline: 16px;+ border-block-end: 1px solid ${cssVar.colorBorderSecondary};+ background: ${cssVar.colorFillQuaternary};+ `,+ detailGrid: css`+ display: grid;+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));+ gap: 16px;+ `,+ detailRow: css`+ min-height: 48px;+ padding-block: 10px;+ padding-inline: 16px;++ & + & {+ border-block-start: 1px solid ${cssVar.colorBorderSecondary};+ }+ `,+ tabs: css`+ border-block-end: 1px solid ${cssVar.colorBorderSecondary};+ `,card: css`overflow: hidden;display: flex;@@ -138,14 +172,16 @@ export const DeviceGridSkeleton = memo(() => (DeviceGridSkeleton.displayName = 'DeviceGridSkeleton';/**- * Route fallback for the workspace devices page: the visibility tabs + actions- * toolbar above the same card grid `DeviceManager` shows while its list loads,- * so the chunk wait hands over to the data wait without a second skeleton.+ * The devices list as `DeviceManager` lays it out: the toolbar (leading slot β+ * the workspace visibility tabs β then refresh + primary connect button) above+ * the same card grid the list shows while it loads, so the chunk wait hands+ * over to the data wait without a second skeleton. The personal page has no+ * visibility tabs, so it passes `leading={false}`.*/-const DevicesPageSkeleton = () => (- <Flexbox aria-busy gap={16}>+export const DevicesListSkeleton = ({ leading = true }: { leading?: boolean }) => (+ <Flexbox aria-busy data-testid={'devices-list-skeleton'} gap={16}><Flexbox horizontal align={'center'} gap={16} justify={'space-between'}>- <SkeletonBar height={36} width={200} />+ <div>{leading && <SkeletonBar height={36} width={200} />}</div><Flexbox horizontal align={'center'} gap={8}><SkeletonBar height={36} width={36} /><SkeletonBar height={36} width={140} />@@ -155,4 +191,112 @@ const DevicesPageSkeleton = () => (</Flexbox>);+interface DetailCardShape {+ /** `InfoRow` labels; activity cards list topics / agents instead. */+ labels?: readonly string[];+ rows: number;+ titleKey: string;+}++const DETAIL_CARDS: DetailCardShape[] = [+ {+ labels: [+ 'devices.detail.status',+ 'devices.detail.os',+ 'devices.detail.connections',+ 'devices.detail.lastConnected',+ ],+ rows: 4,+ titleKey: 'devices.detail.runtime',+ },+ {+ labels: [+ 'devices.card.hostname',+ 'devices.detail.architecture',+ 'devices.detail.cpu',+ 'devices.detail.memory',+ 'devices.card.workingDir',+ ],+ rows: 5,+ titleKey: 'devices.detail.specs',+ },+ { rows: 2, titleKey: 'devices.activity.runningTopics.title' },+ { rows: 2, titleKey: 'devices.activity.boundAgents.title' },+];++/**+ * `DeviceDetail` while the device list resolves: the back button, the 56px icon+ * tile + name + id header, the tab strip and the overview's two rows of info+ * cards. Static copy (back, tab and card labels) renders as text.+ */+export const DeviceDetailSkeleton = memo(() => {+ const { t } = useTranslation('setting');++ return (+ <Flexbox aria-busy data-testid={'device-detail-skeleton'} gap={24}>+ <Flexbox horizontal>+ <Flexbox horizontal align={'center'} gap={6} height={24} paddingInline={7}>+ <SkeletonBar height={14} width={14} />+ <Text type={'secondary'}>{t('devices.detail.back')}</Text>+ </Flexbox>+ </Flexbox>+ <Flexbox horizontal align={'center'} gap={16}>+ <SkeletonBar height={56} radius={14} width={56} />+ <Flexbox flex={1} gap={4} style={{ minWidth: 0 }}>+ <Line barHeight={22} height={33} width={220} />+ <Line barHeight={13} height={24} width={280} />+ </Flexbox>+ </Flexbox>+ <Flexbox horizontal className={styles.tabs} gap={24} height={46}>+ {(['overview', 'files', 'agents'] as const).map((key) => (+ <Flexbox horizontal align={'center'} gap={6} key={key}>+ <SkeletonBar height={14} width={14} />+ <Text type={key === 'overview' ? undefined : 'secondary'}>+ {t(`devices.detail.tabs.${key}`)}+ </Text>+ </Flexbox>+ ))}+ </Flexbox>+ <div className={styles.detailGrid}>+ {DETAIL_CARDS.map((card, index) => (+ <section className={styles.detailCard} key={index}>+ <Flexbox horizontal align={'center'} className={styles.detailCardHeader} gap={8}>+ <SkeletonBar height={14} width={14} />+ <Text fontSize={13} weight={500}>+ {t(card.titleKey as any)}+ </Text>+ </Flexbox>+ {Array.from({ length: card.rows }, (_, row) => (+ <Flexbox+ horizontal+ align={'center'}+ className={styles.detailRow}+ justify={'space-between'}+ key={row}+ >+ {card.labels ? (+ <Flexbox horizontal align={'center'} gap={8}>+ <SkeletonBar height={14} width={14} />+ <Text fontSize={13} type={'secondary'}>+ {t(card.labels[row] as any)}+ </Text>+ </Flexbox>+ ) : (+ <Line barHeight={13} height={28} width={160 + (row % 2) * 48} />+ )}+ <Line barHeight={13} height={28} width={card.labels ? 120 + (row % 3) * 32 : 48} />+ </Flexbox>+ ))}+ </section>+ ))}+ </div>+ </Flexbox>+ );+});++DeviceDetailSkeleton.displayName = 'DeviceDetailSkeleton';++/** Route fallback for the workspace devices page (visibility tabs + toolbar + grid). */+const DevicesPageSkeleton = () => <DevicesListSkeleton />;+export default DevicesPageSkeleton;diff --git a/src/features/EnvironmentManager/Skeleton.tsx b/src/features/EnvironmentManager/Skeleton.tsxnew file mode 100644index 00000000000..ea6f96402b3--- /dev/null+++ b/src/features/EnvironmentManager/Skeleton.tsx@@ -0,0 +1,61 @@+'use client';++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 ListSkeleton from '@/components/ListSkeleton';+import SkeletonBar from '@/components/Skeleton/Bar';++const styles = stylex.create({+ // Same frame as the manager's `listCol`.+ listCol: {+ overflow: 'hidden',+ minWidth: 0,+ borderWidth: '1px',+ borderStyle: 'solid',+ borderColor: cssVar.colorBorderSecondary,+ borderRadius: cssVar.borderRadiusLG,+ backgroundColor: cssVar.colorBgContainer,+ },+});++/**+ * The environment list while it loads: the bordered list frame with the same+ * 4px inset and 72px rows (`EnvironmentItem`, 2px apart) the loaded list uses.+ */+export const EnvironmentListSkeleton = () => (+ <Flexbox {...stylex.props(styles.listCol)}>+ <Flexbox padding={4}>+ <ListSkeleton />+ </Flexbox>+ </Flexbox>+);++/**+ * `EnvironmentManager` before its chunk loads: the heading row (pool tabs, or+ * the section name, then refresh + create) above the list frame. `leading`+ * replaces the section name, e.g. with a tab-strip placeholder.+ */+export const EnvironmentManagerSkeleton = ({ leading }: { leading?: ReactNode }) => {+ const { t } = useTranslation('setting');++ return (+ <Flexbox aria-busy data-testid={'environments-skeleton'} gap={16}>+ <Flexbox horizontal align={'center'} gap={16} justify={'space-between'}>+ {leading ?? (+ <Text fontSize={16} weight={600}>+ {t('environments.mine')}+ </Text>+ )}+ <Flexbox horizontal align={'center'} gap={8}>+ <SkeletonBar height={32} width={32} />+ <SkeletonBar height={32} width={128} />+ </Flexbox>+ </Flexbox>+ <EnvironmentListSkeleton />+ </Flexbox>+ );+};diff --git a/src/features/EnvironmentManager/index.tsx b/src/features/EnvironmentManager/index.tsxindex 08af8cb0966..f8fddf8d351 100644--- a/src/features/EnvironmentManager/index.tsx+++ b/src/features/EnvironmentManager/index.tsx@@ -16,11 +16,11 @@ import { memo, type ReactNode, useEffect, useState } from 'react';import { useTranslation } from 'react-i18next';import AsyncBoundary from '@/components/AsyncBoundary';-import ListSkeleton from '@/components/ListSkeleton';import { openCreateEnvironmentModal } from './CreateEnvironmentModal';import EnvironmentDetailPanel from './EnvironmentDetailPanel';import EnvironmentItem from './EnvironmentItem';+import { EnvironmentListSkeleton } from './Skeleton';import { type CreatedEnvironment, useEnvironments } from './useEnvironmentData';const styles = createStaticStyles(({ css }) => ({@@ -177,6 +177,7 @@ const EnvironmentManager = memo<EnvironmentManagerProps>(({ tabs, visibility })errorVariant={'block'}isEmpty={environments.length === 0}isLoading={!ready}+ loading={<EnvironmentListSkeleton />}empty={// Inside the same frame the rows land in, sized to the skeleton's// rows: loading, empty and loaded are one surface whose contents@@ -203,13 +204,6 @@ const EnvironmentManager = memo<EnvironmentManagerProps>(({ tabs, visibility })</Center></Flexbox>}- loading={- <Flexbox className={styles.listCol}>- <Flexbox padding={4}>- <ListSkeleton />- </Flexbox>- </Flexbox>- }onRetry={refresh}><Flexbox horizontal align={'flex-start'} gap={16} wrap={'wrap'}>diff --git a/src/features/Integrations/Github/index.tsx b/src/features/Integrations/Github/index.tsxindex 343f1f0f43d..33156082b72 100644--- a/src/features/Integrations/Github/index.tsx+++ b/src/features/Integrations/Github/index.tsx@@ -7,7 +7,6 @@ import {createStaticStyles,Flexbox,Icon,- Skeleton,Text,toast,} from '@lobehub/ui';@@ -22,6 +21,7 @@ import { useAppOrigin } from '@/hooks/useAppOrigin';import { usePermission } from '@/hooks/usePermission';import { scmService } from '@/services/scm';+import { IntegrationConnectionsSkeleton } from '../Skeleton';import { useGithubIntegration } from '../useGithubIntegration';import Automation from './Automation';import Connections from './Connections';@@ -223,7 +223,7 @@ const GithubIntegration = memo<GithubIntegrationProps>(({ onBack }) => {) : null}{data.isInitialLoading ? (- <Skeleton height={96} />+ <IntegrationConnectionsSkeleton title={t('github.connections.title')} />) : (<ConnectionsblockedReason={blockedReason}diff --git a/src/features/Integrations/Linear/index.tsx b/src/features/Integrations/Linear/index.tsxindex 7fb08cd9fa9..f9b38296328 100644--- a/src/features/Integrations/Linear/index.tsx+++ b/src/features/Integrations/Linear/index.tsx@@ -1,6 +1,6 @@'use client';-import { createStaticStyles, Flexbox, Icon, Skeleton, Text, toast } from '@lobehub/ui';+import { createStaticStyles, Flexbox, Icon, Text, toast } from '@lobehub/ui';import { ArrowLeftIcon, BookOpenIcon } from 'lucide-react';import { memo, useEffect } from 'react';import { useTranslation } from 'react-i18next';@@ -11,6 +11,7 @@ import AsyncError from '@/components/AsyncError';import { useAppOrigin } from '@/hooks/useAppOrigin';import { usePermission } from '@/hooks/usePermission';+import { IntegrationConnectionsSkeleton } from '../Skeleton';import { useLinearIntegration } from '../useLinearIntegration';import Connections from './Connections';import { LINEAR_INTEGRATION } from './definition';@@ -143,7 +144,7 @@ const LinearIntegration = memo<LinearIntegrationProps>(({ onBack }) => {</Flexbox>{data.isInitialLoading ? (- <Skeleton height={96} />+ <IntegrationConnectionsSkeleton title={t('linear.connections.title')} />) : (<ConnectionsblockedReason={blockedReason}diff --git a/src/features/Integrations/Overview.tsx b/src/features/Integrations/Overview.tsxindex b41b8b2d038..0c4dfa101e3 100644--- a/src/features/Integrations/Overview.tsx+++ b/src/features/Integrations/Overview.tsx@@ -5,7 +5,9 @@ import { memo } from 'react';import { useTranslation } from 'react-i18next';import IntegrationCard from './IntegrationCard';+import { isDirectorySettling } from './loading';import { type IntegrationId, INTEGRATIONS, UPCOMING_INTEGRATIONS } from './registry';+import { IntegrationsOverviewSkeleton } from './Skeleton';import { useGithubIntegration } from './useGithubIntegration';import { useLinearIntegration } from './useLinearIntegration';@@ -61,6 +63,16 @@ const Overview = memo<OverviewProps>(({ onOpen }) => {};const enabled = INTEGRATIONS.filter((item) => enabledById[item.id]);+ // Statuses and the Enabled strip depend on both connection lookups; swap the+ // directory in once they settle instead of letting the strip pop in later.+ if (isDirectorySettling([github, linear]))+ return (+ <IntegrationsOverviewSkeleton+ available={INTEGRATIONS.length}+ upcoming={UPCOMING_INTEGRATIONS.length}+ />+ );+return (<Flexbox gap={24}>{enabled.length > 0 ? (diff --git a/src/features/Integrations/Skeleton.tsx b/src/features/Integrations/Skeleton.tsxnew file mode 100644index 00000000000..9a23f814d6a--- /dev/null+++ b/src/features/Integrations/Skeleton.tsx@@ -0,0 +1,186 @@+'use client';++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';++const styles = stylex.create({+ // `IntegrationCard`: filled, 14px/16px padding, 40px icon tile.+ card: {+ paddingBlock: '14px',+ paddingInline: '16px',+ 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',+ paddingInline: '16px',+ borderRadius: cssVar.borderRadiusLG,+ backgroundColor: cssVar.colorFillQuaternary,+ },+ list: {+ display: 'grid',+ gridTemplateColumns: '1fr',+ gap: '10px',+ },+ sectionLabel: {+ fontSize: '12px',+ fontWeight: 500,+ color: cssVar.colorTextTertiary,+ },+ upcoming: {+ display: 'grid',+ gridTemplateColumns: {+ 'default': 'repeat(2, 1fr)',+ '@media (width <= 720px)': '1fr',+ },+ gap: '8px',+ },+ upcomingCard: {+ paddingBlock: '10px',+ paddingInline: '14px',+ borderRadius: cssVar.borderRadiusLG,+ backgroundColor: cssVar.colorFillQuaternary,+ },+});++const Line = ({ bar, height, width }: { bar: number; height: number; width: number | string }) => (+ <Flexbox height={height} justify={'center'} style={{ minWidth: 0 }}>+ <SkeletonBar height={bar} width={width} />+ </Flexbox>+);++/**+ * The integrations directory until every integration's connection state has+ * loaded: the "All" list and the "Coming soon" grid. Section labels are static+ * copy; the Enabled strip only appears once a connection is known, so the+ * directory swaps in once instead of statuses and the strip popping in apart.+ */+export const IntegrationsOverviewSkeleton = ({+ available = 2,+ upcoming = 4,+}: {+ available?: number;+ upcoming?: number;+}) => {+ const { t } = useTranslation('integration');++ return (+ <Flexbox aria-busy data-testid={'integrations-overview-skeleton'} gap={24}>+ <Flexbox gap={10}>+ <span {...stylex.props(styles.sectionLabel)}>{t('overview.all')}</span>+ <div {...stylex.props(styles.list)}>+ {Array.from({ length: available }, (_, index) => (+ <Flexbox+ horizontal+ align={'center'}+ gap={14}+ key={index}+ {...stylex.props(styles.card)}+ >+ <SkeletonBar height={40} width={40} />+ <Flexbox flex={1} gap={2} style={{ minWidth: 0 }}>+ <Line bar={15} height={24} width={72 + (index % 2) * 16} />+ <Line bar={12} height={22} width={'64%'} />+ </Flexbox>+ <Line bar={12} height={22} width={64} />+ </Flexbox>+ ))}+ </div>+ </Flexbox>+ <Flexbox gap={10}>+ <span {...stylex.props(styles.sectionLabel)}>{t('overview.comingSoon')}</span>+ <div {...stylex.props(styles.upcoming)}>+ {Array.from({ length: upcoming }, (_, index) => (+ <Flexbox+ horizontal+ align={'center'}+ gap={14}+ key={index}+ {...stylex.props(styles.upcomingCard)}+ >+ <SkeletonBar height={32} width={32} />+ {/* Name over a one-line tagline, as `UpcomingCard` renders. */}+ <Flexbox flex={1} style={{ minWidth: 0 }}>+ <Line bar={14} height={24} width={64 + (index % 2) * 16} />+ <Line bar={12} height={22} width={'72%'} />+ </Flexbox>+ <Line bar={12} height={22} width={56} />+ </Flexbox>+ ))}+ </div>+ </Flexbox>+ </Flexbox>+ );+};++/**+ * An integration's Connections section while it loads: the title + small+ * connect button row above one filled connection row (36px avatar, name and+ * detail line, status).+ */+export const IntegrationConnectionsSkeleton = ({ title }: { title?: string }) => (+ <Flexbox aria-busy gap={10}>+ <Flexbox horizontal align={'center'} gap={16} justify={'space-between'}>+ {title ? (+ <Text strong style={{ fontSize: 16 }}>+ {title}+ </Text>+ ) : (+ <Line bar={16} height={24} width={96} />+ )}+ <SkeletonBar height={24} width={88} />+ </Flexbox>+ <div {...stylex.props(styles.connections)}>+ <Flexbox horizontal align={'center'} gap={12} paddingBlock={10}>+ <SkeletonBar height={36} radius={'50%'} width={36} />+ <Flexbox flex={1} gap={1} style={{ minWidth: 0 }}>+ <Line bar={14} height={22} width={120} />+ <Line bar={12} height={22} width={'48%'} />+ </Flexbox>+ <Line bar={14} height={30} width={72} />+ </Flexbox>+ </div>+ </Flexbox>+);++/**+ * `/settings/integrations/:id` before its chunk loads: the back link (static+ * copy), the 56px hero with name + tagline, and the Connections section.+ */+export const IntegrationDetailSkeleton = () => {+ const { t } = useTranslation('integration');++ return (+ <Flexbox aria-busy data-testid={'integration-detail-skeleton'} gap={24}>+ <Flexbox horizontal align={'center'} gap={6}>+ <SkeletonBar height={14} width={14} />+ <Text type={'secondary'}>{t('overview.title')}</Text>+ </Flexbox>+ <Flexbox horizontal align={'center'} gap={16}>+ <SkeletonBar height={56} radius={cssVar.borderRadiusLG} width={56} />+ <Flexbox flex={1} gap={2}>+ <Line bar={20} height={30} width={96} />+ <Line bar={14} height={22} width={'56%'} />+ </Flexbox>+ <Line bar={13} height={22} width={88} />+ </Flexbox>+ <IntegrationConnectionsSkeleton />+ </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/Integrations/loading.test.ts b/src/features/Integrations/loading.test.tsnew file mode 100644index 00000000000..2fc20c46687--- /dev/null+++ b/src/features/Integrations/loading.test.ts@@ -0,0 +1,26 @@+import { describe, expect, it } from 'vitest';++import { isDirectorySettling } from './loading';++describe('isDirectorySettling', () => {+ it('waits while any lookup is still loading', () => {+ expect(isDirectorySettling([{ isInitialLoading: false }, { isInitialLoading: true }])).toBe(+ true,+ );+ });++ it('settles once every lookup has data', () => {+ expect(isDirectorySettling([{ isInitialLoading: false }, { isInitialLoading: false }])).toBe(+ false,+ );+ });++ it('treats a failed lookup as settled so the directory still renders', () => {+ expect(+ isDirectorySettling([+ { error: new Error('boom'), isInitialLoading: true },+ { isInitialLoading: false },+ ]),+ ).toBe(false);+ });+});diff --git a/src/features/Integrations/loading.ts b/src/features/Integrations/loading.tsnew file mode 100644index 00000000000..b794c7fbe85--- /dev/null+++ b/src/features/Integrations/loading.ts@@ -0,0 +1,12 @@+interface ConnectionLookup {+ error?: unknown;+ isInitialLoading: boolean;+}++/**+ * Whether the integrations directory should still show its skeleton. A failed+ * lookup counts as settled (the integration reads as not enabled), so one+ * integration's error never hides the whole directory behind the skeleton.+ */+export const isDirectorySettling = (lookups: ConnectionLookup[]) =>+ lookups.some((lookup) => lookup.isInitialLoading && !lookup.error);diff --git a/src/features/Messenger/IntegrationDetail/Discord.tsx b/src/features/Messenger/IntegrationDetail/Discord.tsxindex ec858d12321..bafd5caddc6 100644--- a/src/features/Messenger/IntegrationDetail/Discord.tsx+++ b/src/features/Messenger/IntegrationDetail/Discord.tsx@@ -62,7 +62,8 @@ const DiscordDetail = memo<DiscordDetailProps>(({ appId, botUsername, name, onBaif (data.error && data.isInitialLoading)return <AsyncError error={data.error} variant={'block'} onRetry={data.mutate} />;- if (data.isInitialLoading) return <IntegrationDetailSkeleton withNestedContent />;+ if (data.isInitialLoading)+ return <IntegrationDetailSkeleton withNestedContent platform={'discord'} />;const { installations, links } = data;const hasInstallations = installations.length > 0;diff --git a/src/features/Messenger/IntegrationDetail/Linq.tsx b/src/features/Messenger/IntegrationDetail/Linq.tsxindex a6dba2b4a35..9fa780a8a0f 100644--- a/src/features/Messenger/IntegrationDetail/Linq.tsx+++ b/src/features/Messenger/IntegrationDetail/Linq.tsx@@ -290,7 +290,8 @@ const LinqDetail = memo<LinqDetailProps>(({ name, onBack }) => {if (data.error && data.isInitialLoading)return <AsyncError error={data.error} variant="block" onRetry={data.mutate} />;- if (data.isInitialLoading) return <IntegrationDetailSkeleton withNestedContent />;+ if (data.isInitialLoading)+ return <IntegrationDetailSkeleton withNestedContent platform={'linq'} />;const link = data.links[0];diff --git a/src/features/Messenger/IntegrationDetail/Slack.tsx b/src/features/Messenger/IntegrationDetail/Slack.tsxindex 367382ca7b7..e91a7e04bc8 100644--- a/src/features/Messenger/IntegrationDetail/Slack.tsx+++ b/src/features/Messenger/IntegrationDetail/Slack.tsx@@ -59,7 +59,7 @@ const SlackDetail = memo<SlackDetailProps>(({ appId, botUsername, name, onBack }if (data.error && data.isInitialLoading)return <AsyncError error={data.error} variant={'block'} onRetry={data.mutate} />;- if (data.isInitialLoading) return <IntegrationDetailSkeleton />;+ if (data.isInitialLoading) return <IntegrationDetailSkeleton platform={'slack'} />;const { installations, links, tenantNameByTenantId } = data;const hasInstallations = installations.length > 0;diff --git a/src/features/Messenger/IntegrationDetail/Telegram.tsx b/src/features/Messenger/IntegrationDetail/Telegram.tsxindex 03e07336556..de067cd63e3 100644--- a/src/features/Messenger/IntegrationDetail/Telegram.tsx+++ b/src/features/Messenger/IntegrationDetail/Telegram.tsx@@ -44,7 +44,8 @@ const TelegramDetail = memo<TelegramDetailProps>(({ appId, botUsername, name, onif (data.error && data.isInitialLoading)return <AsyncError error={data.error} variant={'block'} onRetry={data.mutate} />;- if (data.isInitialLoading) return <IntegrationDetailSkeleton withNestedContent />;+ if (data.isInitialLoading)+ return <IntegrationDetailSkeleton withNestedContent platform={'telegram'} />;const { links } = data;const hasLinks = links.length > 0;diff --git a/src/features/Messenger/IntegrationDetail/Wechat.tsx b/src/features/Messenger/IntegrationDetail/Wechat.tsxindex eb823452736..091b9584e81 100644--- a/src/features/Messenger/IntegrationDetail/Wechat.tsx+++ b/src/features/Messenger/IntegrationDetail/Wechat.tsx@@ -262,7 +262,8 @@ const WechatDetail = memo<WechatDetailProps>(({ access, name, onBack }) => {if (data.error && data.isInitialLoading)return <AsyncError error={data.error} variant="block" onRetry={data.mutate} />;- if (data.isInitialLoading) return <IntegrationDetailSkeleton withNestedContent />;+ if (data.isInitialLoading)+ return <IntegrationDetailSkeleton withNestedContent platform={'wechat'} />;const link = data.links[0];const installation = data.installations[0];diff --git a/src/features/Messenger/constants.tsx b/src/features/Messenger/constants.tsxindex 665da31eff2..4ecc7f362f9 100644--- a/src/features/Messenger/constants.tsx+++ b/src/features/Messenger/constants.tsx@@ -1,15 +1,9 @@import { Discord, IMessage, Slack, Telegram, WeChat } from '@lobehub/ui/icons';import type { ReactNode } from 'react';-export type MessengerPlatform = 'telegram' | 'slack' | 'discord' | 'wechat' | 'linq';+import type { MessengerPlatform } from './platforms';-export const SUPPORTED_MESSENGER_PLATFORMS = [- { id: 'telegram', name: 'Telegram' },- { id: 'slack', name: 'Slack' },- { id: 'discord', name: 'Discord' },- { id: 'wechat', name: 'WeChat' },- { id: 'linq', name: 'iMessage' },-] as const satisfies readonly { id: MessengerPlatform; name: string }[];+export { type MessengerPlatform, SUPPORTED_MESSENGER_PLATFORMS } from './platforms';export const PLATFORM_TAB_ICONS: Record<MessengerPlatform, ReactNode> = {discord: <Discord.Color size={16} />,diff --git a/src/features/Messenger/index.tsx b/src/features/Messenger/index.tsxindex 49688251bd5..528f24ed935 100644--- a/src/features/Messenger/index.tsx+++ b/src/features/Messenger/index.tsx@@ -1,6 +1,6 @@'use client';-import { Button, createStaticStyles, Flexbox, Skeleton, Text, toast } from '@lobehub/ui';+import { Button, createStaticStyles, Flexbox, Text, toast } from '@lobehub/ui';import { memo, useEffect, useState } from 'react';import { useTranslation } from 'react-i18next';import { useParams } from 'react-router';@@ -8,7 +8,10 @@ import useSWR from 'swr';import AsyncBoundary from '@/components/AsyncBoundary';import ImperativeModal from '@/components/ImperativeModal';-import { MessengerPlatformDetailSkeleton } from '@/components/Skeleton/Settings/MessengerDetail';+import {+ MessengerListGridSkeleton,+ MessengerPlatformDetailSkeleton,+} from '@/components/Skeleton/Settings/MessengerDetail';import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';import { messengerKeys } from '@/libs/swr/keys';import { messengerService } from '@/services/messenger';@@ -148,7 +151,7 @@ const MessengerSettings = memo(() => {errorVariant={'block'}isEmpty={platforms.length === 0}isLoading={platformsSWR.isLoading}- loading={<Skeleton.Text rows={3} />}+ loading={<MessengerListGridSkeleton />}empty={<div className={styles.emptyState}>{t('messenger.noPlatformsConfigured')}</div>}diff --git a/src/features/Messenger/platforms.ts b/src/features/Messenger/platforms.tsnew file mode 100644index 00000000000..406bf00fa6d--- /dev/null+++ b/src/features/Messenger/platforms.ts@@ -0,0 +1,14 @@+/**+ * Platform ids and display names without the brand icons, so route skeletons+ * (loaded with the router on first paint) can show real names without pulling+ * `@lobehub/ui/icons` into that graph.+ */+export type MessengerPlatform = 'telegram' | 'slack' | 'discord' | 'wechat' | 'linq';++export const SUPPORTED_MESSENGER_PLATFORMS = [+ { id: 'telegram', name: 'Telegram' },+ { id: 'slack', name: 'Slack' },+ { id: 'discord', name: 'Discord' },+ { id: 'wechat', name: 'WeChat' },+ { id: 'linq', name: 'iMessage' },+] as const satisfies readonly { id: MessengerPlatform; name: string }[];diff --git a/src/features/ServiceModel/ChatAssistForm.tsx b/src/features/ServiceModel/ChatAssistForm.tsxindex 6f4540a7adf..74840df316c 100644--- a/src/features/ServiceModel/ChatAssistForm.tsx+++ b/src/features/ServiceModel/ChatAssistForm.tsx@@ -8,7 +8,7 @@ import { useTranslation } from 'react-i18next';import AsyncError from '@/components/AsyncError';import AutoSaveHint from '@/components/Editor/AutoSaveHint';-import { RouteLoading } from '@/components/Skeleton/RouteSegment';+import SettingsSectionSkeleton from '@/components/Skeleton/Settings/Section';import { FORM_STYLE } from '@/const/layoutTokens';import ModelSelect from '@/features/ModelSelect';import { SettingsSearchAnchor } from '@/features/SettingsSearch/anchor';@@ -94,7 +94,20 @@ const ChatAssistForm = memo(() => {onRetry={() => refreshUserState()}/>);- return <RouteLoading />;+ // One filled group of the chat-assist rows, as in the settled form;+ // `RouteLoading` nested a second padded container inside the settings one.+ return (+ <SettingsSectionSkeleton+ groups={[+ {+ desc: t('chatPreference.assist.desc'),+ labels: PERSONAL_SYSTEM_AGENT_KEYS.map((key) => t(`systemAgent.${key}.title`)),+ rows: PERSONAL_SYSTEM_AGENT_KEYS.length,+ title: t('chatPreference.assist.title'),+ },+ ]}+ />+ );}const items: FormFieldProps[] = PERSONAL_SYSTEM_AGENT_KEYS.map((key) => {diff --git a/src/features/ServiceModel/ServiceModelForm/index.tsx b/src/features/ServiceModel/ServiceModelForm/index.tsxindex e93387627d8..c5913f5d67b 100644--- a/src/features/ServiceModel/ServiceModelForm/index.tsx+++ b/src/features/ServiceModel/ServiceModelForm/index.tsx@@ -12,7 +12,7 @@ import { useLocation } from 'react-router';import AsyncError from '@/components/AsyncError';import AutoSaveHint from '@/components/Editor/AutoSaveHint';-import { RouteLoading } from '@/components/Skeleton/RouteSegment';+import { ServiceModelFormSkeleton } from '@/components/Skeleton/Settings/tabs/ServiceModel';import { FORM_STYLE } from '@/const/layoutTokens';import { SettingsSearchAnchor } from '@/features/SettingsSearch/anchor';import { usePermission } from '@/hooks/usePermission';@@ -139,7 +139,9 @@ const ServiceModelForm = ({ hidePersonalPreferences }: ServiceModelFormProps) =>onRetry={() => refreshUserState()}/>);- return <RouteLoading />;+ // Same model cards the route and chunk fallbacks draw; `RouteLoading` here+ // nested a second padded container inside the settings one.+ return <ServiceModelFormSkeleton />;}const skipSlots = hidePersonalPreferences ? PERSONAL_SLOTS : NO_SLOTS;diff --git a/src/features/Settings/Layout/index.tsx b/src/features/Settings/Layout/index.tsxindex bfa6d746622..00795698c45 100644--- a/src/features/Settings/Layout/index.tsx+++ b/src/features/Settings/Layout/index.tsx@@ -6,7 +6,6 @@ import { type FC } from 'react';import { Outlet } from 'react-router';import SideBar from '@/features/Settings/Layout/SideBar';-import { RouteSkeletonChromeProvider } from '@/spa/router/routeSkeletonChrome';import SettingsContextProvider from './ContextProvider';import { styles } from './style';@@ -21,9 +20,9 @@ const Layout: FC = () => {><SideBar /><Flexbox className={stylex.props(styles.mainContainer).className} flex={1} height={'100%'}>- <RouteSkeletonChromeProvider>- <Outlet />- </RouteSkeletonChromeProvider>+ {/* The layout draws no header: every tab's route skeleton draws the+ shared settings header with the real tab title itself. */}+ <Outlet /></Flexbox></SettingsContextProvider>);diff --git a/src/features/Settings/advanced/index.tsx b/src/features/Settings/advanced/index.tsxindex d0f347f4fe6..c35cd22681a 100644--- a/src/features/Settings/advanced/index.tsx+++ b/src/features/Settings/advanced/index.tsx@@ -8,7 +8,7 @@ import { memo, useCallback, useEffect, useState } from 'react';import { useTranslation } from 'react-i18next';import AsyncError from '@/components/AsyncError';-import { SettingsSectionSkeleton } from '@/components/Skeleton';+import AdvancedSkeleton from '@/components/Skeleton/Settings/tabs/Advanced';import { FORM_STYLE } from '@/const/layoutTokens';import SettingHeader from '@/features/Settings/features/SettingHeader';import { SettingsSearchAnchor } from '@/features/SettingsSearch/anchor';@@ -20,7 +20,7 @@ import { type UserGeneralConfig } from '@/types/user/settings';type UpdateChannelValue = 'canary' | 'stable';-const Page = memo(() => {+const Page = memo<{ showSettingHeader?: boolean }>(({ showSettingHeader = true }) => {const { t } = useTranslation('setting');const general = useUserStore((s) => settingsSelectors.currentSettings(s).general, isEqual);@@ -83,17 +83,11 @@ const Page = memo(() => {onRetry={() => refreshUserState()}/>);- // Mirror the loaded page: header plus the tools group (dev mode + optional- // gateway mode) and, on desktop, the single-row update-channel group.+ // The registered tab skeleton, so the chunk and data waits show one shape.return (<>- <SettingHeader title={t('tab.advanced')} />- <SettingsSectionSkeleton- groups={[- { rows: enableGatewayMode ? 2 : 1, titleWidth: 160 },- ...(isDesktop ? [{ rows: 1, titleWidth: 112 }] : []),- ]}- />+ {showSettingHeader && <SettingHeader title={t('tab.advanced')} />}+ <AdvancedSkeleton.Body /></>);}@@ -161,7 +155,7 @@ const Page = memo(() => {return (<>- <SettingHeader title={t('tab.advanced')} />+ {showSettingHeader && <SettingHeader title={t('tab.advanced')} />}<Formcollapsible={false}form={form}diff --git a/src/features/Settings/appearance/features/Font/index.tsx b/src/features/Settings/appearance/features/Font/index.tsxindex a4adac7ee6f..d2337fb1e3f 100644--- a/src/features/Settings/appearance/features/Font/index.tsx+++ b/src/features/Settings/appearance/features/Font/index.tsx@@ -1,12 +1,13 @@'use client';import { isDesktop } from '@lobechat/const';-import { Flexbox, Select, Skeleton, Switch } from '@lobehub/ui';+import { Select, Switch } from '@lobehub/ui';import { Form, type FormGroupItem, useForm } from '@lobehub/ui/form';import { memo, useMemo } from 'react';import { useTranslation } from 'react-i18next';import AutoSaveHint from '@/components/Editor/AutoSaveHint';+import { FontSectionSkeleton } from '@/components/Skeleton/Settings/tabs/Appearance';import { FORM_STYLE } from '@/const/layoutTokens';import { SettingsSearchAnchor } from '@/features/SettingsSearch/anchor';import { useSaveState } from '@/hooks/useSaveState';@@ -18,8 +19,6 @@ import FallbackFontList from './FallbackFontList';import { FontSizeControl } from './FontSize';import { joinFontStack, parseFontStack } from './fontStack';-const loadingTextStyle = { marginBlock: 1.5 };-const FontSettings = memo(() => {const { t } = useTranslation('setting');const [fontFamily, monospaceFontFamily] = useUserStore((s) => [@@ -56,63 +55,7 @@ const FontSettings = memo(() => {const saveMonospaceStack = (stack: string[]) =>save(() => updatePreference({ terminalFontFamily: joinFontStack(stack) }));- if (!isUserStateInit) {- const loadingFont: FormGroupItem = {- children: [- ...(isDesktop- ? [- {- children: <Skeleton height={32} width={320} />,- desc: <Skeleton height={12} style={loadingTextStyle} width={240} />,- label: <Skeleton height={16} style={loadingTextStyle} width={96} />,- minWidth: undefined,- },- {- children: <Skeleton height={32} width={320} />,- desc: <Skeleton height={12} style={loadingTextStyle} width={280} />,- label: <Skeleton height={16} style={loadingTextStyle} width={128} />,- minWidth: undefined,- },- ]- : []),- {- children: (- <Flexbox gap={16} width={'100%'}>- <Flexbox gap={24}>- <Skeleton height={4} width={'100%'} />- <Flexbox horizontal align={'center'} justify={'space-between'}>- <Skeleton height={14} width={12} />- <Skeleton height={14} width={64} />- <Skeleton height={14} width={12} />- </Flexbox>- </Flexbox>- <Flexbox justify={'center'} style={{ height: 30 }}>- <Skeleton height={16} style={{ maxWidth: '100%' }} width={400} />- </Flexbox>- </Flexbox>- ),- desc: <Skeleton height={12} style={loadingTextStyle} width={144} />,- label: <Skeleton height={16} style={loadingTextStyle} width={72} />,- layout: 'vertical',- minWidth: '100%',- },- ],- extra: <Skeleton height={16} width={136} />,- title: <Skeleton height={18} width={48} />,- };-- return (- <Form- aria-busy- collapsible={false}- form={form}- items={[loadingFont]}- itemsType={'group'}- variant={'filled'}- {...FORM_STYLE}- />- );- }+ if (!isUserStateInit) return <FontSectionSkeleton />;const font: FormGroupItem = {children: [diff --git a/src/features/Settings/chat-appearance/features/ChatAppearance/index.tsx b/src/features/Settings/chat-appearance/features/ChatAppearance/index.tsxindex eda33ea0a52..2a970a6fe57 100644--- a/src/features/Settings/chat-appearance/features/ChatAppearance/index.tsx+++ b/src/features/Settings/chat-appearance/features/ChatAppearance/index.tsx@@ -7,7 +7,7 @@ import { memo, useState } from 'react';import { useTranslation } from 'react-i18next';import AutoSaveHint from '@/components/Editor/AutoSaveHint';-import { SettingsSectionSkeleton } from '@/components/Skeleton';+import { ChatAppearanceSectionSkeleton } from '@/components/Skeleton/Settings/tabs/Appearance';import { FORM_STYLE } from '@/const/layoutTokens';import { useSaveState } from '@/hooks/useSaveState';import { useUserStore } from '@/store/user';@@ -27,7 +27,7 @@ const ChatAppearance = memo(() => {const [savingKey, setSavingKey] = useState<string>();const form = useForm();- if (!isUserStateInit) return <SettingsSectionSkeleton />;+ if (!isUserStateInit) return <ChatAppearanceSectionSkeleton />;const handleChange = (key: string, value: any) => {setSavingKey(key);diff --git a/src/features/Settings/common/features/Appearance/index.tsx b/src/features/Settings/common/features/Appearance/index.tsxindex 62d220b3ecf..18bdb9c2694 100644--- a/src/features/Settings/common/features/Appearance/index.tsx+++ b/src/features/Settings/common/features/Appearance/index.tsx@@ -6,7 +6,7 @@ import { memo } from 'react';import { useTranslation } from 'react-i18next';import AutoSaveHint from '@/components/Editor/AutoSaveHint';-import { SettingsSectionSkeleton } from '@/components/Skeleton';+import { AppearanceSectionSkeleton } from '@/components/Skeleton/Settings/tabs/Appearance';import { FORM_STYLE } from '@/const/layoutTokens';import { SettingsSearchAnchor } from '@/features/SettingsSearch/anchor';import { useSaveState } from '@/hooks/useSaveState';@@ -28,7 +28,7 @@ const Appearance = memo(() => {onValuesChange: (value) => save(() => setSettings({ general: value })),});- if (!isUserStateInit) return <SettingsSectionSkeleton />;+ if (!isUserStateInit) return <AppearanceSectionSkeleton />;const theme: FormGroupItem<UserGeneralConfig> = {children: [diff --git a/src/features/Settings/common/features/Common/Common.tsx b/src/features/Settings/common/features/Common/Common.tsxindex 49a29bcd5d3..7740ccce5f6 100644--- a/src/features/Settings/common/features/Common/Common.tsx+++ b/src/features/Settings/common/features/Common/Common.tsx@@ -9,7 +9,7 @@ import { memo } from 'react';import { useTranslation } from 'react-i18next';import AutoSaveHint from '@/components/Editor/AutoSaveHint';-import { SettingsSectionSkeleton } from '@/components/Skeleton';+import { CommonSectionSkeleton } from '@/components/Skeleton/Settings/tabs/Appearance';import { FORM_STYLE } from '@/const/layoutTokens';import { imageUrl } from '@/const/url';import { isDesktop } from '@/const/version';@@ -46,29 +46,7 @@ const Common = memo(() => {switchLocale(value);};- // One filled group: theme, language, animation, context menu, response language.- // The theme row is the 332Γ86 `ImageSelect`, so it reserves that size instead of an input.- if (!(isStatusInit && isUserStateInit))- return (- <SettingsSectionSkeleton- groups={[- {- // Settled sizes: theme ImageSelect, language Select, motion and- // context-menu Segmented controls, reply-language Select.- controls: {- 0: { height: 86, width: 332 },- 1: { height: 32, width: 167 },- 2: { height: 38, width: 230 },- 3: { height: 38, width: 165 },- 4: { height: 32, width: 167 },- },- rows: 5,- titleWidth: 96,- withDesc: false,- },- ]}- />- );+ if (!(isStatusInit && isUserStateInit)) return <CommonSectionSkeleton />;const themeFormGroup: FormGroupItem<UserGeneralConfig> = {children: [diff --git a/src/features/Settings/creds/features/CredsList.tsx b/src/features/Settings/creds/features/CredsList.tsxindex 64a4a4a25d4..00cb108e464 100644--- a/src/features/Settings/creds/features/CredsList.tsx+++ b/src/features/Settings/creds/features/CredsList.tsx@@ -10,7 +10,7 @@ import { useTranslation } from 'react-i18next';import { useWorkspaces } from '@/business/client/hooks/useWorkspaces';import AsyncBoundary from '@/components/AsyncBoundary';-import ListSkeleton from '@/components/ListSkeleton';+import { CredsListSkeleton } from '@/components/Skeleton/Settings/tabs/Creds';import { usePermission } from '@/hooks/usePermission';import { useMarketAuth } from '@/layout/AuthProvider/MarketAuth';@@ -83,7 +83,7 @@ const CredsList: FC = () => {errorVariant={'block'}isEmpty={credentials.length === 0}isLoading={isLoading}- loading={<ListSkeleton paddingInline={0} />}+ loading={<CredsListSkeleton />}empty={<EmptyclassName={stylex.props(styles.empty).className}diff --git a/src/features/Settings/creds/features/MarketSignInGate.tsx b/src/features/Settings/creds/features/MarketSignInGate.tsxindex 85f4756b970..627dfa40a59 100644--- a/src/features/Settings/creds/features/MarketSignInGate.tsx+++ b/src/features/Settings/creds/features/MarketSignInGate.tsx@@ -6,7 +6,7 @@ import { LogIn } from 'lucide-react';import { type FC, type ReactNode } from 'react';import { useTranslation } from 'react-i18next';-import ListSkeleton from '@/components/ListSkeleton';+import { CredsListSkeleton } from '@/components/Skeleton/Settings/tabs/Creds';import { useMarketAuth } from '@/layout/AuthProvider/MarketAuth';const styles = stylex.create({@@ -28,7 +28,7 @@ const MarketSignInGate: FC<{ children: ReactNode }> = ({ children }) => {const { t } = useTranslation('setting');const { isAuthenticated, isLoading, signIn } = useMarketAuth();- if (isLoading) return <ListSkeleton paddingInline={0} />;+ if (isLoading) return <CredsListSkeleton />;if (!isAuthenticated) {return (diff --git a/src/features/Settings/creds/features/WorkspaceCredsList.tsx b/src/features/Settings/creds/features/WorkspaceCredsList.tsxindex c0ddd22617f..810a4e43e50 100644--- a/src/features/Settings/creds/features/WorkspaceCredsList.tsx+++ b/src/features/Settings/creds/features/WorkspaceCredsList.tsx@@ -7,7 +7,7 @@ import { type FC } from 'react';import { useTranslation } from 'react-i18next';import AsyncBoundary from '@/components/AsyncBoundary';-import ListSkeleton from '@/components/ListSkeleton';+import { CredsListSkeleton } from '@/components/Skeleton/Settings/tabs/Creds';import VisibilityConfirmContent from '@/features/VisibilityConfirmContent';import { usePermission } from '@/hooks/usePermission';import { useMarketAuth } from '@/layout/AuthProvider/MarketAuth';@@ -102,7 +102,7 @@ const WorkspaceCredsList: FC<WorkspaceCredsListProps> = ({ credsApi, visibilityerrorVariant={'block'}isEmpty={credentials.length === 0}isLoading={isLoading}- loading={<ListSkeleton paddingInline={0} />}+ loading={<CredsListSkeleton />}empty={<Emptydescription={t(visibility === 'private' ? 'creds.privateSection.empty' : 'creds.empty')}diff --git a/src/features/Settings/creds/index.tsx b/src/features/Settings/creds/index.tsxindex d7819406a27..fe82259568d 100644--- a/src/features/Settings/creds/index.tsx+++ b/src/features/Settings/creds/index.tsx@@ -1,14 +1,13 @@'use client';-import { Button, Flexbox, Icon, Text, Tooltip } from '@lobehub/ui';+import { Button, Flexbox, Icon, Tooltip } from '@lobehub/ui';import { Plus } from 'lucide-react';import { useState } from 'react';import { useTranslation } from 'react-i18next';-import NavHeader from '@/features/NavHeader';-import SettingContainer from '@/features/Setting/SettingContainer';import { usePermission } from '@/hooks/usePermission';+import SettingsPageActions from '../features/SettingsPageActions';import { createCreateCredModal } from './features/CreateCredModal';import CredsList from './features/CredsList';import { personalCredsApi } from './features/useCredsApi';@@ -35,7 +34,7 @@ const Page = ({ mobile }: PageProps) => {<Buttondisabled={!canManageCredentials}icon={<Icon icon={Plus} />}- size={mobile ? 'large' : 'small'}+ size={mobile ? 'large' : undefined}type={'primary'}onClick={handleCreate}>@@ -55,14 +54,11 @@ const Page = ({ mobile }: PageProps) => {);}+ // The shared settings header shows the title; the button joins its right slot.return (<>- <NavHeader right={createButton} styles={{ center: { alignItems: 'center' } }}>- <Text weight={500}>{t('tab.creds')}</Text>- </NavHeader>- <SettingContainer maxWidth={1024} paddingBlock={'24px 128px'} paddingInline={24}>- <CredsList key={refreshKey} />- </SettingContainer>+ <SettingsPageActions>{createButton}</SettingsPageActions>+ <CredsList key={refreshKey} /></>);};diff --git a/src/features/Settings/devices/index.tsx b/src/features/Settings/devices/index.tsxindex e0cbf8fdee4..edc697532d7 100644--- a/src/features/Settings/devices/index.tsx+++ b/src/features/Settings/devices/index.tsx@@ -1,14 +1,11 @@'use client';import { isDesktop } from '@lobechat/const';-import { Flexbox, Text } from '@lobehub/ui';+import { Flexbox } from '@lobehub/ui';import { memo, useState } from 'react';-import { useTranslation } from 'react-i18next';import { useNavigate, useParams } from 'react-router';import { DeviceConnectModal, DeviceDetailPage, DeviceManager } from '@/features/DeviceManager';-import NavHeader from '@/features/NavHeader';-import SettingContainer from '@/features/Setting/SettingContainer';import ThisComputer from './ThisComputer';@@ -16,8 +13,7 @@ interface PageProps {mobile?: boolean;}-const Page = memo<PageProps>(({ mobile }) => {- const { t } = useTranslation('setting');+const Page = memo<PageProps>(() => {const [open, setOpen] = useState(false);const [initialTab, setInitialTab] = useState<'cli' | 'desktop'>();// `/settings/devices/:sub` β the second level is one device's detail page.@@ -33,20 +29,12 @@ const Page = memo<PageProps>(({ mobile }) => {const openDevice = (id: string) => navigate(`/settings/devices/${encodeURIComponent(id)}`);const backToList = () => navigate('/settings/devices');- // Same toolbar + card grid as the workspace devices page; the personal- // pool has no visibility tabs, so its leading slot carries the page title.+ // Same toolbar + card grid as the workspace devices page. The personal pool+ // has no visibility tabs, and the shared settings header already shows the+ // page title, so the toolbar's leading slot stays empty.const list = (<Flexbox gap={24}>- <DeviceManager- scope={'personal'}- toolbarLeading={- <Text fontSize={16} weight={600}>- {t('devices.title')}- </Text>- }- onConnect={handleConnect}- onOpenDevice={openDevice}- />+ <DeviceManager scope={'personal'} onConnect={handleConnect} onOpenDevice={openDevice} />{isDesktop && <ThisComputer />}</Flexbox>);@@ -66,23 +54,11 @@ const Page = memo<PageProps>(({ mobile }) => {list);- if (mobile)- return (- <>- {content}- {connectModal}- </>- );-+ // Desktop renders inside the shared settings header + container, mobile under+ // the mobile layout header.return (<>- <NavHeader styles={{ center: { alignItems: 'center' } }}>- <Text weight={500}>{t('devices.title')}</Text>- </NavHeader>- {/* Full width: the card grid adds columns as the pane widens. */}- <SettingContainer maxWidth={'100%'} paddingBlock={'24px 128px'} paddingInline={24}>- {content}- </SettingContainer>+ {content}{connectModal}</>);diff --git a/src/features/Settings/environments/index.tsx b/src/features/Settings/environments/index.tsxindex 4072d5b85f5..e47ae8d41e2 100644--- a/src/features/Settings/environments/index.tsx+++ b/src/features/Settings/environments/index.tsx@@ -7,10 +7,9 @@ import { MAX_WIDTH } from '@/const/layoutTokens';import EnvironmentManager from '@/features/EnvironmentManager';/**- * Thin: the titled group, the list and the detail panel all live in the manager,- * the way the devices page composes its own. The group repeats the page's name- * on purpose, for the same reason "My Devices" appears twice there β the header- * bar scrolls away, the section heading does not.+ * Thin: the titled group, the list and the detail panel all live in the manager.+ * The group heading carries the list's Refresh and New actions, so it stays even+ * though the shared settings header already names the page.** No gate: an environment is a definition, and writing one down needs no* drive. Only initializing a folder from it does, and that is asked where itdiff --git a/src/features/Settings/features/SettingsContent.tsx b/src/features/Settings/features/SettingsContent.tsxindex 94123006364..72d45a2e538 100644--- a/src/features/Settings/features/SettingsContent.tsx+++ b/src/features/Settings/features/SettingsContent.tsx@@ -1,8 +1,7 @@'use client';import { Text } from '@lobehub/ui';-import { Fragment, useEffect } from 'react';-import { useTranslation } from 'react-i18next';+import { Fragment, useEffect, useState } from 'react';import NavHeader from '@/features/NavHeader';import SettingContainer from '@/features/Setting/SettingContainer';@@ -13,6 +12,9 @@ import { serverConfigSelectors, useServerConfigStore } from '@/store/serverConfiimport { ManageMemoryButton } from '../memory/features/ManageMemoryButton';import { componentMap } from './componentMap';+import { getSettingsContainerMaxWidth, OWN_FRAME_TABS } from './ownFrameTabs';+import { SettingsPageActionsContext, SettingsPageActionsRow } from './SettingsPageActions';+import { useSettingsTabTitle } from './tabTitles';const REDIRECT_MAP: Record<string, string> = {[SettingsTabs.Common]: SettingsTabs.Appearance,@@ -22,60 +24,16 @@ const REDIRECT_MAP: Record<string, string> = {[SettingsTabs.Image]: SettingsTabs.ServiceModel,};-const COMPACT_HEADER_TABS = [- SettingsTabs.About,- SettingsTabs.APIKey,- SettingsTabs.Appearance,- SettingsTabs.Billing,- SettingsTabs.Credits,- SettingsTabs.Hotkey,- SettingsTabs.Labels,- SettingsTabs.Labs,- SettingsTabs.Memory,- SettingsTabs.Messenger,- SettingsTabs.Notification,- SettingsTabs.Plans,- SettingsTabs.Profile,- SettingsTabs.Referral,- SettingsTabs.Environments,- SettingsTabs.ServiceModel,- SettingsTabs.Stats,- SettingsTabs.Storage,- SettingsTabs.Trash,-] as const;-interface SettingsContentProps {activeTab?: string;mobile?: boolean;}const SettingsContent = ({ mobile, activeTab }: SettingsContentProps) => {- const { t } = useTranslation(['auth', 'labs', 'setting', 'subscription']);const enableBusinessFeatures = useServerConfigStore(serverConfigSelectors.enableBusinessFeatures);const navigate = useWorkspaceAwareNavigate();-- const compactHeaderTitles: Partial<Record<SettingsTabs, string>> = {- [SettingsTabs.About]: t('setting:tab.about'),- [SettingsTabs.APIKey]: t('setting:tab.apikey'),- [SettingsTabs.Appearance]: t('setting:tab.appearance'),- [SettingsTabs.Billing]: t('subscription:tab.billing'),- [SettingsTabs.Credits]: t('subscription:tab.credits'),- [SettingsTabs.Hotkey]: t('setting:tab.hotkey'),- [SettingsTabs.Labels]: t('setting:tab.labels'),- // Labs has no `setting:tab.*` entry β the nav label comes from the labs namespace.- [SettingsTabs.Labs]: t('labs:title'),- [SettingsTabs.Memory]: t('setting:tab.memory'),- [SettingsTabs.Messenger]: t('setting:tab.messenger'),- [SettingsTabs.Notification]: t('setting:tab.notification'),- [SettingsTabs.Plans]: t('subscription:tab.plans'),- [SettingsTabs.Profile]: t('auth:profile.title'),- [SettingsTabs.Referral]: t('subscription:tab.referral'),- [SettingsTabs.Environments]: t('setting:tab.environments'),- [SettingsTabs.ServiceModel]: t('setting:tab.serviceModel'),- [SettingsTabs.Stats]: t('auth:tab.stats'),- [SettingsTabs.Storage]: t('setting:tab.storage'),- [SettingsTabs.Trash]: t('setting:tab.trash'),- };+ const title = useSettingsTabTitle(activeTab);+ const [pageActions, setPageActions] = useState<HTMLElement | null>(null);useSettingsAnchorScroll();@@ -92,10 +50,11 @@ const SettingsContent = ({ mobile, activeTab }: SettingsContentProps) => {const Component = componentMap[tab as keyof typeof componentMap] || componentMap.appearance;if (!Component) return null;- const componentProps: { mobile?: boolean; showSettingHeader?: boolean } = {};- if (COMPACT_HEADER_TABS.includes(tab as (typeof COMPACT_HEADER_TABS)[number])) {- componentProps.showSettingHeader = false;- }+ // The shared navigation header (desktop) or the mobile layout header shows+ // the tab title, so no tab draws a second, in-page title.+ const componentProps: { mobile?: boolean; showSettingHeader?: boolean } = {+ showSettingHeader: false,+ };if ([SettingsTabs.About,@@ -127,30 +86,26 @@ const SettingsContent = ({ mobile, activeTab }: SettingsContentProps) => {return (<>{Object.keys(componentMap).map((tabKey) => {- const isFullWidth =- tabKey === SettingsTabs.Devices ||- tabKey === SettingsTabs.Provider ||- tabKey === SettingsTabs.Skill ||- tabKey === SettingsTabs.Connector ||- tabKey === SettingsTabs.Creds ||- tabKey === SettingsTabs.Usage;if (activeTab !== tabKey) return null;const content = renderComponent(tabKey);- if (isFullWidth) return <Fragment key={tabKey}>{content}</Fragment>;- const compactHeaderTitle = compactHeaderTitles[tabKey as SettingsTabs];- const compactHeaderExtra =- tabKey === SettingsTabs.Memory ? <ManageMemoryButton /> : undefined;+ if (OWN_FRAME_TABS.has(tabKey)) return <Fragment key={tabKey}>{content}</Fragment>;+ const headerExtra = tabKey === SettingsTabs.Memory ? <ManageMemoryButton /> : undefined;return (<Fragment key={tabKey}>- <NavHeader- right={compactHeaderExtra}- styles={compactHeaderTitle ? { center: { alignItems: 'center' } } : undefined}- >- {compactHeaderTitle && <Text weight={500}>{compactHeaderTitle}</Text>}+ <NavHeader styles={{ center: { alignItems: 'center' } }}>+ {title && <Text weight={500}>{title}</Text>}</NavHeader>- <SettingContainer maxWidth={1024} paddingBlock={'24px 128px'} paddingInline={24}>- {content}- </SettingContainer>+ <SettingsPageActionsContext value={pageActions}>+ <SettingContainer+ maxWidth={getSettingsContainerMaxWidth(tabKey)}+ paddingBlock={'24px 128px'}+ paddingInline={24}+ >+ {/* Page actions sit in the content column so they align with the body. */}+ <SettingsPageActionsRow ref={setPageActions}>{headerExtra}</SettingsPageActionsRow>+ {content}+ </SettingContainer>+ </SettingsPageActionsContext></Fragment>);})}diff --git a/src/features/Settings/features/SettingsPageActions.tsx b/src/features/Settings/features/SettingsPageActions.tsxnew file mode 100644index 00000000000..16a3cd16452--- /dev/null+++ b/src/features/Settings/features/SettingsPageActions.tsx@@ -0,0 +1,58 @@+'use client';++import * as stylex from '@stylexjs/stylex';+import { createContext, type ReactNode, type Ref, use } from 'react';+import { createPortal } from 'react-dom';++/** The page-actions row at the top of the settings content column, owned by `SettingsContent`. */+export const SettingsPageActionsContext = createContext<HTMLElement | null>(null);++const styles = stylex.create({+ row: {+ display: { ':empty': 'none', 'default': 'flex' },+ alignItems: 'center',+ justifyContent: 'flex-end',+ gap: 8,+ // `SettingContainer` spaces its children 36px apart; pull the first section+ // up so the actions read as part of it (16px) rather than a section of their own.+ marginBlockEnd: -20,+ },+});++/**+ * The right-aligned row page actions render into. It sits inside the content+ * column rather than the navigation header, so actions line up with the page+ * body instead of the panel edge; it collapses while no page fills it.+ */+export const SettingsPageActionsRow = ({+ children,+ ref,+}: {+ children?: ReactNode;+ ref?: Ref<HTMLDivElement>;+}) => (+ <div ref={ref} {...stylex.props(styles.row)}>+ {children}+ </div>+);++/**+ * Renders page-level actions (e.g. "Create") into the page-actions row, so every+ * settings page keeps the shared navigation title while still owning its+ * actions. Outside the desktop settings frame (mobile, workspace settings) there+ * is no row and the children render nowhere; pass them through `fallback` to+ * keep them in the page body there.+ */+const SettingsPageActions = ({+ children,+ fallback = null,+}: {+ children: ReactNode;+ fallback?: ReactNode;+}) => {+ const node = use(SettingsPageActionsContext);+ if (!node) return fallback;+ return createPortal(children, node);+};++export default SettingsPageActions;diff --git a/src/features/Settings/features/componentMap.ts b/src/features/Settings/features/componentMap.tsindex 18038b0ce7a..06b274be2b4 100644--- a/src/features/Settings/features/componentMap.ts+++ b/src/features/Settings/features/componentMap.ts@@ -1,11 +1,10 @@import { createElement } from 'react';-import { SettingsBodySkeleton } from '@/components/Skeleton/Settings/Page';-import SettingsProfileSkeleton from '@/components/Skeleton/Settings/Profile';+import { SettingsChunkSkeleton } from '@/components/Skeleton/Settings/Page';import dynamic from '@/libs/next/dynamic';import { SettingsTabs } from '@/store/global/initialState';-const loading = (_debugId: string) => () => createElement(SettingsBodySkeleton);+const loading = (_debugId: string) => () => createElement(SettingsChunkSkeleton);export const componentMap = {[SettingsTabs.Advanced]: dynamic(() => import('../advanced'), {@@ -67,7 +66,7 @@ export const componentMap = {}),// Profile related tabs[SettingsTabs.Profile]: dynamic(() => import('../profile'), {- loading: () => createElement(SettingsProfileSkeleton),+ loading: loading('Settings > Profile'),}),[SettingsTabs.Stats]: dynamic(() => import('../stats'), {loading: loading('Settings > Stats'),diff --git a/src/features/Settings/features/ownFrameTabs.ts b/src/features/Settings/features/ownFrameTabs.tsnew file mode 100644index 00000000000..056b843e430--- /dev/null+++ b/src/features/Settings/features/ownFrameTabs.ts@@ -0,0 +1,19 @@+import { SettingsTabs } from '@/store/global/initialState';++/**+ * Tabs that draw their own navigation header and container: the split panes+ * (provider, skill) and the connector page that reuses the skill pane. Every+ * other tab renders under the one shared header that shows the tab title.+ * Their skeletons provide a `Page` for the same reason.+ */+export const OWN_FRAME_TABS = new Set<string>([+ SettingsTabs.Connector,+ SettingsTabs.Provider,+ SettingsTabs.Skill,+]);++/** In-frame tabs whose container spans the pane, e.g. a card grid that adds columns as it widens. */+export const FULL_WIDTH_TABS = new Set<string>([SettingsTabs.Devices]);++export const getSettingsContainerMaxWidth = (tab: string | undefined) =>+ tab && FULL_WIDTH_TABS.has(tab) ? '100%' : 1024;diff --git a/src/features/Settings/features/tabTitles.test.ts b/src/features/Settings/features/tabTitles.test.tsnew file mode 100644index 00000000000..93d34c3f9e2--- /dev/null+++ b/src/features/Settings/features/tabTitles.test.ts@@ -0,0 +1,20 @@+import { describe, expect, it } from 'vitest';++import auth from '@/locales/default/auth';+import labs from '@/locales/default/labs';+import setting from '@/locales/default/setting';+import subscription from '@/locales/default/subscription';++import { SETTINGS_TAB_TITLE_KEYS } from './tabTitles';++const NAMESPACES: Record<string, Record<string, unknown>> = { auth, labs, setting, subscription };++describe('SETTINGS_TAB_TITLE_KEYS', () => {+ // The route and chunk skeletons render these keys as the header title; a+ // missing key would show the raw key instead of the page's real title.+ it.each(Object.entries(SETTINGS_TAB_TITLE_KEYS))('%s title key exists', (_, entry) => {+ const [ns, key] = entry!;+ expect(NAMESPACES[ns], ns).toBeDefined();+ expect(typeof NAMESPACES[ns][key], `${ns}:${key}`).toBe('string');+ });+});diff --git a/src/features/Settings/features/tabTitles.ts b/src/features/Settings/features/tabTitles.tsnew file mode 100644index 00000000000..bd8a68db708--- /dev/null+++ b/src/features/Settings/features/tabTitles.ts@@ -0,0 +1,56 @@+import { useTranslation } from 'react-i18next';++import { SettingsTabs } from '@/store/global/initialState';++type TitleKey = readonly [namespace: string, key: string];++/**+ * The navigation-header title of each settings tab. It is static copy, so the+ * route and chunk skeletons render the same text the settled page shows instead+ * of a placeholder bar.+ */+export const SETTINGS_TAB_TITLE_KEYS: Partial<Record<SettingsTabs, TitleKey>> = {+ [SettingsTabs.About]: ['setting', 'tab.about'],+ [SettingsTabs.Advanced]: ['setting', 'tab.advanced'],+ [SettingsTabs.APIKey]: ['setting', 'tab.apikey'],+ [SettingsTabs.Appearance]: ['setting', 'tab.appearance'],+ [SettingsTabs.Billing]: ['subscription', 'tab.billing'],+ [SettingsTabs.Connector]: ['setting', 'tab.connector'],+ [SettingsTabs.Creds]: ['setting', 'tab.creds'],+ [SettingsTabs.Credits]: ['subscription', 'tab.credits'],+ [SettingsTabs.Devices]: ['setting', 'devices.title'],+ [SettingsTabs.Environments]: ['setting', 'tab.environments'],+ [SettingsTabs.Hotkey]: ['setting', 'tab.hotkey'],+ [SettingsTabs.Integrations]: ['setting', 'tab.integrations'],+ [SettingsTabs.Labels]: ['setting', 'tab.labels'],+ // Labs has no `setting:tab.*` entry β the nav label comes from the labs namespace.+ [SettingsTabs.Labs]: ['labs', 'title'],+ [SettingsTabs.Memory]: ['setting', 'tab.memory'],+ [SettingsTabs.Messenger]: ['setting', 'tab.messenger'],+ [SettingsTabs.Notification]: ['setting', 'tab.notification'],+ [SettingsTabs.OAuthApps]: ['auth', 'tab.oauthApps'],+ [SettingsTabs.Plans]: ['subscription', 'tab.plans'],+ [SettingsTabs.Profile]: ['auth', 'profile.title'],+ [SettingsTabs.Proxy]: ['setting', 'tab.proxy'],+ [SettingsTabs.Referral]: ['subscription', 'tab.referral'],+ [SettingsTabs.ServiceModel]: ['setting', 'tab.serviceModel'],+ [SettingsTabs.Stats]: ['auth', 'tab.stats'],+ [SettingsTabs.Storage]: ['setting', 'tab.storage'],+ [SettingsTabs.SystemTools]: ['setting', 'tab.systemTools'],+ [SettingsTabs.Tools]: ['setting', 'tab.tools'],+ [SettingsTabs.Trash]: ['setting', 'tab.trash'],+ [SettingsTabs.Usage]: ['setting', 'tab.usage'],+};++const TITLE_NAMESPACES = ['auth', 'labs', 'setting', 'subscription'] as const;++/** The header title of `tab`, or `undefined` until its namespace has loaded. */+export const useSettingsTabTitle = (tab: string | undefined): string | undefined => {+ const { t, ready } = useTranslation(TITLE_NAMESPACES);+ const entry = tab ? SETTINGS_TAB_TITLE_KEYS[tab as SettingsTabs] : undefined;+ if (!entry || !ready) return undefined;++ const [ns, key] = entry;+ // Keys come from the table above, so the typed overloads would only recurse.+ return (t as (key: string, options: { ns: string }) => string)(key, { ns });+};diff --git a/src/features/Settings/hotkey/features/AppMenu.tsx b/src/features/Settings/hotkey/features/AppMenu.tsxindex 26a2eadf043..5bfd65b3b37 100644--- a/src/features/Settings/hotkey/features/AppMenu.tsx+++ b/src/features/Settings/hotkey/features/AppMenu.tsx@@ -6,7 +6,7 @@ import { memo, useMemo } from 'react';import { useTranslation } from 'react-i18next';import useSWR from 'swr';-import { SettingsSectionSkeleton } from '@/components/Skeleton';+import { AppMenuHotkeysSkeleton } from '@/components/Skeleton/Settings/tabs/Hotkey';import { FORM_STYLE } from '@/const/layoutTokens';import { isDesktop } from '@/const/version';import { SettingsSearchAnchor } from '@/features/SettingsSearch/anchor';@@ -35,20 +35,7 @@ const AppMenuHotkeys = memo(() => {const hotkeys = useMemo(() => collectAppMenuHotkeys(data ?? []), [data]);- if (isLoading)- return (- <SettingsSectionSkeleton- groups={[- {- // Hotkey recorder inputs settle at 335x36.- control: { height: 36, width: 335 },- rows: 8,- titleWidth: 96,- withDesc: false,- },- ]}- />- );+ if (isLoading) return <AppMenuHotkeysSkeleton />;if (hotkeys.length === 0) return null;diff --git a/src/features/Settings/hotkey/features/Conversation.tsx b/src/features/Settings/hotkey/features/Conversation.tsxindex d2b9b638b2a..a4bff134558 100644--- a/src/features/Settings/hotkey/features/Conversation.tsx+++ b/src/features/Settings/hotkey/features/Conversation.tsx@@ -8,7 +8,7 @@ import { memo } from 'react';import { useTranslation } from 'react-i18next';import AutoSaveHint from '@/components/Editor/AutoSaveHint';-import { SettingsSectionSkeleton } from '@/components/Skeleton';+import { ConversationHotkeysSkeleton } from '@/components/Skeleton/Settings/tabs/Hotkey';import { HOTKEYS_REGISTRATION } from '@/const/hotkeys';import { FORM_STYLE } from '@/const/layoutTokens';import { SettingsSearchAnchor } from '@/features/SettingsSearch/anchor';@@ -29,21 +29,7 @@ const HotkeySetting = memo(() => {onValuesChange: (values) => save(() => setSettings({ hotkey: values })),});- if (!isUserStateInit)- return (- <SettingsSectionSkeleton- groups={[- {- // Hotkey recorder inputs settle at 335x36.- control: { height: 36, width: 335 },- rows: HOTKEYS_REGISTRATION.filter((item) => item.group === HotkeyGroupEnum.Conversation)- .length,- titleWidth: 96,- withDesc: false,- },- ]}- />- );+ if (!isUserStateInit) return <ConversationHotkeysSkeleton />;const clearHotkeyBinding = (id: HotkeyItem['id']) => {if (!hotkey[id]) return;diff --git a/src/features/Settings/hotkey/features/Desktop.tsx b/src/features/Settings/hotkey/features/Desktop.tsxindex 56fd6dfece2..ba0b8ca2c48 100644--- a/src/features/Settings/hotkey/features/Desktop.tsx+++ b/src/features/Settings/hotkey/features/Desktop.tsx@@ -6,7 +6,7 @@ import isEqual from 'fast-deep-equal';import { memo, useMemo, useState } from 'react';import { useTranslation } from 'react-i18next';-import { SettingsSectionSkeleton } from '@/components/Skeleton';+import { DesktopHotkeysSkeleton } from '@/components/Skeleton/Settings/tabs/Hotkey';import { DESKTOP_HOTKEYS_REGISTRATION } from '@/const/desktopGlobalShortcuts';import { FORM_STYLE } from '@/const/layoutTokens';import { SettingsSearchAnchor } from '@/features/SettingsSearch/anchor';@@ -43,20 +43,7 @@ const HotkeySetting = memo(() => {const [loading, setLoading] = useState(false);- if (!isHotkeysInit)- return (- <SettingsSectionSkeleton- groups={[- {- // Hotkey recorder inputs settle at 335x36.- control: { height: 36, width: 335 },- rows: DESKTOP_HOTKEYS_REGISTRATION.length,- titleWidth: 96,- withDesc: false,- },- ]}- />- );+ if (!isHotkeysInit) return <DesktopHotkeysSkeleton />;const updateHotkey = async (id: DesktopHotkeyItem['id'], value: string) => {setLoading(true);diff --git a/src/features/Settings/hotkey/features/Essential.tsx b/src/features/Settings/hotkey/features/Essential.tsxindex 2d44edd8644..2706c381201 100644--- a/src/features/Settings/hotkey/features/Essential.tsx+++ b/src/features/Settings/hotkey/features/Essential.tsx@@ -8,7 +8,7 @@ import { memo } from 'react';import { useTranslation } from 'react-i18next';import AutoSaveHint from '@/components/Editor/AutoSaveHint';-import { SettingsSectionSkeleton } from '@/components/Skeleton';+import { EssentialHotkeysSkeleton } from '@/components/Skeleton/Settings/tabs/Hotkey';import { HOTKEYS_REGISTRATION } from '@/const/hotkeys';import { FORM_STYLE } from '@/const/layoutTokens';import { SettingsSearchAnchor } from '@/features/SettingsSearch/anchor';@@ -29,21 +29,7 @@ const HotkeySetting = memo(() => {onValuesChange: (values) => save(() => setSettings({ hotkey: values })),});- if (!isUserStateInit)- return (- <SettingsSectionSkeleton- groups={[- {- // Hotkey recorder inputs settle at 335x36.- control: { height: 36, width: 335 },- rows: HOTKEYS_REGISTRATION.filter((item) => item.group === HotkeyGroupEnum.Essential)- .length,- titleWidth: 96,- withDesc: false,- },- ]}- />- );+ if (!isUserStateInit) return <EssentialHotkeysSkeleton />;const clearHotkeyBinding = (id: HotkeyItem['id']) => {if (!hotkey[id]) return;diff --git a/src/features/Settings/image/features/Image.tsx b/src/features/Settings/image/features/Image.tsxindex a0434c8aa65..1e51b673d32 100644--- a/src/features/Settings/image/features/Image.tsx+++ b/src/features/Settings/image/features/Image.tsx@@ -8,7 +8,7 @@ import { memo, useState } from 'react';import { useTranslation } from 'react-i18next';import { FormSliderWithInput } from '@/components/FormInput';-import { SettingsSectionSkeleton } from '@/components/Skeleton';+import { ImageSettingsSkeleton } from '@/components/Skeleton/Settings/tabs/ServiceModel';import { FORM_STYLE } from '@/const/layoutTokens';import { MAX_DEFAULT_IMAGE_NUM, MIN_DEFAULT_IMAGE_NUM } from '@/const/settings';import { SettingsSearchAnchor } from '@/features/SettingsSearch/anchor';@@ -39,8 +39,8 @@ const ImageSettings = memo(() => {});if (!isUserStateInit) {- // One filled group holding the default image count slider.- return <SettingsSectionSkeleton groups={[{ rows: 1, titleWidth: 136 }]} />;+ // Same group the service-model tab skeleton draws below the model cards.+ return <ImageSettingsSkeleton />;}const items: FormGroupItem<UserImageConfig>[] = [diff --git a/src/features/Settings/integrations/index.tsx b/src/features/Settings/integrations/index.tsxindex 59aee89d384..aa0386420a1 100644--- a/src/features/Settings/integrations/index.tsx+++ b/src/features/Settings/integrations/index.tsx@@ -1,3 +1,4 @@+import { Flexbox, Text } from '@lobehub/ui';import * as stylex from '@stylexjs/stylex';import { useTranslation } from 'react-i18next';import { useParams } from 'react-router';@@ -16,18 +17,32 @@ interface PageProps {const Page = ({ showSettingHeader = true }: PageProps) => {const { t } = useTranslation('integration');const params = useParams<{ sub?: string }>();- // The directory carries the page header; an integration page draws its own hero.- const showHeader = showSettingHeader && !params.sub;+ // The directory carries the page intro; an integration page draws its own hero.+ // Under the shared settings header only the description stays in the body.+ const showIntro = !params.sub;+ if (showSettingHeader)+ return (+ <>+ {showIntro && (+ <div {...stylex.props(styles.header)}>+ <SettingHeader description={t('overview.description')} title={t('overview.title')} />+ </div>+ )}+ <IntegrationsSettings />+ </>+ );++ // Intro line and directory read as one block, like the messenger list.return (- <>- {showHeader && (+ <Flexbox gap={20}>+ {showIntro && (<div {...stylex.props(styles.header)}>- <SettingHeader description={t('overview.description')} title={t('overview.title')} />+ <Text type={'secondary'}>{t('overview.description')}</Text></div>)}<IntegrationsSettings />- </>+ </Flexbox>);};diff --git a/src/features/Settings/labs/index.tsx b/src/features/Settings/labs/index.tsxindex 5434a2401cd..ac1fff786b9 100644--- a/src/features/Settings/labs/index.tsx+++ b/src/features/Settings/labs/index.tsx@@ -8,7 +8,7 @@ import { memo } from 'react';import { useTranslation } from 'react-i18next';import AsyncError from '@/components/AsyncError';-import { SettingsSectionSkeleton } from '@/components/Skeleton';+import { LabsFormSkeleton } from '@/components/Skeleton/Settings/tabs/Labs';import { FORM_STYLE } from '@/const/layoutTokens';import SettingHeader from '@/features/Settings/features/SettingHeader';import { SettingsSearchAnchor } from '@/features/SettingsSearch/anchor';@@ -70,17 +70,8 @@ const LabsForm = memo(() => {onRetry={() => refreshUserState()}/>);- // Same groups as the loaded form: General always, Workspace with workspace- // access, Desktop only in Electron.- return (- <SettingsSectionSkeleton- groups={[- { rows: generalItems.length, titleWidth: 72 },- ...(workspaceItems.length > 0 ? [{ rows: workspaceItems.length, titleWidth: 72 }] : []),- ...(isDesktop ? [{ rows: desktopItems.length, titleWidth: 72 }] : []),- ]}- />- );+ // Only the form waits for user state; the alert above it is already settled.+ return <LabsFormSkeleton />;}const checkedByFlag = Object.fromEntries(diff --git a/src/features/Settings/memory/features/Memory.tsx b/src/features/Settings/memory/features/Memory.tsxindex c0d07a1338c..ade13347ee4 100644--- a/src/features/Settings/memory/features/Memory.tsx+++ b/src/features/Settings/memory/features/Memory.tsx@@ -9,7 +9,7 @@ import { memo } from 'react';import { useTranslation } from 'react-i18next';import AutoSaveHint from '@/components/Editor/AutoSaveHint';-import { SettingsSectionSkeleton } from '@/components/Skeleton';+import MemorySkeleton from '@/components/Skeleton/Settings/tabs/Memory';import { FORM_STYLE } from '@/const/layoutTokens';import LevelSlider from '@/features/ModelSwitchPanel/components/ControlsForm/LevelSlider';import { usePermission } from '@/hooks/usePermission';@@ -37,14 +37,7 @@ const MemorySetting = memo(() => {},});- // One filled group: the enable switch and the effort slider (settles at ~180x44- // with its marks), which makes the second row taller than a plain input row.- if (!isUserStateInit)- return (- <SettingsSectionSkeleton- groups={[{ controls: { 1: { height: 44, width: 180 } }, rows: 2, titleWidth: 80 }]}- />- );+ if (!isUserStateInit) return <MemorySkeleton.Body />;const memorySettings: FormGroupItem<UserMemorySettings> = {children: [diff --git a/src/features/Settings/oauth-apps/features/AppDetail/index.tsx b/src/features/Settings/oauth-apps/features/AppDetail/index.tsxindex ed9bbb63517..2c968747bcc 100644--- a/src/features/Settings/oauth-apps/features/AppDetail/index.tsx+++ b/src/features/Settings/oauth-apps/features/AppDetail/index.tsx@@ -6,7 +6,6 @@ import {Button,confirmModal,Flexbox,- Skeleton,Tabs,Tag,Text,@@ -26,6 +25,7 @@ import { normalizeAsyncError } from '@/libs/swr/normalizeError';import { oauthAppSelectors, useOAuthAppStore } from '@/store/oauthApp';import { type UpdateOAuthAppParams } from '@/types/oauthApp';+import AppDetailSkeleton from '../AppDetailSkeleton';import { confirmDisableOAuthApp } from '../confirmDisable';import { showClientSecretModal } from '../SecretModal';import BasicInfoCard from './BasicInfoCard';@@ -36,15 +36,6 @@ import RedirectUrisCard from './RedirectUrisCard';import SectionCard from './SectionCard';const styles = stylex.create({- card: {- padding: '16px',- borderWidth: '1px',- borderStyle: 'solid',- borderColor: cssVar.colorBorderSecondary,- borderRadius: cssVar.borderRadiusLG,- backgroundColor: cssVar.colorBgContainer,- backgroundImage: 'none',- },dangerCard: {padding: '16px',borderWidth: '1px',@@ -76,15 +67,7 @@ const styles = stylex.create({meta: { fontSize: '12px', color: cssVar.colorTextTertiary },});-/** The app page while it loads; also shown while the Labs flag resolves on a direct visit. */-export const AppDetailSkeleton = () => (- <Flexbox gap={16}>- <Skeleton.Text rows={1} width={200} />- <div {...stylex.props(styles.card)}>- <Skeleton.Text rows={4} />- </div>- </Flexbox>-);+export { default as AppDetailSkeleton } from '../AppDetailSkeleton';const TAB_KEYS = ['overview', 'credentials', 'advanced'] as const;diff --git a/src/features/Settings/oauth-apps/features/AppDetailSkeleton.tsx b/src/features/Settings/oauth-apps/features/AppDetailSkeleton.tsxnew file mode 100644index 00000000000..f75bcd70999--- /dev/null+++ b/src/features/Settings/oauth-apps/features/AppDetailSkeleton.tsx@@ -0,0 +1,107 @@+'use client';++import { Flexbox, Tabs, 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';++const styles = stylex.create({+ // Same frame as `SectionCard`.+ card: {+ padding: '16px',+ borderWidth: '1px',+ borderStyle: 'solid',+ borderColor: cssVar.colorBorderSecondary,+ borderRadius: cssVar.borderRadiusLG,+ backgroundColor: cssVar.colorBgContainer,+ },+});++const Line = ({ bar, height, width }: { bar: number; height: number; width: number | string }) => (+ <Flexbox height={height} justify={'center'} style={{ minWidth: 0 }}>+ <SkeletonBar height={bar} width={width} />+ </Flexbox>+);++/** `SectionCard` chrome with its real (static) title. */+const Card = ({ children, title }: { children: ReactNode; title: ReactNode }) => (+ <Flexbox gap={16} {...stylex.props(styles.card)}>+ <Flexbox horizontal align={'center'} style={{ minHeight: 28 }}>+ <Text weight={500}>{title}</Text>+ </Flexbox>+ {children}+ </Flexbox>+);++/** A vertical form field: label line over a filled input of `height`. */+const Field = ({ height = 32, label }: { height?: number; label: ReactNode }) => (+ <Flexbox flex={1} gap={8} style={{ minWidth: 0 }}>+ <Text>{label}</Text>+ <SkeletonBar height={height} radius={cssVar.borderRadius} />+ </Flexbox>+);++/**+ * An OAuth app page while it loads (also while the Labs flag resolves on a+ * direct visit): back + name + meta header, the tab strip, and the Overview+ * tab's basic-info and integration cards. Tab, card and field labels are+ * static copy and render as text.+ */+const AppDetailSkeleton = () => {+ const { t } = useTranslation('auth');++ return (+ <Flexbox aria-busy data-testid={'oauth-app-detail-skeleton'} gap={20}>+ <Flexbox gap={4}>+ <Flexbox horizontal align={'center'} gap={8}>+ <SkeletonBar height={24} width={24} />+ <Line bar={20} height={30} width={160} />+ </Flexbox>+ <Flexbox style={{ paddingInlineStart: 36 }}>+ <Line bar={12} height={20} width={200} />+ </Flexbox>+ </Flexbox>++ <Tabs+ activeKey={'overview'}+ items={[+ { key: 'overview', label: t('oauthApp.detail.tabs.overview') },+ { key: 'credentials', label: t('oauthApp.detail.tabs.credentials') },+ { key: 'advanced', label: t('oauthApp.detail.tabs.advanced') },+ ]}+ />++ <Card title={t('oauthApp.detail.basicInfo')}>+ <Flexbox gap={16}>+ <Flexbox horizontal align={'flex-end'} gap={16}>+ <SkeletonBar height={64} radius={cssVar.borderRadiusLG} width={64} />+ <Field label={t('oauthApp.form.name.label')} />+ </Flexbox>+ <Field height={54} label={t('oauthApp.form.description.label')} />+ </Flexbox>+ </Card>++ <Card title={t('oauthApp.integration.title')}>+ <Flexbox gap={12}>+ <Flexbox horizontal align={'center'} gap={12} justify={'space-between'}>+ <Flexbox gap={2}>+ <Text fontSize={13} weight={500}>+ {t('oauthApp.integration.oneClick')}+ </Text>+ <Text style={{ fontSize: 12 }} type={'secondary'}>+ {t('oauthApp.integration.oneClickDesc')}+ </Text>+ </Flexbox>+ <SkeletonBar height={32} width={120} />+ </Flexbox>+ <SkeletonBar height={180} radius={cssVar.borderRadius} />+ </Flexbox>+ </Card>+ </Flexbox>+ );+};++export default AppDetailSkeleton;diff --git a/src/features/Settings/oauth-apps/features/CreateAppButton.tsx b/src/features/Settings/oauth-apps/features/CreateAppButton.tsxindex ab144b31a69..620148fcd0d 100644--- a/src/features/Settings/oauth-apps/features/CreateAppButton.tsx+++ b/src/features/Settings/oauth-apps/features/CreateAppButton.tsx@@ -11,7 +11,8 @@ import { useOAuthAppStore } from '@/store/oauthApp';import { createOAuthAppModal } from './CreateAppModal';import { showClientSecretModal } from './SecretModal';-const CreateAppButton = () => {+/** `small` sits in the settings navigation header, like the other header actions. */+const CreateAppButton = ({ size }: { size?: 'small' }) => {const { t } = useTranslation('auth');const { allowed: hasEditPermission, reason } = usePermission('create_content');const activeWorkspaceId = useActiveWorkspaceId();@@ -42,7 +43,7 @@ const CreateAppButton = () => {};return (- <Button disabled={!canEdit} title={reason} type={'primary'} onClick={handleCreate}>+ <Button disabled={!canEdit} size={size} title={reason} type={'primary'} onClick={handleCreate}>{t('oauthApp.list.actions.create')}</Button>);diff --git a/src/features/Settings/oauth-apps/index.tsx b/src/features/Settings/oauth-apps/index.tsxindex d9fd3bd3554..4d89eb3c774 100644--- a/src/features/Settings/oauth-apps/index.tsx+++ b/src/features/Settings/oauth-apps/index.tsx@@ -1,9 +1,11 @@+import { Flexbox } from '@lobehub/ui';import { useTranslation } from 'react-i18next';import { useParams } from 'react-router';import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceId';import NotFound from '@/components/404';import SettingHeader from '@/features/Settings/features/SettingHeader';+import SettingsPageActions from '@/features/Settings/features/SettingsPageActions';import { usePermission } from '@/hooks/usePermission';import { useUserStore } from '@/store/user';import { labPreferSelectors, preferenceSelectors } from '@/store/user/selectors';@@ -14,7 +16,7 @@ import CreateAppButton from './features/CreateAppButton';import OAuthApps from './features/OAuthApps';import { useOAuthAppList } from './features/useOAuthAppList';-const Page = () => {+const Page = ({ showSettingHeader = true }: { showSettingHeader?: boolean }) => {const { t } = useTranslation('auth');const { allowed: hasEditPermission } = usePermission('create_content');const activeWorkspaceId = useActiveWorkspaceId();@@ -36,18 +38,32 @@ const Page = () => {if (!isPreferenceInit)return (<>- <SettingHeader title={t('tab.oauthApps')} />+ {showSettingHeader && <SettingHeader title={t('tab.oauthApps')} />}{params.sub ? <AppDetailSkeleton /> : <AppListSkeleton />}</>);if (!enableOAuthApps) return <NotFound />;+ const canCreate = !params.sub && canEdit && !listEmpty;+return (<>- <SettingHeader- extra={!params.sub && canEdit && !listEmpty && <CreateAppButton />}- title={t('tab.oauthApps')}- />+ {showSettingHeader ? (+ <SettingHeader extra={canCreate && <CreateAppButton />} title={t('tab.oauthApps')} />+ ) : (+ canCreate && (+ <SettingsPageActions+ // Mobile has no shared header slot; keep Create reachable above the list.+ fallback={+ <Flexbox horizontal justify={'flex-end'}>+ <CreateAppButton />+ </Flexbox>+ }+ >+ <CreateAppButton />+ </SettingsPageActions>+ )+ )}<OAuthApps canEdit={canEdit} /></>);diff --git a/src/features/Settings/profile/index.tsx b/src/features/Settings/profile/index.tsxindex 16a2ec4e715..36db6a8f663 100644--- a/src/features/Settings/profile/index.tsx+++ b/src/features/Settings/profile/index.tsx@@ -6,7 +6,8 @@ import { Form } from '@lobehub/ui/form';import { useEffect } from 'react';import { useTranslation } from 'react-i18next';-import { SettingsProfileRowSkeleton } from '@/components/Skeleton/Settings/Profile';+import SkeletonBar from '@/components/Skeleton/Bar';+import ProfileSkeleton from '@/components/Skeleton/Settings/tabs/Profile';import SettingHeader from '@/features/Settings/features/SettingHeader';import { useServerConfigStore } from '@/store/serverConfig';import { serverConfigSelectors } from '@/store/serverConfig/selectors';@@ -63,20 +64,21 @@ const ProfileSetting = ({ showSettingHeader = true }: ProfileSettingProps) => {const { t } = useTranslation('auth');+ // Same account group the route and chunk fallbacks draw, so the tab never+ // swaps between two differently shaped skeletons.+ if (isLoading)+ return (+ <>+ {showSettingHeader && <SettingHeader title={t('profile.title')} />}+ <ProfileSkeleton.Body />+ </>+ );+return (<>{showSettingHeader && <SettingHeader title={t('profile.title')} />}<Form.Group collapsible={false} title={t('profile.account')} variant={'filled'}>- <Flexbox style={{ display: isLoading ? 'flex' : 'none' }}>- <SettingsProfileRowSkeleton />- <Divider style={{ margin: 0 }} />- <SettingsProfileRowSkeleton />- <Divider style={{ margin: 0 }} />- <SettingsProfileRowSkeleton />- <Divider style={{ margin: 0 }} />- <SettingsProfileRowSkeleton />- </Flexbox>- <Flexbox style={{ display: isLoading ? 'none' : 'flex' }}>+ <Flexbox><AvatarRow /><Divider style={{ margin: 0 }} />@@ -105,11 +107,17 @@ const ProfileSetting = ({ showSettingHeader = true }: ProfileSettingProps) => {</>)}- {isLogin && !isDesktop && isLoadedAuthProviders && (+ {/* The row is known up front; only its provider list waits on the+ slower auth-providers fetch, so the row does not pop in. */}+ {isLogin && !isDesktop && (<><Divider style={{ margin: 0 }} /><ProfileRow anchor={'profile-connected-accounts'} label={t('profile.sso.providers')}>- <SSOProvidersList />+ {isLoadedAuthProviders ? (+ <SSOProvidersList />+ ) : (+ <SkeletonBar height={22} width={120} />+ )}</ProfileRow></>)}diff --git a/src/features/Settings/proxy/features/ProxyForm.tsx b/src/features/Settings/proxy/features/ProxyForm.tsxindex 6a0790ddda1..fa6ab8d8c75 100644--- a/src/features/Settings/proxy/features/ProxyForm.tsx+++ b/src/features/Settings/proxy/features/ProxyForm.tsx@@ -6,7 +6,7 @@ import { Form, type FormGroupItem, useForm, useWatch } from '@lobehub/ui/form';import { useCallback, useEffect, useRef, useState } from 'react';import { useTranslation } from 'react-i18next';-import { SettingsSectionSkeleton } from '@/components/Skeleton';+import ProxySkeleton from '@/components/Skeleton/Settings/tabs/Proxy';import { FORM_STYLE } from '@/const/layoutTokens';import { SettingsSearchAnchor } from '@/features/SettingsSearch/anchor';import { desktopSettingsService } from '@/services/electron/settings';@@ -192,19 +192,8 @@ const ProxyForm = () => {}}, [proxySettings, testUrl, form, t]);- // Enable, basic settings (type/server/port), auth (credentials hidden until- // enabled) and connection test groups, as in the loaded form.- if (isLoading)- return (- <SettingsSectionSkeleton- groups={[- { rows: 1, titleWidth: 96 },- { rows: 3, titleWidth: 112 },- { rows: 1, titleWidth: 128 },- { rows: 1, titleWidth: 120 },- ]}- />- );+ // Same groups the route and chunk fallbacks draw.+ if (isLoading) return <ProxySkeleton.Body />;const enableProxyGroup: FormGroupItem<NetworkProxySettings> = {children: [diff --git a/src/features/Settings/proxy/index.tsx b/src/features/Settings/proxy/index.tsxindex dfc30000d84..cd38c8ea384 100644--- a/src/features/Settings/proxy/index.tsx+++ b/src/features/Settings/proxy/index.tsx@@ -4,11 +4,11 @@ import SettingHeader from '@/features/Settings/features/SettingHeader';import ProxyForm from './features/ProxyForm';-const Page = () => {+const Page = ({ showSettingHeader = true }: { showSettingHeader?: boolean }) => {const { t } = useTranslation('setting');return (<>- <SettingHeader title={t('tab.proxy')} />+ {showSettingHeader && <SettingHeader title={t('tab.proxy')} />}<ProxyForm /></>);diff --git a/src/features/Settings/skill/features/LeftPanel.tsx b/src/features/Settings/skill/features/LeftPanel.tsxindex 3990817b153..75171071807 100644--- a/src/features/Settings/skill/features/LeftPanel.tsx+++ b/src/features/Settings/skill/features/LeftPanel.tsx@@ -27,10 +27,10 @@ const styles = stylex.create({display: 'flex',flexShrink: 0,gap: '16px',- alignItems: 'flex-start',+ alignItems: 'center',justifyContent: 'space-between',paddingBlockStart: '24px',- paddingBlockEnd: '16px',+ paddingBlockEnd: '4px',paddingInline: '12px',},header: {@@ -90,13 +90,10 @@ const LeftPanel = memo<LeftPanelProps>(if (isConnectorPage)return (<SkillListVariantProvider value={'page'}>+ {/* The shared navigation header carries the title; the page actions+ share the intro row so they line up with the list below. */}<div {...stylex.props(styles.pageHeader)}>- <Flexbox gap={4}>- <Text as={'h1'} fontSize={20} style={{ margin: 0 }} weight={600}>- {t('skillView.connectors', 'Connectors')}- </Text>- <Text type={'secondary'}>{t('skillView.connectorsDesc')}</Text>- </Flexbox>+ <Text type={'secondary'}>{t('skillView.connectorsDesc')}</Text><Flexbox horizontal flex={'none'} gap={8}><Tooltip title={t('skillStore.title')}><Buttondiff --git a/src/features/Settings/skill/index.tsx b/src/features/Settings/skill/index.tsxindex 78ffc57d2ff..21df73edfa8 100644--- a/src/features/Settings/skill/index.tsx+++ b/src/features/Settings/skill/index.tsx@@ -1,6 +1,6 @@'use client';-import { ActionIcon, Button, Flexbox } from '@lobehub/ui';+import { ActionIcon, Button, Flexbox, Text } from '@lobehub/ui';import * as stylex from '@stylexjs/stylex';import isEqual from 'fast-deep-equal';import { ArrowLeft, ChevronLeft } from 'lucide-react';@@ -184,7 +184,9 @@ export const ToolSettings = memo<ToolSettingsProps>(({ viewMode }) => {if (stacked)return (<>- <NavHeader />+ <NavHeader styles={{ center: { alignItems: 'center' } }}>+ <Text weight={500}>{t('tab.connector', { ns: 'setting' })}</Text>+ </NavHeader><div {...stylex.props(styles.page)}><div {...stylex.props(styles.pageBody)}>{stackedSelected ? (diff --git a/src/features/Settings/storage/index.tsx b/src/features/Settings/storage/index.tsxindex b0a866feb0b..c1ca7fdcde5 100644--- a/src/features/Settings/storage/index.tsx+++ b/src/features/Settings/storage/index.tsx@@ -1,10 +1,9 @@'use client';import { Flexbox } from '@lobehub/ui';-import { Form } from '@lobehub/ui/form';import { useTranslation } from 'react-i18next';-import { ArticleSkeleton } from '@/components/Skeleton';+import StorageSkeleton from '@/components/Skeleton/Settings/tabs/Storage';import SettingHeader from '@/features/Settings/features/SettingHeader';import { useServerConfigStore } from '@/store/serverConfig';import { useUserStore } from '@/store/user';@@ -26,14 +25,15 @@ const Page = ({ showSettingHeader = true }: PageProps) => {return (<>{showSettingHeader && <SettingHeader title={t('tab.storage')} />}- <Flexbox style={{ display: isLoading ? 'flex' : 'none' }}>- <Form.Group collapsible={false} title={t('storage.actions.title')} variant="filled">- <ArticleSkeleton rows={4} />- </Form.Group>- </Flexbox>- <Flexbox style={{ display: isLoading ? 'none' : 'flex' }}>- <Advanced />- </Flexbox>+ {/* Same groups the route and chunk fallbacks draw. The wrapper keeps the+ actions form and account deletion out of the container's 36px gap. */}+ {isLoading ? (+ <StorageSkeleton.Body />+ ) : (+ <Flexbox>+ <Advanced />+ </Flexbox>+ )}</>);};diff --git a/src/features/Settings/system-tools/index.tsx b/src/features/Settings/system-tools/index.tsxindex 4dd1c82de97..a1244787787 100644--- a/src/features/Settings/system-tools/index.tsx+++ b/src/features/Settings/system-tools/index.tsx@@ -9,13 +9,13 @@ import CliTestSection from './features/CliTestSection';import ShellSection from './features/ShellSection';import ToolDetectorSection from './features/ToolDetectorSection';-const Page = () => {+const Page = ({ showSettingHeader = true }: { showSettingHeader?: boolean }) => {const { t } = useTranslation('setting');const isDevMode = useUserStore((s) => userGeneralSettingsSelectors.config(s).isDevMode);return (<>- <SettingHeader title={t('tab.systemTools')} />+ {showSettingHeader && <SettingHeader title={t('tab.systemTools')} />}<ShellSection /><ToolDetectorSection /><AppEnvironmentSection />diff --git a/src/features/Settings/tools/index.tsx b/src/features/Settings/tools/index.tsxindex fb157ebc3db..85783c260e6 100644--- a/src/features/Settings/tools/index.tsx+++ b/src/features/Settings/tools/index.tsx@@ -5,11 +5,11 @@ import { Navigate } from 'react-router';import ToolSetting from '@/features/ToolSetting';-const Page = () => {+const Page = ({ showSettingHeader }: { showSettingHeader?: boolean }) => {// Hidden entries can still be reached by URL; send those visits back.if (!ENABLE_TOOL_CHANNEL_SETTINGS) return <Navigate replace to="/settings" />;- return <ToolSetting />;+ return <ToolSetting showSettingHeader={showSettingHeader} />;};export default Page;diff --git a/src/features/ToolSetting/index.tsx b/src/features/ToolSetting/index.tsxindex f28a150dc66..6c06d7c401f 100644--- a/src/features/ToolSetting/index.tsx+++ b/src/features/ToolSetting/index.tsx@@ -6,7 +6,9 @@ import { useTranslation } from 'react-i18next';import AsyncBoundary from '@/components/AsyncBoundary';import AutoSaveHint from '@/components/Editor/AutoSaveHint';+import { ToolsChannelsSkeleton } from '@/components/Skeleton/Settings/tabs/Tools';import SettingHeader from '@/features/Settings/features/SettingHeader';+import SettingsPageActions from '@/features/Settings/features/SettingsPageActions';import { useSaveState } from '@/hooks/useSaveState';import { useClientDataSWR } from '@/libs/swr';import { searchService } from '@/services/search';@@ -16,7 +18,7 @@ import ChannelSection from './ChannelSection';const FETCH_AVAILABLE_CHANNELS_KEY = 'FETCH_AVAILABLE_WEB_BROWSING_CHANNELS';-const ToolSetting = memo(() => {+const ToolSetting = memo<{ showSettingHeader?: boolean }>(({ showSettingHeader = true }) => {const { t } = useTranslation('setting');const { status: saveStatus, lastSavedAt, save, retry } = useSaveState();@@ -37,18 +39,31 @@ const ToolSetting = memo(() => {s.refreshUserState,]);+ const saveHint = (+ <AutoSaveHint lastUpdatedTime={lastSavedAt} saveStatus={saveStatus} onRetry={retry} />+ );+return (<>- <SettingHeader- title={t('tab.tools')}- extra={- <AutoSaveHint lastUpdatedTime={lastSavedAt} saveStatus={saveStatus} onRetry={retry} />- }- />+ {showSettingHeader ? (+ <SettingHeader extra={saveHint} title={t('tab.tools')} />+ ) : (+ <SettingsPageActions+ // Mobile has no shared header slot; keep the save status visible above the form.+ fallback={+ <Flexbox horizontal justify={'flex-end'}>+ {saveHint}+ </Flexbox>+ }+ >+ {saveHint}+ </SettingsPageActions>+ )}<AsyncBoundarydata={isUserStateInit ? data : undefined}error={error ?? (isUserStateInit ? undefined : isUserStateInitError)}isLoading={isLoading || !isUserStateInit}+ loading={<ToolsChannelsSkeleton />}onRetry={() => {void mutate();void refreshUserState();diff --git a/src/features/WorkspaceSetting/Labels/constants.ts b/src/features/WorkspaceSetting/Labels/constants.tsindex 17bacef7096..64b75fc28db 100644--- a/src/features/WorkspaceSetting/Labels/constants.ts+++ b/src/features/WorkspaceSetting/Labels/constants.ts@@ -25,3 +25,6 @@ export const DEFAULT_LABEL_COLOR = LABEL_COLOR_PRESETS[0];*/export const isValidLabelColor = (value: string): boolean =>/^#(?:[0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(value);++/** Column widths shared by the label rows, their header and the loading skeleton. */+export const LABEL_COLUMN_WIDTHS = { action: 32, created: 96, name: 200, usage: 88 } as const;diff --git a/src/features/WorkspaceSetting/Labels/index.tsx b/src/features/WorkspaceSetting/Labels/index.tsxindex 93627b0b179..870bb1e794c 100644--- a/src/features/WorkspaceSetting/Labels/index.tsx+++ b/src/features/WorkspaceSetting/Labels/index.tsx@@ -32,12 +32,13 @@ import { memo, useMemo, useState } from 'react';import { useTranslation } from 'react-i18next';import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceId';-import SkeletonList from '@/features/NavPanel/components/SkeletonList';+import { LabelsListSkeleton } from '@/components/Skeleton/Settings/tabs/Labels';import { useFetchAgentLabels } from '@/hooks/useFetchAgentLabels';import { usePermission } from '@/hooks/usePermission';import { useHomeStore } from '@/store/home';import { agentLabelSelectors } from '@/store/home/selectors';+import { LABEL_COLUMN_WIDTHS } from './constants';import { openDeleteLabelModal } from './DeleteLabelModal';import { isDuplicateLabelNameError } from './errors';import { openLabelFormModal } from './LabelFormModal';@@ -71,10 +72,12 @@ interface LabelRowProps {}/** Shared column widths so the header and rows stay aligned. */-const NAME_COL_WIDTH = 200;-const USAGE_COL_WIDTH = 88;-const CREATED_COL_WIDTH = 96;-const ACTION_COL_WIDTH = 32;+const {+ action: ACTION_COL_WIDTH,+ created: CREATED_COL_WIDTH,+ name: NAME_COL_WIDTH,+ usage: USAGE_COL_WIDTH,+} = LABEL_COLUMN_WIDTHS;const LabelRow = memo<LabelRowProps>(({ canManage, label, manageBlockedReason, onDelete, onEdit, onRestoreConflict }) => {@@ -336,7 +339,7 @@ const WorkspaceLabelsContent = memo(() => {)}</Flexbox>{!isInit && isLoading ? (- <SkeletonList rows={4} />+ <LabelsListSkeleton />) : error && !isInit ? (// A failed load must not read as "you have no labels" β the two look// identical here and lead the user to create duplicates of labels thatdiff --git a/src/spa/router/desktopRouter.shared.tsx b/src/spa/router/desktopRouter.shared.tsxindex 211556ee8c1..43081efdc50 100644--- a/src/spa/router/desktopRouter.shared.tsx+++ b/src/spa/router/desktopRouter.shared.tsx@@ -683,18 +683,15 @@ const createMainAreaChildrenDefinition = (options: MainAreaRouteOptions = {}): R},// Sandbox storage moved to Docs (`/resource/sandbox-storage`).{ element: <LegacySandboxStorageRedirect />, path: 'drive' },- // Devices list and detail get their own page-shaped skeletons; the generic- // `:tab` routes below would load them under the form-shaped settings one.+ // Devices list and detail are explicit routes so the page title resolves+ // without a `:tab` param; their skeleton comes from the devices tab entry.{element: dynamicElement(() => import('@/routes/(main)/settings'),'Desktop > Settings > Devices',),handle: {- meta: createSettingsRouteMeta({- Skeleton: createSurfaceSkeleton('grid'),- tab: SettingsTabs.Devices,- }),+ meta: createSettingsRouteMeta({ tab: SettingsTabs.Devices }),settingsTab: SettingsTabs.Devices,},path: 'devices',@@ -705,10 +702,7 @@ const createMainAreaChildrenDefinition = (options: MainAreaRouteOptions = {}): R'Desktop > Settings > Devices > Detail',),handle: {- meta: createSettingsRouteMeta({- Skeleton: createSurfaceSkeleton('detail'),- tab: SettingsTabs.Devices,- }),+ meta: createSettingsRouteMeta({ tab: SettingsTabs.Devices }),settingsTab: SettingsTabs.Devices,},path: 'devices/:sub',diff --git a/src/spa/router/desktopRouter.sync.test.tsx b/src/spa/router/desktopRouter.sync.test.tsxindex e21d24f62f4..2ea705c05a8 100644--- a/src/spa/router/desktopRouter.sync.test.tsx+++ b/src/spa/router/desktopRouter.sync.test.tsx@@ -23,6 +23,7 @@ import SettingsPageSkeleton from '@/components/Skeleton/Settings/Page';import ProviderSettingsSkeleton, {ProviderDetailSkeleton,} from '@/components/Skeleton/Settings/Provider';+import { getSettingsTabSkeleton } from '@/components/Skeleton/Settings/tabs';import { createSurfaceSkeleton } from '@/components/Skeleton/Surface';import TasksSkeleton from '@/components/Skeleton/Tasks';import TopicsSkeleton from '@/components/Skeleton/Topics';@@ -293,7 +294,7 @@ describe('desktop router shared definition', () => {);it.each(mainAreaVariants)(- '%s personal devices list and detail use their own skeletons, not the settings form',+ '%s personal devices list and detail resolve the devices tab skeleton',(_, factory) => {for (const [url, leaf] of [['/settings/devices', 'devices'],@@ -307,9 +308,11 @@ describe('desktop router shared definition', () => {expect(matches?.at(-1)?.route.path).toBe(leaf);expect(handle.settingsTab).toBe('devices');- expect(handle.meta?.Skeleton).toBeDefined();- expect(handle.meta?.Skeleton).not.toBe(SettingsPageSkeleton);+ // The settings page skeleton picks the devices entry by pathname, so the+ // explicit routes render the card grid, not the generic settings form.+ expect(handle.meta?.Skeleton).toBe(SettingsPageSkeleton);}+ expect(getSettingsTabSkeleton('devices')).toBeDefined();},);