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(nav-panel): polish SideBarDrawer & header layout details (#14762)

Innei4b6b341951fb
diff --git a/src/features/AgentTasks/AgentTaskList/TasksGroupConfig.tsx b/src/features/AgentTasks/AgentTaskList/TasksGroupConfig.tsx
index 1da1e13fbd0..023f826bd68 100644
--- a/src/features/AgentTasks/AgentTaskList/TasksGroupConfig.tsx
+++ b/src/features/AgentTasks/AgentTaskList/TasksGroupConfig.tsx
@@ -12,7 +12,7 @@ import {
import { memo, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import { DESKTOP_HEADER_ICON_SIZE } from '@/const/layoutTokens';
+import { DESKTOP_HEADER_ICON_SMALL_SIZE } from '@/const/layoutTokens';
import { useTaskStore } from '@/store/task';
import { taskListSelectors } from '@/store/task/selectors';
@@ -196,7 +196,7 @@ const TasksGroupConfig = memo<TasksHeaderProps>(({ options, setOptions }) => {
trigger={['click']}
onOpenChange={setIsViewConfigOpen}
>
- <ActionIcon icon={Settings2Icon} size={DESKTOP_HEADER_ICON_SIZE} />
+ <ActionIcon icon={Settings2Icon} size={DESKTOP_HEADER_ICON_SMALL_SIZE} />
</Popover>
);
});
diff --git a/src/features/NavPanel/SideBarDrawer.tsx b/src/features/NavPanel/SideBarDrawer.tsx
index a48a5cded09..72d6849fa51 100644
--- a/src/features/NavPanel/SideBarDrawer.tsx
+++ b/src/features/NavPanel/SideBarDrawer.tsx
@@ -7,7 +7,7 @@ import { XIcon } from 'lucide-react';
import type { ReactNode, Ref } from 'react';
import { cloneElement, isValidElement, memo, Suspense, useCallback, useState } from 'react';
-import { DESKTOP_HEADER_ICON_SIZE } from '@/const/layoutTokens';
+import { DESKTOP_HEADER_ICON_SMALL_SIZE } from '@/const/layoutTokens';
import { NAV_PANEL_RIGHT_DRAWER_ID } from './';
import SkeletonList from './components/SkeletonList';
@@ -116,7 +116,12 @@ const SideBarDrawer = memo<SideBarDrawerProps>(
right={
<>
{action}
- <ActionIcon icon={XIcon} size={DESKTOP_HEADER_ICON_SIZE} onClick={onClose} />
+ <ActionIcon
+ icon={XIcon}
+ size={DESKTOP_HEADER_ICON_SMALL_SIZE}
+ style={{ marginInlineEnd: -2 }}
+ onClick={onClose}
+ />
</>
}
/>
diff --git a/src/features/NavPanel/SideBarHeaderLayout.tsx b/src/features/NavPanel/SideBarHeaderLayout.tsx
index edc811316f0..9a6071e3684 100644
--- a/src/features/NavPanel/SideBarHeaderLayout.tsx
+++ b/src/features/NavPanel/SideBarHeaderLayout.tsx
@@ -1,6 +1,5 @@
'use client';
-import type { ActionIconProps } from '@lobehub/ui';
import { Flexbox, Icon, Text } from '@lobehub/ui';
import type { BreadcrumbProps } from 'antd';
import { Breadcrumb } from 'antd';
@@ -12,14 +11,12 @@ import { flushSync } from 'react-dom';
import { useNavigate } from 'react-router-dom';
import { DESKTOP_HEADER_ICON_SMALL_SIZE } from '@/const/layoutTokens';
-import { isDesktop } from '@/const/version';
import { isModifierClick } from '@/utils/navigation';
import BackButton from './components/BackButton';
import ToggleLeftPanelButton from './ToggleLeftPanelButton';
const prefixCls = 'ant';
-const SIDEBAR_HEADER_ACTION_ICON_SIZE: ActionIconProps['size'] = 'small';
const styles = createStaticStyles(({ css, cssVar }) => ({
breadcrumb: css`
@@ -43,7 +40,6 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
`,
container: css`
overflow: hidden;
- margin-block-start: ${isDesktop ? '' : '8px'};
`,
}));
diff --git a/src/routes/(main)/agent/_layout/Sidebar/Topic/AllTopicsDrawer/Content.tsx b/src/routes/(main)/agent/_layout/Sidebar/Topic/AllTopicsDrawer/Content.tsx
index 1553d852e28..149901d46a5 100644
--- a/src/routes/(main)/agent/_layout/Sidebar/Topic/AllTopicsDrawer/Content.tsx
+++ b/src/routes/(main)/agent/_layout/Sidebar/Topic/AllTopicsDrawer/Content.tsx
@@ -13,7 +13,7 @@ import { topicSelectors } from '@/store/chat/selectors';
import TopicItem from '../List/Item';
-const ITEM_HEIGHT = 44; // Each topic item height
+const ITEM_HEIGHT = 36; // Each topic item height (NavItem height, no vertical padding)
interface ContentProps {
open: boolean;
@@ -159,7 +159,7 @@ const Content = memo<ContentProps>(({ open, searchKeyword }) => {
onScroll={handleScroll}
>
{activeTopicList?.map((topic) => (
- <Flexbox gap={1} key={topic.id} padding={'4px 8px'}>
+ <Flexbox gap={1} key={topic.id} paddingInline={4}>
<TopicItem
active={activeTopicId === topic.id}
fav={topic.favorite}