Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
fix(menubar): 精简单行任务摘要并沿用灵动岛排序
Dash50b5c5b280b6
diff --git a/apps/desktop/native/menubar/macos-menubar-helper.swift b/apps/desktop/native/menubar/macos-menubar-helper.swiftindex 73aac9dcf8..7c755bebdf 100644--- a/apps/desktop/native/menubar/macos-menubar-helper.swift+++ b/apps/desktop/native/menubar/macos-menubar-helper.swift@@ -2508,7 +2508,7 @@ struct ActivityRow: View {: activity.preview).font(.system(size: 11.5)).foregroundStyle(Palette.ink2)- .lineLimit(2)+ .lineLimit(1).frame(maxWidth: .infinity, alignment: .leading)}}@@ -2519,7 +2519,6 @@ struct ActivityRow: View {}.buttonStyle(.plain).onHover { hovering = $0 }- .help(activity.title + "\n" + activity.status + "\n" + activity.preview)}private func timeLabel(now: Date) -> String {diff --git a/apps/desktop/src/main/agent-island/__tests__/state.test.ts b/apps/desktop/src/main/agent-island/__tests__/state.test.tsindex a008d949d2..966f422179 100644--- a/apps/desktop/src/main/agent-island/__tests__/state.test.ts+++ b/apps/desktop/src/main/agent-island/__tests__/state.test.ts@@ -2,6 +2,7 @@ import { describe, expect, it } from 'vitest';import type { AgentEvent, InteractionRequest } from '@cindy/maker-core';import { DEFAULT_TOOL_ROW_WORDING } from '@cindy/maker-shared/message-presentation';import { DEFAULT_AGENT_ISLAND_STRINGS } from '../../../shared/agentIsland.js';+import { buildMenubarActivities } from '../../menubar/activity.js';import {acknowledgeAgentIslandSessionRead,@@ -39,6 +40,35 @@ import {type AgentIslandCompanionChatProjection,} from '../state.js';+// Unit regression: the menu re-sorted the island overview on every output event.+// Existing island ordering tests did not exercise the menu adapter. Two running+// tasks with an older task emitting newer output are the minimal failure input.+describe('menu bar task ordering', () => {+ it('updates previews without reordering output, but promotes new prompts and waiting tasks', () => {+ const state = createAgentIslandState();+ const a = { sessionId: 'a', title: 'A' };+ const b = { sessionId: 'b', title: 'B' };+ const rows = (now: number) => buildMenubarActivities(+ buildAgentIslandTaskOverview(state, now), false, key => key,+ );+ applyAgentIslandUserPrompt(state, a, 'First task', 1_000);+ applyAgentIslandUserPrompt(state, b, 'Second task', 2_000);+ expect(rows(3_000).map(row => row.sessionId)).toEqual(['b', 'a']);++ applyAgentIslandEvent(state, a, { type: 'text', data: { text: 'Progress from A' } }, 10_000);+ const updated = rows(10_001);+ expect(updated.map(row => row.sessionId)).toEqual(['b', 'a']);+ expect(updated.find(row => row.sessionId === 'a')?.preview).toBe('Progress from A');++ applyAgentIslandUserPrompt(state, a, 'Continue A', 20_000);+ expect(rows(20_001).map(row => row.sessionId)).toEqual(['a', 'b']);+ applyAgentIslandInteractionRequest(state, b, {+ kind: 'ask_user_question', requestId: 'question', questions: [],+ }, 21_000);+ expect(rows(21_001).map(row => row.sessionId)).toEqual(['b', 'a']);+ });+});+// Regression: a chat can be unread after runtime expiry/restart; existing tests only supplied// runtime events. Exercise the public display builder with one old unread chat (unit tier).describe('companion chat unread projection', () => {diff --git a/apps/desktop/src/main/menubar/activity.ts b/apps/desktop/src/main/menubar/activity.tsindex 5b220f3570..6d69973112 100644--- a/apps/desktop/src/main/menubar/activity.ts+++ b/apps/desktop/src/main/menubar/activity.ts@@ -4,56 +4,49 @@ import type { MenubarActivity } from '../../shared/menubarQuota.js';import { MENUBAR_HARNESS_LOGOS } from './logos.js';import type { MenubarTranslate } from './snapshot.js';-/** Keep the island's exact candidate/attention semantics; only adapt presentation. */+/** Preserve the island's candidate order and attention; output updates must not reorder tasks. */export function buildMenubarActivities(sessions: readonly AgentIslandSessionSnapshot[],privacy: boolean,t: MenubarTranslate,): MenubarActivity[] {- return sessions- .map((session): MenubarActivity => {- const companion = session.companion;- const harness =- session.agentKind === 'codex' ? 'codex' : session.agentKind === 'pi' ? 'pi' : 'claude-code';- const status = t(- `ui.activity${- {- running: 'Running',- 'needs-interaction': 'Waiting',- completed: 'Completed',- error: 'Error',- }[session.phase]- }`,- );- return {- sessionId: session.sessionId,- title: privacy- ? t(companion ? 'ui.privateCompanion' : 'tasks.private', {- harness: t(`harness.${harness}`),- })- : companion- ? [companion.groupName, companion.name].filter(Boolean).join(' · ')- : isDefaultDraftSessionTitle(session.title) || !session.title.trim()- ? t('ui.untitledTask')- : session.title,- logoSvg: MENUBAR_HARNESS_LOGOS[harness],- companion: !!companion,- attention: session.attention,- phase: session.phase,- preview: privacy- ? status- : (session.messagePreview?.text || session.compactDetail || session.detail || status)- .replace(/\s+/g, ' ')- .slice(0, 240),- status,- startedAtMs: session.phase === 'running' ? session.startedAt : null,- lastActivityAtMs: session.lastActivityAt,- };- })- .sort(- (a, b) =>- Number(b.phase === 'needs-interaction') - Number(a.phase === 'needs-interaction') ||- b.lastActivityAtMs - a.lastActivityAtMs ||- a.sessionId.localeCompare(b.sessionId),+ return sessions.map((session): MenubarActivity => {+ const companion = session.companion;+ const harness =+ session.agentKind === 'codex' ? 'codex' : session.agentKind === 'pi' ? 'pi' : 'claude-code';+ const status = t(+ `ui.activity${+ {+ running: 'Running',+ 'needs-interaction': 'Waiting',+ completed: 'Completed',+ error: 'Error',+ }[session.phase]+ }`,);+ return {+ sessionId: session.sessionId,+ title: privacy+ ? t(companion ? 'ui.privateCompanion' : 'tasks.private', {+ harness: t(`harness.${harness}`),+ })+ : companion+ ? [companion.groupName, companion.name].filter(Boolean).join(' · ')+ : isDefaultDraftSessionTitle(session.title) || !session.title.trim()+ ? t('ui.untitledTask')+ : session.title,+ logoSvg: MENUBAR_HARNESS_LOGOS[harness],+ companion: !!companion,+ attention: session.attention,+ phase: session.phase,+ preview: privacy+ ? status+ : (session.messagePreview?.text || session.compactDetail || session.detail || status)+ .replace(/\s+/g, ' ')+ .slice(0, 240),+ status,+ startedAtMs: session.phase === 'running' ? session.startedAt : null,+ lastActivityAtMs: session.lastActivityAt,+ };+ });}diff --git a/docs/design-rules/DESIGN.md b/docs/design-rules/DESIGN.mdindex d1f2dcbf86..264c7820f2 100644--- a/docs/design-rules/DESIGN.md+++ b/docs/design-rules/DESIGN.md@@ -623,7 +623,7 @@ Icon refinement reference (2026-10-18, macOS AppKit rendering; enlarged and actu- The usage page (owner-approved redesign, 2026-10-12) shares the panel width and slides in like a detail page instead of widening into a dashboard. Top to bottom it shows: back, title and a 7/30/90-day switch; one total with two caption lines (period, scope and value basis; daily average, paid and tokens); a 100pt stacked chart labeled only with its first day and Today, where hovering a day swaps the total for that day's amount and harness split; a thin harness bar with share and amount per harness; the top five models or today's tasks; and the value note. There is no amount/tokens switch and no scope switch: the scope follows Settings, and the caption names it.- Every row must fit in the longest supported language. A segmented control is used only where all its labels fit on one row in every language. The four menu bar text options are a two-column chip grid. Other controls fall back instead of overflowing: the usage-scope picker moves under its title. Screenshots for review cover English, Simplified and Traditional Chinese, Japanese and Korean, in Light and Dark.- Keep the main panel's original order: model quota first, tasks second, then the usage chart (owner correction, 2026-10-26). The task section uses three quiet text tabs: Unread, In progress and Today's usage. These are deliberately frameless, with no filled segment track; ink emphasis and a short underline identify selection. Each keeps a 28pt hit height and native keyboard/selected accessibility. Opening with attention selects Unread; otherwise it restores the last manually selected non-unread tab for this helper lifetime. Before any manual choice, prefer In progress when work exists, otherwise Today's usage. Updates never switch an already-open panel, including when the last unread item clears. Opening or switching tabs never acknowledges messages.-- Unread and In progress reuse the island's full candidate projection before current-card clipping, including remote tasks and restored companion chats. Unread counts the exact attention candidates; In progress includes running and waiting-for-input tasks. Waiting items come first, then newest activity. Rows show identity, message/status preview and time; privacy mode masks both identity and preview. Clicking uses the island's existing device-aware navigation and read acknowledgement. Two rows on short screens, otherwise three, with an in-place All tasks / Collapse action; usage keeps its existing money ranking and usage-page link.+- Unread and In progress reuse the island's full candidate projection before current-card clipping, including remote tasks and restored companion chats. Unread counts the exact attention candidates; In progress includes running and waiting-for-input tasks. Preserve the island's candidate order: waiting items come first in In progress, then the latest user/scheduler prompt; agent output and tool progress never reorder running rows (owner correction, 2026-10-27). Rows show identity, a single-line message/status preview with tail truncation, and time; no full-content hover tooltip (owner correction, 2026-10-27). Privacy mode masks both identity and preview. Clicking uses the island's existing device-aware navigation and read acknowledgement. Two rows on short screens, otherwise three, with an in-place All tasks / Collapse action; usage keeps its existing money ranking and usage-page link.### Desktop chat and operation authorization (DS-9, 2026-09-11)