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(agent): keep profile breadcrumb left-aligned (#17086)

AmAzing-b0cabbf20eff
diff --git a/src/routes/(main)/agent/profile/features/Header/index.test.tsx b/src/routes/(main)/agent/profile/features/Header/index.test.tsx
index ba3edb12768..bf4200fc999 100644
--- a/src/routes/(main)/agent/profile/features/Header/index.test.tsx
+++ b/src/routes/(main)/agent/profile/features/Header/index.test.tsx
@@ -139,7 +139,6 @@ vi.mock('@/components/AntdStaticMethods', () => ({
}));
vi.mock('@/const/layoutTokens', () => ({
- CONVERSATION_MIN_WIDTH: 960,
DESKTOP_HEADER_ICON_SMALL_SIZE: 24,
}));
@@ -231,16 +230,20 @@ describe('Agent profile Header', () => {
mocks.agentState.isCurrentAgentHeterogeneous = false;
mocks.agentState.systemRole = 'You are helpful.';
mocks.agentState.config.plugins = ['lobe-web-browsing'];
+ mocks.globalState.showAgentBuilderPanel = false;
mocks.profileState.editor = undefined;
});
- it('aligns the breadcrumb with the responsive profile content column', () => {
- render(<Header />);
+ it.each([false, true])(
+ 'keeps the breadcrumb aligned with the left content inset when builder expanded is %s',
+ (showAgentBuilderPanel) => {
+ mocks.globalState.showAgentBuilderPanel = showAgentBuilderPanel;
- expect(screen.getByTestId('nav-header-left').style.paddingInlineStart).toBe(
- 'max(8px, calc((100% - 960px) / 2 + 16px))',
- );
- });
+ render(<Header />);
+
+ expect(screen.getByTestId('nav-header-left').style.paddingInlineStart).toBe('8px');
+ },
+ );
it('should show the markdown export action', () => {
render(<Header />);
diff --git a/src/routes/(main)/agent/profile/features/Header/index.tsx b/src/routes/(main)/agent/profile/features/Header/index.tsx
index 533b6738e9a..0258893400e 100644
--- a/src/routes/(main)/agent/profile/features/Header/index.tsx
+++ b/src/routes/(main)/agent/profile/features/Header/index.tsx
@@ -18,7 +18,7 @@ import { useTranslation } from 'react-i18next';
import { useAgentTransferMenuItem } from '@/business/client/hooks/useAgentTransferMenuItem';
import { useBusinessAgentImportMenuItem } from '@/business/client/hooks/useBusinessAgentImportMenuItem';
import { message } from '@/components/AntdStaticMethods';
-import { CONVERSATION_MIN_WIDTH, DESKTOP_HEADER_ICON_SMALL_SIZE } from '@/const/layoutTokens';
+import { DESKTOP_HEADER_ICON_SMALL_SIZE } from '@/const/layoutTokens';
import AgentBreadcrumb from '@/features/AgentBreadcrumb';
import NavHeader from '@/features/NavHeader';
import ToggleRightPanelButton from '@/features/RightPanel/ToggleRightPanelButton';
@@ -273,7 +273,7 @@ const Header = memo(() => {
}
styles={{
left: {
- paddingInlineStart: `max(8px, calc((100% - ${CONVERSATION_MIN_WIDTH}px) / 2 + 16px))`,
+ paddingInlineStart: 8,
},
}}
/>