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.

⏪️ revert(agent): remove root layout direction workaround (#18017)

Innei5d5e0662b8fa
diff --git a/src/routes/(main)/agent/_layout/index.test.tsx b/src/routes/(main)/agent/_layout/index.test.tsx
index cd63c90f674..7b42c4a0dcc 100644
--- a/src/routes/(main)/agent/_layout/index.test.tsx
+++ b/src/routes/(main)/agent/_layout/index.test.tsx
@@ -8,18 +8,8 @@ import { describe, expect, it, vi } from 'vitest';
import Layout from './index';
vi.mock('@lobehub/ui', () => ({
- Flexbox: ({
- children,
- direction,
- ...props
- }: {
- children?: ReactNode;
- direction?: 'horizontal' | 'vertical';
- [key: string]: unknown;
- }) => (
- <div {...props} style={{ flexDirection: direction === 'vertical' ? 'column' : direction }}>
- {children}
- </div>
+ Flexbox: ({ children, ...props }: { children?: ReactNode; [key: string]: unknown }) => (
+ <div {...props}>{children}</div>
),
ShikiLobeTheme: {},
}));
@@ -53,14 +43,6 @@ describe('Agent layout', () => {
expect(screen.getByTestId('agent-layout-outlet')).toBeInTheDocument();
});
- it('keeps routed content in a vertical layout', () => {
- render(<Layout />);
-
- expect(screen.getByTestId('agent-layout-outlet').parentElement).toHaveStyle({
- flexDirection: 'column',
- });
- });
-
it('mounts AgentIdSync in layout', () => {
render(<Layout />);
diff --git a/src/routes/(main)/agent/_layout/index.tsx b/src/routes/(main)/agent/_layout/index.tsx
index de65379a386..d3627c15ff5 100644
--- a/src/routes/(main)/agent/_layout/index.tsx
+++ b/src/routes/(main)/agent/_layout/index.tsx
@@ -19,7 +19,7 @@ const Layout: FC = () => {
return (
<>
<AgentSidebar />
- <Flexbox className={styles.mainContainer} direction="vertical" flex={1} height={'100%'}>
+ <Flexbox className={styles.mainContainer} flex={1} height={'100%'}>
{/* Keep the sidebar interactive when the routed agent is gone (deleted
or made private) — only the content area collapses to the 404 card. */}
<AgentNotFoundGuard>