From 745112a13605abade2590a15e03625d6bc0acd8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98=E9=98=BF=E6=B1=9F=28Relakkes?= =?UTF-8?q?=29?= Date: Fri, 10 Jul 2026 18:05:54 +0800 Subject: [PATCH] fix(desktop): remove activity count badge Keep the Activity entry available without showing persistent numeric attention markers. Confidence: high Scope-risk: narrow Tested: bun run check:desktop Not-tested: manual Electron visual smoke --- .../activity/SessionActivityButton.tsx | 12 ------------ desktop/src/components/layout/TabBar.test.tsx | 18 +++++++++--------- desktop/src/components/layout/TabBar.tsx | 6 ++---- 3 files changed, 11 insertions(+), 25 deletions(-) diff --git a/desktop/src/components/activity/SessionActivityButton.tsx b/desktop/src/components/activity/SessionActivityButton.tsx index 1740a81a..917ae0e0 100644 --- a/desktop/src/components/activity/SessionActivityButton.tsx +++ b/desktop/src/components/activity/SessionActivityButton.tsx @@ -4,21 +4,17 @@ import { useActivityPanelStore } from '../../stores/activityPanelStore' type SessionActivityButtonProps = { sessionId: string - badgeCount: number label?: string } export function SessionActivityButton({ sessionId, - badgeCount, label, }: SessionActivityButtonProps) { const t = useTranslation() const resolvedLabel = label ?? t('session.activity.title') const isOpen = useActivityPanelStore((state) => state.isOpen(sessionId)) const toggle = useActivityPanelStore((state) => state.toggle) - const visibleBadgeCount = Math.max(0, badgeCount) - return ( ) } diff --git a/desktop/src/components/layout/TabBar.test.tsx b/desktop/src/components/layout/TabBar.test.tsx index 10e3a2a6..99c3fde2 100644 --- a/desktop/src/components/layout/TabBar.test.tsx +++ b/desktop/src/components/layout/TabBar.test.tsx @@ -326,7 +326,7 @@ describe('TabBar', () => { expect(screen.queryByTestId('session-activity-badge')).not.toBeInTheDocument() }) - it('shows the activity button with a badge for running or failed activity', async () => { + it('shows the activity button without a numeric badge for running or failed activity', async () => { const { TabBar } = await import('./TabBar') const { useTabStore } = await import('../../stores/tabStore') const { useChatStore } = await import('../../stores/chatStore') @@ -375,7 +375,7 @@ describe('TabBar', () => { const button = screen.getByRole('button', { name: /activity/i }) expect(button).toBeInTheDocument() - expect(screen.getByTestId('session-activity-badge')).toHaveTextContent('2') + expect(screen.queryByTestId('session-activity-badge')).not.toBeInTheDocument() expect(useActivityPanelStore.getState().isOpen(sessionId)).toBe(false) expect(button).toHaveAttribute('aria-expanded', 'false') expect(button).toHaveAttribute('aria-pressed', 'false') @@ -426,7 +426,7 @@ describe('TabBar', () => { }) expect(screen.getByRole('button', { name: /activity/i })).toBeInTheDocument() - expect(screen.getByTestId('session-activity-badge')).toHaveTextContent('1') + expect(screen.queryByTestId('session-activity-badge')).not.toBeInTheDocument() }) it('hides team-only activity when the active team belongs to another session', async () => { @@ -469,7 +469,7 @@ describe('TabBar', () => { expect(screen.queryByTestId('session-activity-badge')).not.toBeInTheDocument() }) - it('shows the activity button when team activity arrives after initial render', async () => { + it('shows the activity button without a badge when team activity arrives after initial render', async () => { const { TabBar } = await import('./TabBar') const { useTabStore } = await import('../../stores/tabStore') const { useChatStore } = await import('../../stores/chatStore') @@ -511,7 +511,7 @@ describe('TabBar', () => { }) expect(screen.getByRole('button', { name: /activity/i })).toBeInTheDocument() - expect(screen.getByTestId('session-activity-badge')).toHaveTextContent('1') + expect(screen.queryByTestId('session-activity-badge')).not.toBeInTheDocument() }) it('does not show the activity button for settings tabs', async () => { @@ -530,7 +530,7 @@ describe('TabBar', () => { expect(screen.queryByRole('button', { name: /activity/i })).not.toBeInTheDocument() }) - it('includes current-session CLI tasks in the activity badge', async () => { + it('shows current-session CLI tasks without a numeric activity badge', async () => { const { TabBar } = await import('./TabBar') const { useTabStore } = await import('../../stores/tabStore') const { useChatStore } = await import('../../stores/chatStore') @@ -580,10 +580,10 @@ describe('TabBar', () => { render() }) - expect(screen.getByTestId('session-activity-badge')).toHaveTextContent('2') + expect(screen.queryByTestId('session-activity-badge')).not.toBeInTheDocument() }) - it('excludes dismissed failed background tasks from the activity badge while keeping running tasks', async () => { + it('keeps running activity available without showing a numeric badge', async () => { const { TabBar } = await import('./TabBar') const { useTabStore } = await import('../../stores/tabStore') const { useChatStore } = await import('../../stores/chatStore') @@ -636,7 +636,7 @@ describe('TabBar', () => { render() }) - expect(screen.getByTestId('session-activity-badge')).toHaveTextContent('1') + expect(screen.queryByTestId('session-activity-badge')).not.toBeInTheDocument() }) it('ignores CLI tasks from a different session in the activity badge', async () => { diff --git a/desktop/src/components/layout/TabBar.tsx b/desktop/src/components/layout/TabBar.tsx index 442d160d..83c10d6d 100644 --- a/desktop/src/components/layout/TabBar.tsx +++ b/desktop/src/components/layout/TabBar.tsx @@ -122,7 +122,7 @@ export function TabBar() { })) const activityState = useChatStore(useShallow((state) => { if (!activeTabId || !isActiveSessionTab) { - return { badgeCount: 0, hasVisibleActivity: false } + return { hasVisibleActivity: false } } const sessionState = state.sessions[activeTabId] const includeCliTasks = cliTasksSessionId === activeTabId @@ -138,12 +138,10 @@ export function TabBar() { teamMembers: activityTeamMembers, }) return { - badgeCount: model.badgeCount, hasVisibleActivity: hasVisibleSessionActivity(model), } })) const showActivityButton = activeTabId && activityState.hasVisibleActivity - const activityBadgeCount = activityState.badgeCount const moveTab = useTabStore((s) => s.moveTab) const scrollRef = useRef(null) @@ -435,7 +433,7 @@ export function TabBar() {
{showActivityButton && activeTabId && ( - + )} {isDesktopRuntime && isActiveSessionTab && (