@lobehub/lobehub 2.0.0-next.256 → 2.0.0-next.257
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 +25 -0
- package/changelog/v1.json +9 -0
- package/package.json +1 -1
- package/src/features/PageEditor/Copilot/index.tsx +16 -1
- package/src/features/RightPanel/index.tsx +11 -2
- package/src/store/chat/slices/portal/initialState.ts +10 -10
- package/src/store/chat/slices/portal/selectors.ts +1 -1
- package/src/store/document/slices/editor/index.ts +1 -1
- package/src/store/global/initialState.ts +2 -0
- package/src/store/global/selectors/systemStatus.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
## [Version 2.0.0-next.257](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.256...v2.0.0-next.257)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2026-01-10**</sup>
|
|
8
|
+
|
|
9
|
+
#### 💄 Styles
|
|
10
|
+
|
|
11
|
+
- **misc**: Remember page agent panel width.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### Styles
|
|
19
|
+
|
|
20
|
+
- **misc**: Remember page agent panel width, closes [#11389](https://github.com/lobehub/lobe-chat/issues/11389) ([801b624](https://github.com/lobehub/lobe-chat/commit/801b624))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
5
30
|
## [Version 2.0.0-next.256](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.255...v2.0.0-next.256)
|
|
6
31
|
|
|
7
32
|
<sup>Released on **2026-01-10**</sup>
|
package/changelog/v1.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/lobehub",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.257",
|
|
4
4
|
"description": "LobeHub - an open-source,comprehensive AI Agent 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",
|
|
@@ -5,6 +5,8 @@ import { memo } from 'react';
|
|
|
5
5
|
import RightPanel from '@/features/RightPanel';
|
|
6
6
|
import { useAgentStore } from '@/store/agent';
|
|
7
7
|
import { builtinAgentSelectors } from '@/store/agent/selectors';
|
|
8
|
+
import { useGlobalStore } from '@/store/global';
|
|
9
|
+
import { systemStatusSelectors } from '@/store/global/selectors';
|
|
8
10
|
|
|
9
11
|
import Conversation from './Conversation';
|
|
10
12
|
|
|
@@ -13,9 +15,22 @@ import Conversation from './Conversation';
|
|
|
13
15
|
*/
|
|
14
16
|
const Copilot = memo(() => {
|
|
15
17
|
const pageAgentId = useAgentStore(builtinAgentSelectors.pageAgentId);
|
|
18
|
+
const [width, updateSystemStatus] = useGlobalStore((s) => [
|
|
19
|
+
systemStatusSelectors.pageAgentPanelWidth(s),
|
|
20
|
+
s.updateSystemStatus,
|
|
21
|
+
]);
|
|
16
22
|
|
|
23
|
+
console.log('defaultWidth:', width);
|
|
17
24
|
return (
|
|
18
|
-
<RightPanel
|
|
25
|
+
<RightPanel
|
|
26
|
+
defaultWidth={width}
|
|
27
|
+
onSizeChange={(size) => {
|
|
28
|
+
if (size?.width) {
|
|
29
|
+
const w = typeof size.width === 'string' ? Number.parseInt(size.width) : size.width;
|
|
30
|
+
if (!!w) updateSystemStatus({ pageAgentPanelWidth: w });
|
|
31
|
+
}
|
|
32
|
+
}}
|
|
33
|
+
>
|
|
19
34
|
<Conversation agentId={pageAgentId} />
|
|
20
35
|
</RightPanel>
|
|
21
36
|
);
|
|
@@ -6,15 +6,21 @@ import Loading from '@/components/Loading/BrandTextLoading';
|
|
|
6
6
|
import { useGlobalStore } from '@/store/global';
|
|
7
7
|
import { systemStatusSelectors } from '@/store/global/selectors';
|
|
8
8
|
|
|
9
|
+
export interface Size {
|
|
10
|
+
height?: string | number;
|
|
11
|
+
width?: string | number;
|
|
12
|
+
}
|
|
13
|
+
|
|
9
14
|
interface RightPanelProps extends Omit<
|
|
10
15
|
DraggablePanelProps,
|
|
11
16
|
'placement' | 'size' | 'onSizeChange' | 'onExpandChange'
|
|
12
17
|
> {
|
|
13
18
|
defaultWidth?: number | string;
|
|
19
|
+
onSizeChange?: (size?: Size) => void;
|
|
14
20
|
}
|
|
15
21
|
|
|
16
22
|
const RightPanel = memo<RightPanelProps>(
|
|
17
|
-
({ maxWidth = 600, minWidth = 300, children, defaultWidth = 360, ...rest }) => {
|
|
23
|
+
({ maxWidth = 600, minWidth = 300, children, defaultWidth = 360, onSizeChange, ...rest }) => {
|
|
18
24
|
const [showRightPanel, toggleRightPanel] = useGlobalStore((s) => [
|
|
19
25
|
systemStatusSelectors.showRightPanel(s),
|
|
20
26
|
s.toggleRightPanel,
|
|
@@ -31,7 +37,10 @@ const RightPanel = memo<RightPanelProps>(
|
|
|
31
37
|
minWidth={minWidth}
|
|
32
38
|
onExpandChange={(expand) => toggleRightPanel(expand)}
|
|
33
39
|
onSizeChange={(_, size) => {
|
|
34
|
-
if (size?.width)
|
|
40
|
+
if (size?.width) {
|
|
41
|
+
setWidth(size.width);
|
|
42
|
+
}
|
|
43
|
+
if (size) onSizeChange?.(size);
|
|
35
44
|
}}
|
|
36
45
|
placement="right"
|
|
37
46
|
size={{
|
|
@@ -16,7 +16,7 @@ export enum PortalViewType {
|
|
|
16
16
|
MessageDetail = 'messageDetail',
|
|
17
17
|
Notebook = 'notebook',
|
|
18
18
|
Thread = 'thread',
|
|
19
|
-
ToolUI = 'toolUI'
|
|
19
|
+
ToolUI = 'toolUI',
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export interface PortalFile {
|
|
@@ -27,21 +27,21 @@ export interface PortalFile {
|
|
|
27
27
|
|
|
28
28
|
export type PortalViewData =
|
|
29
29
|
| { type: PortalViewType.Home }
|
|
30
|
-
| { artifact: PortalArtifact
|
|
31
|
-
| { documentId: string
|
|
30
|
+
| { artifact: PortalArtifact; type: PortalViewType.Artifact }
|
|
31
|
+
| { documentId: string; type: PortalViewType.Document }
|
|
32
32
|
| { type: PortalViewType.Notebook }
|
|
33
|
-
| { file: PortalFile
|
|
34
|
-
| { messageId: string
|
|
35
|
-
| { identifier: string
|
|
36
|
-
| { startMessageId?: string
|
|
37
|
-
| { agentId: string
|
|
33
|
+
| { file: PortalFile; type: PortalViewType.FilePreview }
|
|
34
|
+
| { messageId: string; type: PortalViewType.MessageDetail }
|
|
35
|
+
| { identifier: string; messageId: string; type: PortalViewType.ToolUI }
|
|
36
|
+
| { startMessageId?: string; threadId?: string; type: PortalViewType.Thread }
|
|
37
|
+
| { agentId: string; type: PortalViewType.GroupThread };
|
|
38
38
|
|
|
39
39
|
// ============== Portal State ==============
|
|
40
40
|
|
|
41
41
|
export interface ChatPortalState {
|
|
42
42
|
// Legacy fields (kept for backward compatibility during migration)
|
|
43
|
-
// TODO: Remove after Phase 3 migration complete
|
|
44
|
-
/** @deprecated Use portalStack instead */
|
|
43
|
+
// TODO: Remove after Phase 3 migration complete
|
|
44
|
+
/** @deprecated Use portalStack instead */
|
|
45
45
|
portalArtifact?: PortalArtifact;
|
|
46
46
|
portalArtifactDisplayMode: ArtifactDisplayMode;
|
|
47
47
|
/** @deprecated Use portalStack instead */
|
|
@@ -109,7 +109,7 @@ const messageDetailId = (s: ChatStoreState): string | undefined => {
|
|
|
109
109
|
// Tool UI / Plugin selectors
|
|
110
110
|
const currentToolUI = (
|
|
111
111
|
s: ChatStoreState,
|
|
112
|
-
): { identifier: string
|
|
112
|
+
): { identifier: string; messageId: string } | undefined => {
|
|
113
113
|
const view = getViewData(s, PortalViewType.ToolUI);
|
|
114
114
|
if (view) {
|
|
115
115
|
return { identifier: view.identifier, messageId: view.messageId };
|
|
@@ -122,6 +122,7 @@ export interface SystemStatus {
|
|
|
122
122
|
*/
|
|
123
123
|
modelSwitchPanelWidth?: number;
|
|
124
124
|
noWideScreen?: boolean;
|
|
125
|
+
pageAgentPanelWidth?: number;
|
|
125
126
|
/**
|
|
126
127
|
* number of pages (documents) to display per page
|
|
127
128
|
*/
|
|
@@ -198,6 +199,7 @@ export const INITIAL_STATUS = {
|
|
|
198
199
|
modelSwitchPanelGroupMode: 'byProvider',
|
|
199
200
|
modelSwitchPanelWidth: 430,
|
|
200
201
|
noWideScreen: true,
|
|
202
|
+
pageAgentPanelWidth: 360,
|
|
201
203
|
pagePageSize: 20,
|
|
202
204
|
portalWidth: 400,
|
|
203
205
|
resourceManagerColumnWidths: {
|
|
@@ -27,6 +27,7 @@ const language = (s: GlobalState) => s.status.language || 'auto';
|
|
|
27
27
|
const modelSwitchPanelGroupMode = (s: GlobalState) =>
|
|
28
28
|
s.status.modelSwitchPanelGroupMode || 'byProvider';
|
|
29
29
|
const modelSwitchPanelWidth = (s: GlobalState) => s.status.modelSwitchPanelWidth || 430;
|
|
30
|
+
const pageAgentPanelWidth = (s: GlobalState) => s.status.pageAgentPanelWidth || 360;
|
|
30
31
|
|
|
31
32
|
const showChatHeader = (s: GlobalState) => !s.status.zenMode;
|
|
32
33
|
const inZenMode = (s: GlobalState) => s.status.zenMode;
|
|
@@ -76,6 +77,7 @@ export const systemStatusSelectors = {
|
|
|
76
77
|
mobileShowTopic,
|
|
77
78
|
modelSwitchPanelGroupMode,
|
|
78
79
|
modelSwitchPanelWidth,
|
|
80
|
+
pageAgentPanelWidth,
|
|
79
81
|
pagePageSize,
|
|
80
82
|
portalWidth,
|
|
81
83
|
sessionGroupKeys,
|