@lobehub/chat 0.82.8 → 0.83.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/locales/en_US/error.json +2 -1
  3. package/locales/en_US/plugin.json +1 -0
  4. package/locales/en_US/setting.json +2 -1
  5. package/locales/ru_RU/error.json +2 -1
  6. package/locales/ru_RU/plugin.json +1 -0
  7. package/locales/ru_RU/setting.json +2 -1
  8. package/locales/zh_CN/error.json +1 -0
  9. package/locales/zh_CN/plugin.json +2 -1
  10. package/locales/zh_CN/setting.json +2 -1
  11. package/locales/zh_TW/error.json +2 -1
  12. package/locales/zh_TW/plugin.json +1 -0
  13. package/locales/zh_TW/setting.json +2 -1
  14. package/package.json +6 -5
  15. package/src/app/chat/{features/Header → (desktop)/features/ChatHeader}/Desktop.tsx +2 -2
  16. package/src/app/chat/{features/Header → (desktop)/features/ChatHeader}/index.tsx +1 -1
  17. package/src/app/chat/(desktop)/features/ChatInput/index.tsx +22 -0
  18. package/src/app/chat/{features/SessionList/Header → (desktop)/features/SessionHeader}/Desktop.tsx +1 -1
  19. package/src/app/chat/{features/SessionList/Header → (desktop)/features/SessionHeader}/index.tsx +1 -1
  20. package/src/app/chat/{features → (desktop)/features}/SessionList/Desktop.tsx +1 -1
  21. package/src/app/chat/(desktop)/features/SessionList/index.tsx +20 -0
  22. package/src/app/chat/{features/Sidebar → (desktop)/features/SideBar}/Desktop.tsx +4 -4
  23. package/src/app/chat/(desktop)/features/SideBar/index.tsx +20 -0
  24. package/src/app/chat/(desktop)/index.tsx +24 -0
  25. package/src/app/chat/{layout.desktop.tsx → (desktop)/layout/Desktop.tsx} +4 -4
  26. package/src/app/chat/(desktop)/layout/index.tsx +25 -0
  27. package/src/app/chat/(mobile)/features/ChatHeader.tsx +1 -0
  28. package/src/app/chat/(mobile)/features/ChatInput.tsx +14 -0
  29. package/src/app/chat/(mobile)/features/SessionList.tsx +12 -0
  30. package/src/app/chat/(mobile)/features/Topics.tsx +12 -0
  31. package/src/app/chat/(mobile)/index.tsx +20 -0
  32. package/src/app/chat/(mobile)/layout.tsx +15 -0
  33. package/src/app/chat/(mobile)/mobile/page.tsx +21 -0
  34. package/src/app/chat/{features/Header → components/ChatHeader}/Mobile.tsx +2 -1
  35. package/src/app/chat/{features/Header → components/ChatHeader}/ShareButton/Preview.tsx +3 -3
  36. package/src/app/chat/{features/Conversation/Input → components/ChatInput}/index.tsx +23 -21
  37. package/src/app/chat/components/Inspector/index.tsx +17 -0
  38. package/src/app/chat/{features → components}/SessionList/List/Item/index.tsx +2 -2
  39. package/src/app/chat/{features → components}/SessionList/Mobile.tsx +1 -1
  40. package/src/app/chat/{features → components}/SessionList/index.tsx +3 -10
  41. package/src/app/chat/features/Conversation/index.tsx +8 -4
  42. package/src/app/chat/features/PageTitle.tsx +19 -0
  43. package/src/app/chat/layout.tsx +14 -0
  44. package/src/app/chat/page.tsx +9 -4
  45. package/src/app/chat/settings/(desktop)/Header/index.tsx +13 -0
  46. package/src/app/chat/settings/{layout.desktop.tsx → (desktop)/layout.desktop.tsx} +5 -4
  47. package/src/app/chat/settings/(mobile)/Header.tsx +12 -0
  48. package/src/app/chat/settings/{layout.mobile.tsx → (mobile)/layout.mobile.tsx} +3 -1
  49. package/src/app/chat/settings/{features → components}/Header/index.tsx +4 -13
  50. package/src/app/chat/settings/layout.tsx +14 -0
  51. package/src/app/chat/settings/page.tsx +36 -5
  52. package/src/app/home/index.tsx +15 -11
  53. package/src/app/layout.tsx +4 -1
  54. package/src/app/metadata.ts +4 -1
  55. package/src/app/settings/agent/Agent.tsx +3 -3
  56. package/src/app/settings/agent/index.tsx +1 -0
  57. package/src/app/settings/common/Common.tsx +109 -117
  58. package/src/app/settings/features/SideBar/List.tsx +11 -5
  59. package/src/app/settings/llm/LLM/index.tsx +2 -2
  60. package/src/app/welcome/page.tsx +2 -6
  61. package/src/components/PageTitle.tsx +11 -0
  62. package/src/config/client.ts +13 -0
  63. package/src/const/locale.ts +9 -0
  64. package/src/const/settings.ts +1 -1
  65. package/src/const/url.ts +1 -6
  66. package/src/helpers/export.ts +2 -2
  67. package/src/layout/AppMobileLayout.tsx +15 -24
  68. package/src/layout/GlobalLayout/Locale.tsx +44 -0
  69. package/src/layout/GlobalLayout/LocaleLoading.tsx +21 -0
  70. package/src/layout/GlobalLayout/StoreHydration.tsx +28 -0
  71. package/src/layout/GlobalLayout/index.tsx +29 -41
  72. package/src/locales/create.ts +43 -26
  73. package/src/locales/default/setting.ts +2 -1
  74. package/src/locales/options.ts +6 -5
  75. package/src/services/agentMarket.ts +6 -4
  76. package/src/services/pluginMarket.ts +2 -2
  77. package/src/store/global/hooks/useSwitchSettingsOnInit.ts +5 -2
  78. package/src/store/global/{selectors.test.ts → selectors/settings.test.ts} +11 -11
  79. package/src/store/global/selectors/settings.ts +44 -0
  80. package/src/store/global/selectors.ts +1 -36
  81. package/src/store/global/slices/common.ts +3 -4
  82. package/src/types/locale.ts +4 -0
  83. package/src/types/settings.ts +2 -2
  84. package/src/utils/env.ts +2 -0
  85. package/src/utils/responsive.ts +1 -0
  86. package/src/utils/switchLang.ts +5 -1
  87. package/src/app/chat/features/Sidebar/index.tsx +0 -29
  88. package/src/app/chat/index.tsx +0 -54
  89. package/src/app/chat/layout.mobile.tsx +0 -20
  90. package/src/app/chat/mobile/index.tsx +0 -38
  91. package/src/app/chat/mobile/page.tsx +0 -7
  92. package/src/app/chat/settings/index.tsx +0 -51
  93. package/src/layout/GlobalLayout/style.ts +0 -18
  94. /package/src/app/chat/{features/Conversation/Input → (desktop)/features/ChatInput}/Desktop.tsx +0 -0
  95. /package/src/app/chat/{features/SessionList/Header/Mobile.tsx → (mobile)/features/SessionHeader.tsx} +0 -0
  96. /package/src/app/chat/{features/Header → components/ChatHeader}/PluginTag/PluginStatus.tsx +0 -0
  97. /package/src/app/chat/{features/Header → components/ChatHeader}/PluginTag/index.tsx +0 -0
  98. /package/src/app/chat/{features/Header → components/ChatHeader}/ShareButton/Inner.tsx +0 -0
  99. /package/src/app/chat/{features/Header → components/ChatHeader}/ShareButton/index.tsx +0 -0
  100. /package/src/app/chat/{features/Header → components/ChatHeader}/ShareButton/style.ts +0 -0
  101. /package/src/app/chat/{features/Conversation/Input → components/ChatInput}/ActionBar/ActionLeft.tsx +0 -0
  102. /package/src/app/chat/{features/Conversation/Input → components/ChatInput}/ActionBar/ActionRight.tsx +0 -0
  103. /package/src/app/chat/{features/Conversation/Input → components/ChatInput}/ActionBar/Token.tsx +0 -0
  104. /package/src/app/chat/{features/Conversation/Input → components/ChatInput}/Footer/SaveTopic.tsx +0 -0
  105. /package/src/app/chat/{features/Conversation/Input → components/ChatInput}/Footer/index.tsx +0 -0
  106. /package/src/app/chat/{features/Conversation/Input → components/ChatInput}/Mobile.tsx +0 -0
  107. /package/src/app/chat/{features/Sidebar → components/Inspector}/Mobile.tsx +0 -0
  108. /package/src/app/chat/{features/Sidebar → components/Inspector}/SystemRole/Header.tsx +0 -0
  109. /package/src/app/chat/{features/Sidebar → components/Inspector}/SystemRole/index.tsx +0 -0
  110. /package/src/app/chat/{features/Sidebar → components/Inspector}/SystemRole/style.ts +0 -0
  111. /package/src/app/chat/{features/Sidebar → components/Inspector}/Topic/DefaultContent.tsx +0 -0
  112. /package/src/app/chat/{features/Sidebar → components/Inspector}/Topic/SkeletonList.tsx +0 -0
  113. /package/src/app/chat/{features/Sidebar → components/Inspector}/Topic/TopicContent.tsx +0 -0
  114. /package/src/app/chat/{features/Sidebar → components/Inspector}/Topic/TopicItem.tsx +0 -0
  115. /package/src/app/chat/{features/Sidebar → components/Inspector}/Topic/index.tsx +0 -0
  116. /package/src/app/chat/{features/Sidebar → components/Inspector}/TopicSearchBar/index.tsx +0 -0
  117. /package/src/app/chat/{features → components}/SessionList/CollapseGroup/index.tsx +0 -0
  118. /package/src/app/chat/{features → components}/SessionList/Inbox/index.tsx +0 -0
  119. /package/src/app/chat/{features → components}/SessionList/List/AddButton.tsx +0 -0
  120. /package/src/app/chat/{features → components}/SessionList/List/Item/Actions.tsx +0 -0
  121. /package/src/app/chat/{features → components}/SessionList/List/SkeletonList.tsx +0 -0
  122. /package/src/app/chat/{features → components}/SessionList/List/index.tsx +0 -0
  123. /package/src/app/chat/settings/{features → (desktop)}/Header/Desktop.tsx +0 -0
  124. /package/src/app/chat/settings/{features → components}/Header/Mobile.tsx +0 -0
  125. /package/src/{components/AppTheme/index.tsx → layout/GlobalLayout/AppTheme.tsx} +0 -0
