@lobehub/chat 1.47.11 → 1.47.12

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.47.12](https://github.com/lobehub/lobe-chat/compare/v1.47.11...v1.47.12)
6
+
7
+ <sup>Released on **2025-01-21**</sup>
8
+
9
+ #### 💄 Styles
10
+
11
+ - **misc**: Refactor `[@nav](https://github.com/nav)` layout and improve pin list style.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Styles
19
+
20
+ - **misc**: Refactor `[@nav](https://github.com/nav)` layout and improve pin list style, closes [#5533](https://github.com/lobehub/lobe-chat/issues/5533) ([cc8a7f4](https://github.com/lobehub/lobe-chat/commit/cc8a7f4))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
5
30
  ### [Version 1.47.11](https://github.com/lobehub/lobe-chat/compare/v1.47.10...v1.47.11)
6
31
 
7
32
  <sup>Released on **2025-01-21**</sup>
package/changelog/v1.json CHANGED
@@ -1,4 +1,13 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "improvements": [
5
+ "Refactor [@nav](https://github.com/nav) layout and improve pin list style."
6
+ ]
7
+ },
8
+ "date": "2025-01-21",
9
+ "version": "1.47.12"
10
+ },
2
11
  {
3
12
  "children": {
4
13
  "improvements": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.47.11",
3
+ "version": "1.47.12",
4
4
  "description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -21,9 +21,29 @@ const useStyles = createStyles(({ css, token }) => ({
21
21
  box-shadow: 0 0 0 2px ${token.colorPrimary};
22
22
  }
23
23
  `,
24
- avatarActive: css`
25
- background: ${token.colorFillQuaternary};
26
- box-shadow: 0 0 0 2px ${token.colorPrimaryBorder};
24
+ ink: css`
25
+ &::before {
26
+ content: '';
27
+
28
+ position: absolute;
29
+ inset-block-start: 50%;
30
+ inset-inline: -${12 + 3}px;
31
+ transform: translateY(-50%);
32
+
33
+ width: 4px;
34
+ height: 0;
35
+ border-radius: 50px;
36
+
37
+ background: ${token.colorPrimary};
38
+
39
+ transition: height 150ms ease-out;
40
+ }
41
+ `,
42
+ inkActive: css`
43
+ &::before {
44
+ width: 8px;
45
+ height: 32px;
46
+ }
27
47
  `,
28
48
  }));
29
49
 
