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.

💄 style(topic): move view-toggle next to sort control in toolbar (#16547)

Arvin Xu7cf70e6c73b0
diff --git a/src/features/AgentTopicManager/Header.tsx b/src/features/AgentTopicManager/Header.tsx
index 2900ef0dcea..41435aaaaf6 100644
--- a/src/features/AgentTopicManager/Header.tsx
+++ b/src/features/AgentTopicManager/Header.tsx
@@ -1,9 +1,8 @@
'use client';
-import { Flexbox, Icon, Input, Text, Tooltip } from '@lobehub/ui';
-import { Tabs } from '@lobehub/ui/base-ui';
+import { Icon, Input, Text } from '@lobehub/ui';
import { Breadcrumb as AntBreadcrumb } from 'antd';
-import { ChevronRight, LayoutGrid, List as ListIcon, Search } from 'lucide-react';
+import { ChevronRight, Search } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
import { Link } from 'react-router';
@@ -27,8 +26,6 @@ const Header = memo<HeaderProps>(({ agentId }) => {
const displayTitle = isInbox
? agentTitle || t('inbox.title', { ns: 'chat' })
: agentTitle || t('defaultSession', { ns: 'common' });
- const viewMode = useTopicsViewStore((s) => s.viewMode);
- const setViewMode = useTopicsViewStore((s) => s.setViewMode);
const search = useTopicsViewStore((s) => s.search);
const setSearch = useTopicsViewStore((s) => s.setSearch);
@@ -58,33 +55,6 @@ const Header = memo<HeaderProps>(({ agentId }) => {
]}
/>
}
- right={
- <Flexbox horizontal align={'center'} gap={6}>
- <Tabs
- activeKey={viewMode}
- size={'small'}
- items={[
- {
- key: 'card',
- label: (
- <Tooltip title={t('management.view.card')}>
- <Icon icon={LayoutGrid} />
- </Tooltip>
- ),
- },
- {
- key: 'list',
- label: (
- <Tooltip title={t('management.view.list')}>
- <Icon icon={ListIcon} />
- </Tooltip>
- ),
- },
- ]}
- onChange={(key) => setViewMode(key as 'card' | 'list')}
- />
- </Flexbox>
- }
>
<Input
placeholder={t('management.searchPlaceholder')}
diff --git a/src/features/AgentTopicManager/Toolbar.tsx b/src/features/AgentTopicManager/Toolbar.tsx
index 976e1568876..d84a05a8002 100644
--- a/src/features/AgentTopicManager/Toolbar.tsx
+++ b/src/features/AgentTopicManager/Toolbar.tsx
@@ -1,6 +1,14 @@
'use client';
-import { ActionIcon, type DropdownItem, DropdownMenu, Flexbox, Icon, Text } from '@lobehub/ui';
+import {
+ ActionIcon,
+ type DropdownItem,
+ DropdownMenu,
+ Flexbox,
+ Icon,
+ Text,
+ Tooltip,
+} from '@lobehub/ui';
import { confirmModal, Tabs } from '@lobehub/ui/base-ui';
import { App } from 'antd';
import { createStaticStyles, cssVar } from 'antd-style';
@@ -9,6 +17,8 @@ import {
CalendarRange,
ChevronDown,
FolderClosed,
+ LayoutGrid,
+ List as ListIcon,
ListFilter,
ListTodoIcon,
type LucideIcon,
@@ -220,6 +230,8 @@ const Toolbar = memo<ToolbarProps>(({ projects, statusCounts }) => {
const setSortBy = useTopicsViewStore((s) => s.setSortBy);
const groupBy = useTopicsViewStore((s) => s.groupBy);
const setGroupBy = useTopicsViewStore((s) => s.setGroupBy);
+ const viewMode = useTopicsViewStore((s) => s.viewMode);
+ const setViewMode = useTopicsViewStore((s) => s.setViewMode);
const triggerItems: DropdownItem[] = useMemo(
() =>
@@ -478,6 +490,33 @@ const Toolbar = memo<ToolbarProps>(({ projects, statusCounts }) => {
<Flexbox flex={1} />
+ <Tabs
+ activeKey={viewMode}
+ size={'small'}
+ style={{ width: 'auto' }}
+ items={[
+ {
+ key: 'card',
+ label: (
+ <Tooltip title={t('management.view.card')}>
+ <Icon icon={LayoutGrid} />
+ </Tooltip>
+ ),
+ },
+ {
+ key: 'list',
+ label: (
+ <Tooltip title={t('management.view.list')}>
+ <Icon icon={ListIcon} />
+ </Tooltip>
+ ),
+ },
+ ]}
+ onChange={(key) => setViewMode(key as 'card' | 'list')}
+ />
+
+ <span className={styles.divider} />
+
<DropdownMenu items={sortItems}>
<span className={styles.sortPill}>
<Text style={{ color: cssVar.colorTextSecondary, fontSize: 12 }}>