@@ -0,0 +1,17 @@
1
+ import { Flexbox } from 'react-layout-kit';
2
+
3
+ import { Topic } from './Topic';
4
+ import TopicSearchBar from './TopicSearchBar';
5
+
6
+ export const InspectorContent = () => {
7
+ return (
8
+ <Flexbox height={'100%'} style={{ overflow: 'hidden' }}>
9
+ <Flexbox padding={16}>
10
+ <TopicSearchBar />
11
+ </Flexbox>
12
+ <Flexbox gap={16} paddingInline={16} style={{ overflowY: 'auto', position: 'relative' }}>
13
+ <Topic />
14
+ </Flexbox>
15
+ </Flexbox>
16
+ );
17
+ };
@@ -6,7 +6,7 @@ import { memo, useMemo, useRef, useState } from 'react';
6
6
  import { Flexbox } from 'react-layout-kit';
7
7
  import { shallow } from 'zustand/shallow';
8
8
 
9
- import { globalSelectors, useGlobalStore } from '@/store/global';
9
+ import { settingsSelectors, useGlobalStore } from '@/store/global';
10
10
  import { useSessionStore } from '@/store/session';
11
11
  import { agentSelectors, sessionSelectors } from '@/store/session/selectors';
12
12
 
@@ -36,7 +36,7 @@ const SessionItem = memo<SessionItemProps>(({ id }) => {
36
36
  const isHovering = useHover(ref);
37
37
  const { mobile } = useResponsive();
38
38
  const { styles } = useStyles();
39
- const [defaultModel] = useGlobalStore((s) => [globalSelectors.defaultAgentConfig(s).model]);
39
+ const [defaultModel] = useGlobalStore((s) => [settingsSelectors.defaultAgentConfig(s).model]);
40
40
 
41
41
  const [
42
42
  active,
@@ -1,6 +1,6 @@
1
1
  import { ReactNode, memo } from 'react';
2
2
 
3
- import SessionSearchBar from '../SessionSearchBar';
3
+ import SessionSearchBar from '../../features/SessionSearchBar';
4
4
 
5
5
  const Sessions = memo<{ children: ReactNode }>(({ children }) => {
6
6
  return (
@@ -1,20 +1,13 @@
1
1
  import { CollapseProps } from 'antd';
2
- import { useResponsive } from 'antd-style';
3
2
  import { memo, useMemo } from 'react';
4
3
  import { useTranslation } from 'react-i18next';
5
4
 
6
5
  import CollapseGroup from './CollapseGroup';
7
- import Desktop from './Desktop';
8
6
  import Inbox from './Inbox';
9
7
  import SessionList from './List';
10
- import Mobile from './Mobile';
11
8
 
12
- export const Sessions = memo(() => {
13
- const { mobile } = useResponsive();
9
+ export const SessionListContent = memo(() => {
14
10
  const { t } = useTranslation('common');
15
-
16
- const Render = mobile ? Mobile : Desktop;
17
-
18
11
  const items: CollapseProps['items'] = useMemo(
19
12
  () => [
20
13
  {
@@ -27,9 +20,9 @@ export const Sessions = memo(() => {
27
20
  );
28
21
 
29
22
  return (
30
- <Render>
23
+ <>
31
24
  <Inbox />
32
25
  <CollapseGroup defaultActiveKey={['sessionList']} items={items} />
33
- </Render>
26
+ </>
34
27
  );
35
28
  });
@@ -1,6 +1,6 @@
1
1
  import { BackBottom } from '@lobehub/ui';
2
2
  import { createStyles } from 'antd-style';
3
- import { memo, useRef } from 'react';
3
+ import { ReactNode, memo, useRef } from 'react';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { Flexbox } from 'react-layout-kit';
6
6
 
@@ -8,7 +8,6 @@ import SafeSpacing from '@/components/SafeSpacing';
8
8
  import { usePluginStore } from '@/store/plugin';
9
9
 
10
10
  import ChatList from './ChatList';
11
- import ChatInput from './Input';
12
11
  import ChatScrollAnchor from './ScrollAnchor';
13
12
 
14
13
  const useStyles = createStyles(
@@ -23,7 +22,12 @@ const useStyles = createStyles(
23
22
  `,
24
23
  );
25
24
 
26
- const Conversation = memo<{ mobile?: boolean }>(({ mobile }) => {
25
+ interface ConversationProps {
26
+ chatInput: ReactNode;
27
+ mobile?: boolean;
28
+ }
29
+
30
+ const Conversation = memo<ConversationProps>(({ mobile, chatInput }) => {
27
31
  const ref = useRef(null);
28
32
  const { t } = useTranslation('common');
29
33
  const { styles } = useStyles();
@@ -41,7 +45,7 @@ const Conversation = memo<{ mobile?: boolean }>(({ mobile }) => {
41
45
  </div>
42
46
  <BackBottom target={ref} text={t('backToBottom')} />
43
47
  </div>
44
- <ChatInput />
48
+ {chatInput}
45
49
  </Flexbox>
46
50
  );
47
51
  });
@@ -0,0 +1,19 @@
1
+ 'use client';
2
+
3
+ import { memo } from 'react';
4
+
5
+ import PageTitle from '@/components/PageTitle';
6
+ import { useSessionStore } from '@/store/session';
7
+ import { agentSelectors } from '@/store/session/selectors';
8
+ import { genSiteHeadTitle } from '@/utils/genSiteHeadTitle';
9
+
10
+ const Title = memo(() => {
11
+ const [avatar, title] = useSessionStore((s) => [
12
+ agentSelectors.currentAgentAvatar(s),
13
+ agentSelectors.currentAgentTitle(s),
14
+ ]);
15
+ const pageTitle = genSiteHeadTitle([avatar, title].filter(Boolean).join(' '));
16
+
17
+ return <PageTitle title={pageTitle} />;
18
+ });
19
+ export default Title;
@@ -0,0 +1,14 @@
1
+ import { PropsWithChildren } from 'react';
2
+
3
+ import { isMobileDevice } from '@/utils/responsive';
4
+
5
+ import Desktop from './(desktop)/layout';
6
+ import Mobile from './(mobile)/layout';
7
+
8
+ const Layout = ({ children }: PropsWithChildren) => {
9
+ const mobile = isMobileDevice();
10
+
11
+ return mobile ? <Mobile>{children}</Mobile> : <Desktop>{children}</Desktop>;
12
+ };
13
+
14
+ export default Layout;
@@ -1,7 +1,12 @@
1
- import Page from './index';
1
+ import { isMobileDevice } from '@/utils/responsive';
2
2
 
3
- const Index = () => {
4
- return <Page />;
3
+ import DesktopPage from './(desktop)';
4
+ import MobilePage from './(mobile)';
5
+
6
+ const Page = () => {
7
+ const mobile = isMobileDevice();
8
+
9
+ return mobile ? <MobilePage /> : <DesktopPage />;
5
10
  };
6
11
 
7
- export default Index;
12
+ export default Page;
@@ -0,0 +1,13 @@
1
+ import { memo } from 'react';
2
+
3
+ import { HeaderContent } from '@/app/chat/settings/components/Header';
4
+
5
+ import Layout from './Desktop';
6
+
7
+ const Header = memo(() => (
8
+ <Layout>
9
+ <HeaderContent />
10
+ </Layout>
11
+ ));
12
+
13
+ export default Header;
@@ -1,21 +1,22 @@
1
+ 'use client';
2
+
1
3
  import { PropsWithChildren, memo } from 'react';
2
4
  import { Flexbox } from 'react-layout-kit';
3
5
 
4
6
  import SafeSpacing from '@/components/SafeSpacing';
5
7
  import { HEADER_HEIGHT } from '@/const/layoutTokens';
6
8
 
7
- import ChatLayout from '../layout.desktop';
8
- import Header from './features/Header';
9
+ import Header from './Header';
9
10
 
10
11
  const DesktopLayout = memo<PropsWithChildren>(({ children }) => {
11
12
  return (
12
- <ChatLayout>
13
+ <>
13
14
  <Header />
14
15
  <Flexbox align={'center'} flex={1} gap={16} padding={24} style={{ overflow: 'auto' }}>
15
16
  <SafeSpacing height={HEADER_HEIGHT - 16} />
16
17
  {children}
17
18
  </Flexbox>
18
- </ChatLayout>
19
+ </>
19
20
  );
20
21
  });
21
22
 
@@ -0,0 +1,12 @@
1
+ import { memo } from 'react';
2
+
3
+ import { HeaderContent } from '@/app/chat/settings/components/Header';
4
+ import Layout from '@/app/chat/settings/components/Header/Mobile';
5
+
6
+ const Header = memo(() => (
7
+ <Layout>
8
+ <HeaderContent />
9
+ </Layout>
10
+ ));
11
+
12
+ export default Header;
@@ -1,8 +1,10 @@
1
+ 'use client';
2
+
1
3
  import { PropsWithChildren, memo } from 'react';
2
4
 
3
5
  import AppMobileLayout from '@/layout/AppMobileLayout';
4
6
 
5
- import Header from './features/Header';
7
+ import Header from './Header';
6
8
 
7
9
  const MobileLayout = memo<PropsWithChildren>(({ children }) => {
8
10
  return <AppMobileLayout navBar={<Header />}>{children}</AppMobileLayout>;
@@ -9,16 +9,11 @@ import { MOBILE_HEADER_ICON_SIZE } from '@/const/layoutTokens';
9
9
  import { exportSingleAgent, exportSingleSession } from '@/helpers/export';
10
10
  import { useSessionStore } from '@/store/session';
11
11
 
12
- import Desktop from './Desktop';
13
- import Mobile from './Mobile';
14
-
15
- const Header = memo<{ mobile?: boolean }>(() => {
12
+ export const HeaderContent = memo<{ mobile?: boolean }>(() => {
16
13
  const { t } = useTranslation('setting');
17
14
  const id = useSessionStore((s) => s.activeId);
18
15
  const { mobile } = useResponsive();
19
16
 
20
- const Render = mobile ? Mobile : Desktop;
21
-
22
17
  const items = useMemo<MenuProps['items']>(
23
18
  () => [
24
19
  {
@@ -46,12 +41,8 @@ const Header = memo<{ mobile?: boolean }>(() => {
46
41
  const size = mobile ? MOBILE_HEADER_ICON_SIZE : { fontSize: 24 };
47
42
 
48
43
  return (
49
- <Render>
50
- <Dropdown arrow={false} menu={{ items }} trigger={['click']}>
51
- <ActionIcon icon={HardDriveDownload} size={size} title={t('export', { ns: 'common' })} />
52
- </Dropdown>
53
- </Render>
44
+ <Dropdown arrow={false} menu={{ items }} trigger={['click']}>
45
+ <ActionIcon icon={HardDriveDownload} size={size} title={t('export', { ns: 'common' })} />
46
+ </Dropdown>
54
47
  );
55
48
  });
56
-
57
- export default Header;
@@ -0,0 +1,14 @@
1
+ import { PropsWithChildren } from 'react';
2
+
3
+ import { isMobileDevice } from '@/utils/responsive';
4
+
5
+ import Desktop from './(desktop)/layout.desktop';
6
+ import Mobile from './(mobile)/layout.mobile';
7
+
8
+ const Layout = ({ children }: PropsWithChildren) => {
9
+ const mobile = isMobileDevice();
10
+
11
+ return mobile ? <Mobile>{children}</Mobile> : <Desktop>{children}</Desktop>;
12
+ };
13
+
14
+ export default Layout;
@@ -1,7 +1,38 @@
1
- import Page from './index';
1
+ 'use client';
2
2
 
3
- const Index = () => {
4
- return <Page />;
5
- };
3
+ import isEqual from 'fast-deep-equal';
4
+ import { memo } from 'react';
5
+ import { useTranslation } from 'react-i18next';
6
6
 
7
- export default Index;
7
+ import PageTitle from '@/components/PageTitle';
8
+ import AgentSetting from '@/features/AgentSetting';
9
+ import { useSessionStore } from '@/store/session';
10
+ import { agentSelectors } from '@/store/session/selectors';
11
+ import { genSiteHeadTitle } from '@/utils/genSiteHeadTitle';
12
+
13
+ const EditPage = memo(() => {
14
+ const { t } = useTranslation('setting');
15
+ const config = useSessionStore(agentSelectors.currentAgentConfig, isEqual);
16
+ const meta = useSessionStore(agentSelectors.currentAgentMeta, isEqual);
17
+ const [updateAgentConfig, updateAgentMeta, title] = useSessionStore((s) => [
18
+ s.updateAgentConfig,
19
+ s.updateAgentMeta,
20
+ agentSelectors.currentAgentTitle(s),
21
+ ]);
22
+
23
+ const pageTitle = genSiteHeadTitle(t('header.sessionWithName', { name: title }));
24
+
25
+ return (
26
+ <>
27
+ <PageTitle title={pageTitle} />
28
+ <AgentSetting
29
+ config={config}
30
+ meta={meta}
31
+ onConfigChange={updateAgentConfig}
32
+ onMetaChange={updateAgentMeta}
33
+ />
34
+ </>
35
+ );
36
+ });
37
+
38
+ export default EditPage;
@@ -1,20 +1,24 @@
1
1
  'use client';
2
2
 
3
3
  import { Icon, Logo } from '@lobehub/ui';
4
- import { t } from 'i18next';
5
4
  import { Loader2 } from 'lucide-react';
5
+ import { useTranslation } from 'react-i18next';
6
6
  import { Center, Flexbox } from 'react-layout-kit';
7
7
 
8
- const Loading = () => (
9
- <Flexbox height={'100vh'} width={'100%'}>
10
- <Center flex={1} gap={12} width={'100%'}>
11
- <Logo extra={'Chat'} size={48} type={'combine'} />
12
- <Center gap={16} horizontal>
13
- <Icon icon={Loader2} spin />
14
- {t('appInitializing', { ns: 'common' })}
8
+ const Loading = () => {
9
+ const { t } = useTranslation();
10
+
11
+ return (
12
+ <Flexbox height={'100vh'} width={'100%'}>
13
+ <Center flex={1} gap={12} width={'100%'}>
14
+ <Logo extra={'Chat'} size={48} type={'combine'} />
15
+ <Center gap={16} horizontal>
16
+ <Icon icon={Loader2} spin />
17
+ {t('appInitializing', { ns: 'common' })}
18
+ </Center>
15
19
  </Center>
16
- </Center>
17
- </Flexbox>
18
- );
20
+ </Flexbox>
21
+ );
22
+ };
19
23
 
20
24
  export default Loading;
@@ -2,6 +2,7 @@ import { cookies } from 'next/headers';
2
2
  import { PropsWithChildren } from 'react';
3
3
 
4
4
  import Analytics from '@/components/Analytics';
5
+ import { DEFAULT_LANG, LOBE_LOCALE_COOKIE } from '@/const/locale';
5
6
  import {
6
7
  LOBE_THEME_APPEARANCE,
7
8
  LOBE_THEME_NEUTRAL_COLOR,
@@ -17,13 +18,15 @@ const RootLayout = ({ children }: PropsWithChildren) => {
17
18
  const appearance = cookieStore.get(LOBE_THEME_APPEARANCE);
18
19
  const neutralColor = cookieStore.get(LOBE_THEME_NEUTRAL_COLOR);
19
20
  const primaryColor = cookieStore.get(LOBE_THEME_PRIMARY_COLOR);
21
+ const lang = cookieStore.get(LOBE_LOCALE_COOKIE);
20
22
 
21
23
  return (
22
- <html lang="en-US">
24
+ <html lang={lang?.value || DEFAULT_LANG}>
23
25
  <body>
24
26
  <StyleRegistry>
25
27
  <Layout
26
28
  defaultAppearance={appearance?.value}
29
+ defaultLang={lang?.value}
27
30
  defaultNeutralColor={neutralColor?.value as any}
28
31
  defaultPrimaryColor={primaryColor?.value as any}
29
32
  >
@@ -46,7 +46,10 @@ const metadata: Metadata = {
46
46
  { color: '#f8f8f8', media: '(prefers-color-scheme: light)' },
47
47
  { color: '#000', media: '(prefers-color-scheme: dark)' },
48
48
  ],
49
- title: title,
49
+ title: {
50
+ default: title,
51
+ template: '%s · LobeChat',
52
+ },
50
53
  viewport: {
51
54
  initialScale: 1,
52
55
  maximumScale: 1,
@@ -2,11 +2,11 @@ import isEqual from 'fast-deep-equal';
2
2
  import { memo } from 'react';
3
3
 
4
4
  import AgentSetting from '@/features/AgentSetting';
5
- import { globalSelectors, useGlobalStore } from '@/store/global';
5
+ import { settingsSelectors, useGlobalStore } from '@/store/global';
6
6
 
7
7
  const Agent = memo(() => {
8
- const config = useGlobalStore(globalSelectors.defaultAgentConfig, isEqual);
9
- const meta = useGlobalStore(globalSelectors.defaultAgentMeta, isEqual);
8
+ const config = useGlobalStore(settingsSelectors.defaultAgentConfig, isEqual);
9
+ const meta = useGlobalStore(settingsSelectors.defaultAgentMeta, isEqual);
10
10
  const [updateAgent] = useGlobalStore((s) => [s.updateDefaultAgent]);
11
11
 
12
12
  return (
@@ -10,6 +10,7 @@ import Agent from './Agent';
10
10
 
11
11
  const AgentSetting = memo(() => {
12
12
  useSwitchSideBarOnInit(SettingsTabs.Agent);
13
+
13
14
  return (
14
15
  <Layout>
15
16
  <Agent />