@@ -61,28 +81,33 @@ const PinList = () => {
61
81
  <Divider style={{ margin: '8px 12px' }} />
62
82
  <Flexbox flex={1} gap={12} height={'100%'}>
63
83
  {list.slice(0, 9).map((item, index) => (
64
- <Tooltip
65
- key={item.id}
66
- placement={'right'}
67
- title={
68
- <Flexbox gap={8} horizontal>
69
- {sessionHelpers.getTitle(item.meta)}
70
- <HotKeys inverseTheme keys={`ctrl+${index + 1}`} />
84
+ <Flexbox key={item.id} style={{ position: 'relative' }}>
85
+ <Tooltip
86
+ placement={'right'}
87
+ title={
88
+ <Flexbox gap={8} horizontal>
89
+ {sessionHelpers.getTitle(item.meta)}
90
+ <HotKeys inverseTheme keys={`ctrl+${index + 1}`} />
91
+ </Flexbox>
92
+ }
93
+ >
94
+ <Flexbox
95
+ className={cx(
96
+ styles.ink,
97
+ isPinned && activeId === item.id ? styles.inkActive : undefined,
98
+ )}
99
+ >
100
+ <Avatar
101
+ avatar={sessionHelpers.getAvatar(item.meta)}
102
+ background={item.meta.backgroundColor}
103
+ className={cx(styles.avatar)}
104
+ onClick={() => {
105
+ switchAgent(item.id);
106
+ }}
107
+ />
71
108
  </Flexbox>
72
- }
73
- >
74
- <Avatar
75
- avatar={sessionHelpers.getAvatar(item.meta)}
76
- background={item.meta.backgroundColor}
77
- className={cx(
78
- styles.avatar,
79
- isPinned && activeId === item.id ? styles.avatarActive : undefined,
80
- )}
81
- onClick={() => {
82
- switchAgent(item.id);
83
- }}
84
- />
85
- </Tooltip>
109
+ </Tooltip>
110
+ </Flexbox>
86
111
  ))}
87
112
  </Flexbox>
88
113
  </>
@@ -2,18 +2,18 @@
2
2
 
3
3
  import { useTheme } from 'antd-style';
4
4
  import dynamic from 'next/dynamic';
5
- import { memo } from 'react';
5
+ import { PropsWithChildren, memo } from 'react';
6
6
  import { Flexbox } from 'react-layout-kit';
7
7
 
8
8
  import { BANNER_HEIGHT } from '@/features/AlertBanner/CloudBanner';
9
9
  import { usePlatform } from '@/hooks/usePlatform';
10
10
  import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
11
11
 
12
- import { LayoutProps } from './type';
12
+ import SideBar from './SideBar';
13
13
 
14
14
  const CloudBanner = dynamic(() => import('@/features/AlertBanner/CloudBanner'));
15
15
 
16
- const Layout = memo<LayoutProps>(({ children, nav }) => {
16
+ const Layout = memo<PropsWithChildren>(({ children }) => {
17
17
  const { isPWA } = usePlatform();
18
18
  const theme = useTheme();
19
19
 
@@ -31,7 +31,7 @@ const Layout = memo<LayoutProps>(({ children, nav }) => {
31
31
  }}
32
32
  width={'100%'}
33
33
  >
34
- {nav}
34
+ <SideBar />
35
35
  {children}
36
36
  </Flexbox>
37
37
  </>
@@ -27,7 +27,7 @@ const useStyles = createStyles(({ css, token }) => ({
27
27
  `,
28
28
  }));
29
29
 
30
- const Nav = memo(() => {
30
+ const NavBar = memo(() => {
31
31
  const { t } = useTranslation('common');
32
32
  const { styles } = useStyles();
33
33
  const activeKey = useActiveTabKey();
@@ -75,6 +75,6 @@ const Nav = memo(() => {
75
75
  return <MobileTabBar activeKey={activeKey} className={styles.container} items={items} />;
76
76
  });
77
77
 
78
- Nav.displayName = 'MobileNav';
78
+ NavBar.displayName = 'NavBar';
79
79
 
80
- export default Nav;
80
+ export default NavBar;
@@ -3,12 +3,12 @@
3
3
  import dynamic from 'next/dynamic';
4
4
  import { usePathname } from 'next/navigation';
5
5
  import qs from 'query-string';
6
- import { memo } from 'react';
6
+ import { PropsWithChildren, memo } from 'react';
7
7
 
8
8
  import { useQuery } from '@/hooks/useQuery';
9
9
  import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
10
10
 
11
- import { LayoutProps } from './type';
11
+ import NavBar from './NavBar';
12
12
 
13
13
  const CloudBanner = dynamic(() => import('@/features/AlertBanner/CloudBanner'));
14
14
  const MOBILE_NAV_ROUTES = new Set([
@@ -21,7 +21,7 @@ const MOBILE_NAV_ROUTES = new Set([
21
21
  '/me',
22
22
  ]);
23
23
 
24
- const Layout = memo(({ children, nav }: LayoutProps) => {
24
+ const Layout = memo(({ children }: PropsWithChildren) => {
25
25
  const { showMobileWorkspace } = useQuery();
26
26
  const pathname = usePathname();
27
27
  const { url } = qs.parseUrl(pathname);
@@ -33,7 +33,7 @@ const Layout = memo(({ children, nav }: LayoutProps) => {
33
33
  <>
34
34
  {showCloudPromotion && <CloudBanner mobile />}
35
35
  {children}
36
- {showNav && nav}
36
+ {showNav && <NavBar />}
37
37
  </>
38
38
  );
39
39
  });
@@ -2,9 +2,8 @@ import ServerLayout from '@/components/server/ServerLayout';
2
2
 
3
3
  import Desktop from './_layout/Desktop';
4
4
  import Mobile from './_layout/Mobile';
5
- import { LayoutProps } from './_layout/type';
6
5
 
7
- const MainLayout = ServerLayout<LayoutProps>({ Desktop, Mobile });
6
+ const MainLayout = ServerLayout({ Desktop, Mobile });
8
7
 
9
8
  MainLayout.displayName = 'MainLayout';
10
9
 
@@ -93,7 +93,6 @@ const StoreInitialization = memo(() => {
93
93
  router.prefetch('/me');
94
94
  } else {
95
95
  router.prefetch('/chat/settings/modal');
96
- router.prefetch('/settings/modal');
97
96
  }
98
97
  }, [router, mobile]);
99
98
 
@@ -1,10 +0,0 @@
1
- import ServerLayout from '@/components/server/ServerLayout';
2
-
3
- import Desktop from './_layout/Desktop';
4
- import Mobile from './_layout/Mobile';
5
-
6
- const Nav = ServerLayout({ Desktop, Mobile });
7
-
8
- Nav.displayName = 'Nav';
9
-
10
- export default Nav;
@@ -1,6 +0,0 @@
1
- import { ReactNode } from 'react';
2
-
3
- export interface LayoutProps {
4
- children: ReactNode;
5
- nav: ReactNode;
6
- }