Skip to content

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

🐛 fix(app): right panel should use stableLayout, bump `@lobehub/ui` to `5.9.0` (#13920)

Neko3fb6b0d8e163
diff --git a/package.json b/package.json
index 16a258234c0..5f1f3948e80 100644
--- a/package.json
+++ b/package.json
@@ -270,7 +270,7 @@
"@lobehub/icons": "^5.0.0",
"@lobehub/market-sdk": "0.32.2",
"@lobehub/tts": "^5.1.2",
- "@lobehub/ui": "^5.6.1",
+ "@lobehub/ui": "^5.9.0",
"@modelcontextprotocol/sdk": "^1.26.0",
"@napi-rs/canvas": "^0.1.88",
"@neondatabase/serverless": "^1.0.2",
diff --git a/src/routes/(main)/agent/features/Conversation/WorkingSidebar/index.test.tsx b/src/routes/(main)/agent/features/Conversation/WorkingSidebar/index.test.tsx
index d3c56697c86..10d90afc217 100644
--- a/src/routes/(main)/agent/features/Conversation/WorkingSidebar/index.test.tsx
+++ b/src/routes/(main)/agent/features/Conversation/WorkingSidebar/index.test.tsx
@@ -41,8 +41,20 @@ vi.mock('@lobehub/ui', () => ({
Checkbox: ({ children, ...props }: { children?: ReactNode; [key: string]: unknown }) => (
<div {...props}>{children}</div>
),
- DraggablePanel: ({ children, expand }: { children?: ReactNode; expand?: boolean }) => (
- <div data-expand={String(expand)} data-testid="right-panel">
+ DraggablePanel: ({
+ children,
+ expand,
+ stableLayout,
+ }: {
+ children?: ReactNode;
+ expand?: boolean;
+ stableLayout?: boolean;
+ }) => (
+ <div
+ data-expand={String(expand)}
+ data-stable-layout={String(Boolean(stableLayout))}
+ data-testid="right-panel"
+ >
{children}
</div>
),
@@ -163,6 +175,7 @@ describe('Conversation right panel mount', () => {
expect(screen.getByText('chat-header')).toBeInTheDocument();
expect(screen.getByText('conversation-area')).toBeInTheDocument();
expect(screen.getByTestId('right-panel')).toBeInTheDocument();
+ expect(screen.getByTestId('right-panel')).toHaveAttribute('data-stable-layout', 'true');
expect(screen.getByTestId('workspace-resources')).toBeInTheDocument();
await waitFor(() => {
diff --git a/src/routes/(main)/agent/features/Conversation/WorkingSidebar/index.tsx b/src/routes/(main)/agent/features/Conversation/WorkingSidebar/index.tsx
index 994456669c6..69a90d36e2c 100644
--- a/src/routes/(main)/agent/features/Conversation/WorkingSidebar/index.tsx
+++ b/src/routes/(main)/agent/features/Conversation/WorkingSidebar/index.tsx
@@ -21,7 +21,7 @@ const AgentWorkingSidebar = memo<AgentWorkingSidebarProps>(
const isDocumentMode = Boolean(selectedDocumentId);
return (
- <RightPanel defaultWidth={360} maxWidth={720} minWidth={300}>
+ <RightPanel stableLayout defaultWidth={360} maxWidth={720} minWidth={300}>
{isDocumentMode ? (
<AgentDocumentEditorPanel
selectedDocumentId={selectedDocumentId}