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

🐛 fix(app): right panel should use stableLayout, bump @lobehub/ui to 5.9.0
This commit is contained in:
Neko 2026-04-17 19:11:45 +08:00 committed by GitHub
parent 34b60e1842
commit 3fb6b0d8e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 4 deletions

View file

@ -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",

View file

@ -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(() => {

View file

@ -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}