Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

feat(mobile): allow hiding collapsed teammate avatars to save home space

fmfsaisai9d865a6aa6f5
diff --git a/apps/mobile/src/__tests__/HomeTeammatesSection.test.tsx b/apps/mobile/src/__tests__/HomeTeammatesSection.test.tsx
index f1ac3fe1f3..2c3bab37bf 100644
--- a/apps/mobile/src/__tests__/HomeTeammatesSection.test.tsx
+++ b/apps/mobile/src/__tests__/HomeTeammatesSection.test.tsx
@@ -4,7 +4,7 @@ import { createRoot, type Root } from 'react-dom/client';
import { afterEach, beforeEach, expect, it, vi } from 'vitest';
const h = vi.hoisted(() => ({ cloudRefresh: vi.fn(async () => {}), cloudError: null as string | null, push: vi.fn(),
openTeammate: vi.fn(async (_row: unknown) => {}),
- cloudActor: null as null | { id: string }, createOptions: null as any, collapsed: false, unread: false,
+ cloudActor: null as null | { id: string }, createOptions: null as any, collapsed: false, showAvatars: false, unread: false,
cacheRevision: 0, cacheListeners: new Set<() => void>(), unreadIds: new Set<string>(),
stripRenders: [] as string[], avatarRenders: [] as string[], identityReads: 0 }));
vi.mock('react-native', () => ({
@@ -58,12 +58,14 @@ vi.mock('@/session/TeammateCreateController', () => ({ useTeammateCreateControll
return { renderTrigger: (trigger: unknown) => trigger, press: () => {}, label: 'create', sheets: null };
} }));
vi.mock('@/session/TeammateList', () => ({
- useTeammateEntries: (items: any[], groups: any[] = []) => [...items.map(row => ({ kind: 'bot', row })), ...groups.map(row => ({ kind: 'group', row }))],
+ useAwaitingSessions: () => new Set(),
+ teammateAttention: (row: any) => ({ attention: row.item.display.status?.tone === 'warning' ? 'Needs attention' : '', waiting: false }),
+ useTeammateEntries: (items: any[], groups: any[] = [], query = '') => [...items.map(row => ({ kind: 'bot', row })), ...groups.map(row => ({ kind: 'group', row }))].filter(entry => entry.row.item.display.title.includes(query)),
useTeammateRowRenderer: (options: any) => (entry: any) => el('button', { key: entry.row.key,
'data-testid': `row.${entry.kind}`, onClick: () => entry.kind === 'bot' ? options.onSelect(entry.row) : options.groups.onSelect(entry.row) }, entry.row.item.display.title),
}));
vi.mock('@/session/useTeammateNavigation', () => ({ useTeammateNavigation: () => ({
- owner: 'owner', teammatesCollapsed: h.collapsed, lastTeammate: null,
+ owner: 'owner', teammatesCollapsed: h.collapsed, showCollapsedTeammateAvatars: h.showAvatars, lastTeammate: null,
setTeammatesCollapsed: async () => {}, openTeammate: h.openTeammate, openCreatedTeammate: async () => {} }) }));
import { HomeTeammatesSection } from '../session/HomeTeammatesSection';
import { getHomeViewSession } from '../session/homeViewSession';
@@ -75,7 +77,7 @@ const roster = { items: [item], createTargets: [], groupTargets: [], loading: fa
isOnline: () => true, connectionState: undefined, refresh: vi.fn(async () => {}) };
const groups = { items: [] as any[], supported: true, refreshing: false, error: null, isOnline: () => true, refresh: vi.fn(async () => {}) };
let root: Root; let node: HTMLDivElement;
-beforeEach(() => { Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true }); node = document.createElement('div'); root = createRoot(node); vi.clearAllMocks(); h.cloudActor = null; vi.useFakeTimers(); roster.error = 'LIST_FAILED'; h.collapsed = false; h.unread = false; groups.items = [];
+beforeEach(() => { Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true }); node = document.createElement('div'); root = createRoot(node); vi.clearAllMocks(); h.cloudActor = null; vi.useFakeTimers(); roster.error = 'LIST_FAILED'; h.collapsed = false; h.showAvatars = false; h.unread = false; groups.items = [];
h.cacheRevision = 0; h.unreadIds.clear(); h.stripRenders = []; h.avatarRenders = []; h.identityReads = 0;
h.cloudError = null; getHomeViewSession().write('teammatesShowAll', false);
});
@@ -129,7 +131,7 @@ it('re-reads cloud companions on each manual home refresh', async () => {
// The new collapsed home must retain the chat receipt semantics of expanded rows:
// a thread can be unread after main is read, while a server-read room stays quiet.
it('uses server read receipts and thread unread state in the collapsed group strip', async () => {
- h.collapsed = true;
+ h.collapsed = true; h.showAvatars = true;
const group = { ...item, key: 'host:group', chatUnread: { count: 1, threadCount: 1 },
item: { ...item.item, ref: { collectionId: 'bot-groups', kind: 'bot-group', id: 'group' }, display: { title: 'Team' } } };
groups.items = [group];
@@ -171,7 +173,7 @@ it.each(['cloud', 'group', 'created-group'] as const)('defers the %s route until
// One bot plus one unrelated notification is the minimal trigger; 50 x 10
// exercises the representative repeated-refresh load without a timing assertion.
it('keeps a 50-companion strip quiet through ten refreshes and updates only the affected cell', async () => {
- h.collapsed = true;
+ h.collapsed = true; h.showAvatars = true;
const items = Array.from({ length: 50 }, (_, index) => ({ ...item, key: `host:bot${index}`,
item: { ...item.item, ref: { ...item.item.ref, id: `bot${index}` }, display: { title: `Bot ${index}`, avatar: undefined as any } } }));
const show = (rows: typeof items) => render(0, { context: {
@@ -233,3 +235,62 @@ it('retries a cloud roster failure without restarting healthy computer or group
expect(h.cloudRefresh).toHaveBeenCalledTimes(1);
expect(roster.refresh).not.toHaveBeenCalled(); expect(groups.refresh).not.toHaveBeenCalled();
});
+
+// Unit: the approved space-saving default must hide the entire body, including an empty create row.
+// Existing strip coverage requires the explicit opt-in and never covered header-only/search transitions.
+it('keeps only the header by default, restores the strip on opt-in, and never changes the fold when the setting changes', async () => {
+ h.collapsed = true;
+ await render(0);
+ expect(byId('home.teammatesHeader')).not.toBeNull();
+ expect(byId('home.teammatesStrip')).toBeNull();
+ expect(byId('row.bot')).toBeNull();
+ h.showAvatars = true; await render(0);
+ expect(byId('home.teammatesStrip')).not.toBeNull();
+ await act(async () => byId('home.teammatesHeader')!.click());
+ h.showAvatars = false; await render(0);
+ expect(byId('row.bot')).not.toBeNull();
+ await act(async () => byId('home.teammatesHeader')!.click());
+ expect(byId('row.bot')).toBeNull();
+ expect(byId('home.teammatesStrip')).toBeNull();
+ await render(0, { query: 'Mimi' });
+ expect(byId('row.bot')).not.toBeNull();
+ await render(0, { query: 'no match' });
+ expect(byId('home.teammates')).toBeNull();
+ await render(0);
+ expect(byId('row.bot')).toBeNull();
+ expect(byId('home.teammatesStrip')).toBeNull();
+});
+it('keeps the compact create action without an empty body when collapsed', async () => {
+ h.collapsed = true;
+ await render(0, { context: { navigation: null, route: null, shared: {
+ roster: { ...roster, items: [], createTargets: [item.host] }, groups,
+ } } } as any);
+ expect(byId('home.teammatesCreate')).not.toBeNull();
+ expect(byId('home.teammatesAdd')).toBeNull();
+ expect(byId('home.teammatesStripCreate')).toBeNull();
+ await act(async () => byId('home.teammatesHeader')!.click());
+ expect(byId('home.teammatesAdd')).not.toBeNull();
+});
+it('carries unread and pending attention on the hidden header without opening it or changing read receipts', async () => {
+ h.collapsed = true;
+ const group = { ...item, key: 'host:group', chatUnread: { count: 1, threadCount: 1 },
+ item: { ...item.item, ref: { collectionId: 'bot-groups', kind: 'bot-group', id: 'group' }, display: { title: 'Team' } } };
+ groups.items = [group];
+ await render(0);
+ expect(byId('home.teammatesAttention')).not.toBeNull();
+ expect(byId('home.teammatesHeader')?.getAttribute('aria-label')).toContain('devices.companions.unread');
+ group.chatUnread = { count: 0, threadCount: 0 };
+ await render(0);
+ expect(byId('home.teammatesAttention')).toBeNull();
+ await act(async () => { h.unreadIds.add('bot'); h.cacheListeners.forEach(listener => listener()); });
+ expect(byId('home.teammatesAttention')).not.toBeNull();
+ expect(byId('home.teammatesStrip')).toBeNull();
+ expect(byId('row.bot')).toBeNull();
+ await act(async () => { h.unreadIds.clear(); h.cacheListeners.forEach(listener => listener()); });
+ expect(byId('home.teammatesAttention')).toBeNull();
+ await render(0, { context: { navigation: null, route: null, shared: {
+ roster: { ...roster, items: [{ ...item, item: { ...item.item, display: { title: 'Mimi', status: { tone: 'warning', label: 'Needs attention' } } } }] }, groups,
+ } } } as any);
+ expect(byId('home.teammatesAttention')).not.toBeNull();
+ expect(byId('home.teammatesStrip')).toBeNull();
+});
diff --git a/apps/mobile/src/__tests__/homeChromeMenus.test.ts b/apps/mobile/src/__tests__/homeChromeMenus.test.ts
index 9bb92fe1da..c9b78f86d5 100644
--- a/apps/mobile/src/__tests__/homeChromeMenus.test.ts
+++ b/apps/mobile/src/__tests__/homeChromeMenus.test.ts
@@ -141,6 +141,7 @@ describe("home chrome menus", () => {
"filter",
"view",
"taskInfo",
+ "teammates",
]);
expect(find(actions, "group")?.subtitle).toBe("devices.list.menu.groupProject");
expect(find(actions, "sort")?.subtitle).toBe("devices.list.menu.sortBy.recency");
@@ -268,4 +269,14 @@ describe("home chrome menus", () => {
expect(homeDisplayActionPatch("sort.bogus", displayState)).toBeNull();
expect(homeDisplayActionPatch("group", displayState)).toBeNull();
});
+ // Unit: the appearance submenu is distinct from filtering teammate-created tasks.
+ // Existing menu tests did not cover this independently checked, default-off action.
+ it('places avatar opt-in in a normal Teammates appearance submenu', () => {
+ const menu = build().find(action => action.id === 'appearance')!;
+ const submenu = menu.subactions!.find(action => action.id === 'teammates')!;
+ expect(submenu.subactions).toEqual([{ id: 'teammates.showCollapsedAvatars', title: 'devices.list.menu.showCollapsedTeammateAvatars', state: 'off' }]);
+ expect(homeDisplayActionPatch('teammates.showCollapsedAvatars', displayState)).toEqual({ showCollapsedTeammateAvatars: true });
+ expect(homeDisplayActionPatch('teammates.showCollapsedAvatars', { ...displayState, showCollapsedTeammateAvatars: true })).toEqual({ showCollapsedTeammateAvatars: false });
+ });
+
});
diff --git a/apps/mobile/src/__tests__/homeChromeMenusAndroid.test.ts b/apps/mobile/src/__tests__/homeChromeMenusAndroid.test.ts
index a98aa30a52..1d4ecd2fcc 100644
--- a/apps/mobile/src/__tests__/homeChromeMenusAndroid.test.ts
+++ b/apps/mobile/src/__tests__/homeChromeMenusAndroid.test.ts
@@ -104,6 +104,7 @@ describe("Android home chrome menus follow the iOS pull-down", () => {
["filter", "devices.list.menu.summaryNone", true],
["view", "devices.list.menu.view.list", true],
["taskInfo", "devices.list.menu.taskInfo.time", true],
+ ["teammates", "", true],
]);
const sort = resolvePullDownSubmenu(actions, ["sort"]);
expect(sort?.subactions?.map((action) => [action.id, action.state])).toEqual([
diff --git a/apps/mobile/src/__tests__/teammateNavigation.test.ts b/apps/mobile/src/__tests__/teammateNavigation.test.ts
index 80f426970a..46a477024d 100644
--- a/apps/mobile/src/__tests__/teammateNavigation.test.ts
+++ b/apps/mobile/src/__tests__/teammateNavigation.test.ts
@@ -24,6 +24,19 @@ describe('account-scoped home navigation overrides', () => {
expect(await readHomeNavigationPreferences('account-a')).toEqual({});
expect(AsyncStorage.setItem).not.toHaveBeenCalled();
});
+ // Unit: old collapsed records are not avatar opt-ins; explicit false survives account switches.
+ // No prior test covered an independently persisted avatar setting.
+ it('keeps explicit avatar choices per account without inferring them from an old collapsed state', async () => {
+ await saveHomeNavigationPreferences('account-a', { teammatesCollapsed: true });
+ expect((await readHomeNavigationPreferences('account-a')).showCollapsedTeammateAvatars).toBeUndefined();
+ await Promise.all([
+ saveHomeNavigationPreferences('account-a', { showCollapsedTeammateAvatars: true }),
+ saveHomeNavigationPreferences('account-b', { showCollapsedTeammateAvatars: false }),
+ ]);
+ expect(await readHomeNavigationPreferences('account-a')).toEqual({ teammatesCollapsed: true, showCollapsedTeammateAvatars: true });
+ expect(await readHomeNavigationPreferences('account-b')).toEqual({ showCollapsedTeammateAvatars: false });
+ expect(await readHomeNavigationPreferences('account-c')).toEqual({});
+ });
it('serializes overlapping patches and isolates accounts even when resource ids match', async () => {
await Promise.all([
saveHomeNavigationPreferences('account-a', { lastTeammate: teammateIdentity(row()) }),
diff --git a/apps/mobile/src/__tests__/useTeammateNavigation.test.tsx b/apps/mobile/src/__tests__/useTeammateNavigation.test.tsx
index e6979da9dc..504e943e51 100644
--- a/apps/mobile/src/__tests__/useTeammateNavigation.test.tsx
+++ b/apps/mobile/src/__tests__/useTeammateNavigation.test.tsx
@@ -50,6 +50,25 @@ describe('header/home shared navigation', () => {
routeAfterClose?.();
expect(h.push).toHaveBeenCalledExactlyOnceWith(expect.objectContaining({ pathname: '/resources/[collectionId]/[resourceId]' }));
});
+ // Unit: menu and section share the account-scoped hook; remounts must retain the override,
+ // while changing it must not overwrite the independent expanded/collapsed choice.
+ it('restores avatar opt-in, keeps the fold independent, and isolates another account', async () => {
+ const originalUser = h.user;
+ await saveHomeNavigationPreferences(homeNavigationOwner(h.user), { showCollapsedTeammateAvatars: true });
+ await render();
+ expect(result.showCollapsedTeammateAvatars).toBe(true);
+ expect(result.teammatesCollapsed).toBe(false);
+ await act(async () => result.setShowCollapsedTeammateAvatars(false));
+ expect(result.teammatesCollapsed).toBe(false);
+ await act(async () => root!.unmount()); root = undefined;
+ await render(); expect(result.showCollapsedTeammateAvatars).toBe(false);
+ await act(async () => result.setShowCollapsedTeammateAvatars(true));
+ h.user = { ...h.user, id: 'avatar-other-account' }; await render();
+ expect(result.showCollapsedTeammateAvatars).toBe(false);
+ h.user = originalUser; await render();
+ expect(result.showCollapsedTeammateAvatars).toBe(true);
+ expect(await readHomeNavigationPreferences(result.owner)).toEqual({ showCollapsedTeammateAvatars: true });
+ });
it('restores the remembered teammate and section fold, and returning home keeps them', async () => {
const owner = homeNavigationOwner(h.user);
await saveHomeNavigationPreferences(owner, { teammatesCollapsed: true, lastTeammate: teammateIdentity(teammate) });
diff --git a/apps/mobile/src/i18n/locales/en/devices.json b/apps/mobile/src/i18n/locales/en/devices.json
index 51f524f98d..a2c9309e9e 100644
--- a/apps/mobile/src/i18n/locales/en/devices.json
+++ b/apps/mobile/src/i18n/locales/en/devices.json
@@ -403,6 +403,7 @@
"30d": "30d",
"all": "All"
},
+ "showCollapsedTeammateAvatars": "Show avatars when collapsed",
"displayHeading": "Display",
"view": {
"text": "Text",
diff --git a/apps/mobile/src/i18n/locales/ja/devices.json b/apps/mobile/src/i18n/locales/ja/devices.json
index 04929387a5..7c90fdf761 100644
--- a/apps/mobile/src/i18n/locales/ja/devices.json
+++ b/apps/mobile/src/i18n/locales/ja/devices.json
@@ -403,6 +403,7 @@
"30d": "30日",
"all": "すべて"
},
+ "showCollapsedTeammateAvatars": "折りたたみ時にアバターを表示",
"displayHeading": "表示",
"view": {
"text": "テキスト",
diff --git a/apps/mobile/src/i18n/locales/ko/devices.json b/apps/mobile/src/i18n/locales/ko/devices.json
index 4207debef2..1594c5556a 100644
--- a/apps/mobile/src/i18n/locales/ko/devices.json
+++ b/apps/mobile/src/i18n/locales/ko/devices.json
@@ -403,6 +403,7 @@
"30d": "30일",
"all": "전체"
},
+ "showCollapsedTeammateAvatars": "접었을 때 아바타 표시",
"displayHeading": "표시",
"view": {
"text": "텍스트",
diff --git a/apps/mobile/src/i18n/locales/zh-CN/devices.json b/apps/mobile/src/i18n/locales/zh-CN/devices.json
index cd2c23a34f..953c6dbea7 100644
--- a/apps/mobile/src/i18n/locales/zh-CN/devices.json
+++ b/apps/mobile/src/i18n/locales/zh-CN/devices.json
@@ -403,6 +403,7 @@
"30d": "30 天",
"all": "全部"
},
+ "showCollapsedTeammateAvatars": "收起时显示头像",
"displayHeading": "显示",
"view": {
"text": "文字",
diff --git a/apps/mobile/src/i18n/locales/zh-TW/devices.json b/apps/mobile/src/i18n/locales/zh-TW/devices.json
index 2908e77f42..d764e4ed9d 100644
--- a/apps/mobile/src/i18n/locales/zh-TW/devices.json
+++ b/apps/mobile/src/i18n/locales/zh-TW/devices.json
@@ -403,6 +403,7 @@
"30d": "30 天",
"all": "全部"
},
+ "showCollapsedTeammateAvatars": "收起時顯示頭像",
"displayHeading": "顯示",
"view": {
"text": "文字",
diff --git a/apps/mobile/src/session/HomeSurface.tsx b/apps/mobile/src/session/HomeSurface.tsx
index 0b36758db6..28b2a741df 100644
--- a/apps/mobile/src/session/HomeSurface.tsx
+++ b/apps/mobile/src/session/HomeSurface.tsx
@@ -243,7 +243,7 @@ import {
type HomeViewPreferencePatch,
type HomeViewPreferences,
} from '@/session/homeViewPreferenceStore';
-import { homeNavigationOwner } from '@/session/useHomeMode';
+import { homeNavigationOwner, useHomeMode } from '@/session/useHomeMode';
import {
getCachedHomeListSnapshot,
scheduleHomeListSnapshotPersist,
@@ -484,6 +484,7 @@ function HomeScreenContent({ active = true, width, newSessionInSystemBar = false
const residentList = useResidentHomeList(embedded);
// Captured here: Android draws the list above the route, outside its roster and navigation context.
const teammatesSectionContext = useHomeTeammatesSectionContext();
+ const { showCollapsedTeammateAvatars, setShowCollapsedTeammateAvatars } = useHomeMode();
// Bumped by a manual home refresh so the teammate section also re-reads its cloud companions.
const [teammatesRefreshKey, setTeammatesRefreshKey] = useState(0);
const activeHomeSession = useContext(ActiveHomeSession);
@@ -2936,13 +2937,14 @@ function HomeScreenContent({ active = true, width, newSessionInSystemBar = false
lastActivityFilter,
projectFilter,
teammateFilter: effectiveTeammateFilter,
+ showCollapsedTeammateAvatars,
projectOrder: displayedProjectOrder,
sortBy,
statusFilter,
taskInfoFields,
vendorFilter,
viewMode,
- }), [displayedProjectOrder, groupByProject, groupDialogue, lastActivityFilter, projectFilter, effectiveTeammateFilter, sortBy, statusFilter, taskInfoFields, vendorFilter, viewMode]);
+ }), [showCollapsedTeammateAvatars, displayedProjectOrder, groupByProject, groupDialogue, lastActivityFilter, projectFilter, effectiveTeammateFilter, sortBy, statusFilter, taskInfoFields, vendorFilter, viewMode]);
// 在看已归档任务时,顶栏「⋯」带提醒点(iOS 系统顶栏 / 自绘按钮两条路径共用这一个判据),
// 同时把状态写进无障碍名称,读屏用户不用打开菜单也知道列表不是平常的进行中任务。
const archivedReminder = statusFilter === 'archived';
@@ -2968,8 +2970,11 @@ function HomeScreenContent({ active = true, width, newSessionInSystemBar = false
);
const handleDisplayAction = useCallback((id: string) => {
const patch = homeDisplayActionPatch(id, displayMenuState);
- if (patch) applyDisplayView(patch);
- }, [applyDisplayView, displayMenuState]);
+ if (!patch) return;
+ if (patch.showCollapsedTeammateAvatars !== undefined) {
+ void setShowCollapsedTeammateAvatars(patch.showCollapsedTeammateAvatars);
+ } else applyDisplayView(patch);
+ }, [applyDisplayView, displayMenuState, setShowCollapsedTeammateAvatars]);
// iOS 系统顶栏的菜单项是顶栏选项的一部分,任何变化都会重建顶栏并关掉展开中的菜单。
// 菜单内容按结构比较、回调走 ref 保持同一引用:后台同步刷新任务列表时,菜单没实质变化
// 就不重建顶栏;只有用户自己的勾选会更新它。
diff --git a/apps/mobile/src/session/HomeTeammatesSection.tsx b/apps/mobile/src/session/HomeTeammatesSection.tsx
index 070c5b2db1..dd5ab1d8fa 100644
--- a/apps/mobile/src/session/HomeTeammatesSection.tsx
+++ b/apps/mobile/src/session/HomeTeammatesSection.tsx
@@ -1,7 +1,7 @@
/**
* 任务首页顶部的「伙伴」段(对照桌面 TeammatesSection.tsx 与 2026-10-24 手机「A+B 合一」定稿):
* 展开 = 伙伴行(CompanionListRow,默认 3 位,多了「显示全部」);
- * 收起 = 段头 + 56pt 头像条(名字 12/18,可横滑,最后一格新建)。收起状态按账号记住。
+ * 收起 = 段头;用户开启「收起时显示头像」后显示原有头像条。两个选择分别按账号记住。
* 伙伴与群聊按最近活动混排;不跟随顶栏的电脑范围筛选(与桌面一致)。手机没有单独的伙伴首页,
* 搜索时本段只列出名字匹配的伙伴与群聊。只在首页(有共享伙伴名册)出现;没有伙伴也没有能新建的
* 电脑时整段不显示。
@@ -37,7 +37,7 @@ import { homeListStyles } from './HomeListVisuals';
import { useHomeRoster } from './HomeRosterContext';
import { DisclosureItem } from './listDisclosureTransition';
import { useTeammateCreateController } from './TeammateCreateController';
-import { useTeammateEntries, useTeammateRowRenderer, type TeammateListEntry } from './TeammateList';
+import { useTeammateEntries, useTeammateRowRenderer, useAwaitingSessions, teammateAttention, type TeammateListEntry } from './TeammateList';
import { cloudCompanionRoute } from './teammateNavigation';
import { useTeammateNavigation } from './useTeammateNavigation';
import { getHomeViewSession, useRetainedHomeState } from './homeViewSession';
@@ -128,6 +128,8 @@ function SectionContent({ shared, active, refreshKey, visible, query, showFooter
const stored = local?.owner === owner ? local.collapsed : navigation.teammatesCollapsed;
// Search results are always rows; the stored fold returns with the search cleared.
const collapsed = stored && !search;
+ const headerOnly = collapsed && !navigation.showCollapsedTeammateAvatars;
+ const { unread, attention } = useHeaderAttention(entries, headerOnly, roster.isOnline);
const [showAll, setShowAll] = useRetainedHomeState(getHomeViewSession(), 'teammatesShowAll', false);
const setTeammatesCollapsed = navigation.setTeammatesCollapsed;
const toggleCollapsed = useCallback(() => {
@@ -169,7 +171,8 @@ function SectionContent({ shared, active, refreshKey, visible, query, showFooter
const body = shown ? <DisclosureItem clip testID="home.teammates">
<View style={styles.header}>
<Pressable accessibilityRole="button" accessibilityState={{ expanded: !collapsed, disabled: !!search }} disabled={!!search}
- accessibilityLabel={t(collapsed ? 'devices.list.a11y.expand' : 'devices.list.a11y.collapse', { title })}
+ accessibilityLabel={[t(collapsed ? 'devices.list.a11y.expand' : 'devices.list.a11y.collapse', { title }),
+ unread ? t('devices.companions.unread') : '', attention].filter(Boolean).join(', ')}
onPress={toggleCollapsed} onPressIn={prepareDisclosure}
style={({ pressed }) => [list.projectRow, styles.headerToggle, pressed && mobileInteractionStyles.pressed]} testID="home.teammatesHeader">
{collapsed
@@ -177,20 +180,21 @@ function SectionContent({ shared, active, refreshKey, visible, query, showFooter
: <ChevronDown color={colors.textSecondary} size={iconSize.xl} strokeWidth={iconStroke.regular} />}
<UsersRound color={colors.textSecondary} size={iconSize.action} strokeWidth={iconStroke.thin} />
<Text style={[list.projectTitle, styles.headerTitle]} numberOfLines={1}>{title}</Text>
- {collapsed || !entries.length ? null : <Text style={[list.projectCount, styles.count]} numberOfLines={1}>{entries.length}</Text>}
+ {(collapsed && !headerOnly) || !entries.length ? null : <Text style={[list.projectCount, styles.count]} numberOfLines={1}>{entries.length}</Text>}
+ {headerOnly && (unread || attention) ? <View style={[styles.unreadDot, !!attention && styles.attentionDot]} testID="home.teammatesAttention" /> : null}
</Pressable>
{showError ? <Pressable accessibilityRole="button" accessibilityLabel={`${t(errorKey)} ${t('devices.resources.retry')}`}
disabled={retrying} onPress={retry} hitSlop={spacing.xs}
style={({ pressed }) => [styles.headerAdd, pressed && mobileInteractionStyles.pressed]} testID="home.teammatesRetry">
{retrying ? <ActivityIndicator color={colors.textTertiary} /> : <RefreshCw size={iconSize.sm} color={colors.textTertiary} strokeWidth={iconStroke.regular} />}
</Pressable> : null}
- {/* Folded, the strip's last cell is the create entry; the header keeps only one. */}
- {collapsed || !entries.length ? null : create((press, label) => <Pressable accessibilityRole="button" accessibilityLabel={label}
+ {/* Keep a single create entry: in the header when the body is hidden. */}
+ {!headerOnly && (collapsed || !entries.length) ? null : create((press, label) => <Pressable accessibilityRole="button" accessibilityLabel={label}
onPress={press} hitSlop={spacing.xs} style={({ pressed }) => [styles.headerAdd, pressed && mobileInteractionStyles.pressed]} testID="home.teammatesCreate">
<Plus color={colors.textSecondary} size={iconSize.action} strokeWidth={iconStroke.regular} />
</Pressable>)}
</View>
- {!entries.length ? <DisclosureItem exit>{create((press, label) => <Pressable accessibilityRole="button" accessibilityLabel={label} onPress={press}
+ {headerOnly ? null : !entries.length ? <DisclosureItem exit>{create((press, label) => <Pressable accessibilityRole="button" accessibilityLabel={label} onPress={press}
style={({ pressed }) => [styles.addRow, pressed && mobileInteractionStyles.pressed]} testID="home.teammatesAdd">
<View style={[styles.addCircle, styles.addCircleRow]}><Plus color={colors.textSecondary} size={iconSize.action} strokeWidth={iconStroke.regular} /></View>
<Text style={styles.addText} numberOfLines={1}>{t('devices.companions.createTeammate')}</Text>
@@ -228,6 +232,27 @@ function SectionContent({ shared, active, refreshKey, visible, query, showFooter
return <>{body}{creator.sheets}</>;
}
+/** Hidden content keeps its existing read/attention semantics without opening the section. */
+function useHeaderAttention(entries: readonly TeammateListEntry[], enabled: boolean, isOnline: (host: RemoteResourceHostTarget) => boolean) {
+ const { user } = useAuth();
+ const { t, i18n } = useTranslation();
+ const bots = useMemo(() => enabled ? entries.filter(entry => entry.kind === 'bot').map(entry => entry.row) : [], [enabled, entries]);
+ const awaiting = useAwaitingSessions(bots);
+ const readUnread = useCallback(() => enabled && entries.some(entry => {
+ const { row } = entry;
+ const mainUnread = isRemoteResourceUnread(user?.id ?? '', row.host.deviceId, row.item.ref.id,
+ row.item.display.lastReplyAt, entry.kind === 'group' ? row.lastReplySequence : undefined);
+ return entry.kind === 'group' && row.chatUnread
+ ? (mainUnread ? row.chatUnread.count : row.chatUnread.threadCount) > 0 : mainUnread;
+ }), [enabled, entries, user?.id]);
+ const unread = useSyncExternalStore(subscribeRemoteResourceCache, readUnread);
+ const attention = bots.map(row => {
+ const state = teammateAttention(row, isOnline(row.host), awaiting, i18n.language);
+ return state.attention || (state.waiting ? t('devices.companions.awaiting') : '');
+ }).find(Boolean) ?? '';
+ return { unread, attention };
+}
+
interface StripCellProps {
entry: TeammateListEntry; online: boolean; connected: boolean | null; quiet: boolean; onPress(): void;
}
@@ -340,6 +365,7 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({
// The row's 10pt unread dot in a 2pt page-colored ring (CompanionPresenceDot geometry).
unreadRing: { position: 'absolute', right: 0, bottom: 0, padding: 2, borderRadius: radius.pill, backgroundColor: colors.surface },
unreadDot: { width: COMPANION_ROW_DOT_SIZE, height: COMPANION_ROW_DOT_SIZE, borderRadius: radius.pill, backgroundColor: colors.botUnread },
+ attentionDot: { backgroundColor: colors.statusAwaiting },
addCircle: { borderRadius: radius.pill, borderWidth: 1, borderStyle: 'dashed', borderColor: colors.borderStrong, alignItems: 'center', justifyContent: 'center' },
addCircleStrip: { width: STRIP_AVATAR_SIZE, height: STRIP_AVATAR_SIZE },
addCircleRow: { width: COMPANION_ROW_AVATAR_SIZE, height: COMPANION_ROW_AVATAR_SIZE },
diff --git a/apps/mobile/src/session/TeammateList.tsx b/apps/mobile/src/session/TeammateList.tsx
index 5e380a773a..12ca7d120c 100644
--- a/apps/mobile/src/session/TeammateList.tsx
+++ b/apps/mobile/src/session/TeammateList.tsx
@@ -46,7 +46,7 @@ function conversationSessionId(row: HostedRemoteCollectionItem): string | null {
}
/** Bot conversations stopped on a question or a permission prompt (「等你确认」). */
-function useAwaitingSessions(items: readonly HostedRemoteCollectionItem[]): ReadonlySet<string> {
+export function useAwaitingSessions(items: readonly HostedRemoteCollectionItem[]): ReadonlySet<string> {
const sessions = useMemo(() => items.map(conversationSessionId).filter((id): id is string => !!id), [items]);
const snapshot = useCallback(() => sessions.filter((id) => remoteSessionStore.getSessionLiveActivity(id)?.phase === 'needs-interaction'
|| remoteSessionStore.getPendingInteractions(id).length > 0).join('\u0000'), [sessions]);
@@ -55,6 +55,16 @@ function useAwaitingSessions(items: readonly HostedRemoteCollectionItem[]): Read
return useMemo(() => new Set(key ? key.split('\u0000') : []), [key]);
}
+/** Same attention criteria for full rows and a collapsed section's header. */
+export function teammateAttention(row: HostedRemoteCollectionItem, online: boolean, awaiting: ReadonlySet<string>, language: string) {
+ const display = row.item.display;
+ const attention = display.status?.tone === 'warning' || display.status?.tone === 'critical'
+ ? resolveRemoteText(display.status.label, language) : '';
+ const sessionId = conversationSessionId(row);
+ const waiting = online && !display.generation && !!sessionId && awaiting.has(sessionId);
+ return { attention, waiting };
+}
+
export type TeammateListEntry = { kind: 'bot' | 'group'; row: HostedRemoteCollectionItem };
/** Teammates and group chats, mixed by latest activity and filtered by the same search. */
@@ -104,10 +114,7 @@ export function useTeammateRowRenderer({ items, isOnline, connectionState, quiet
const online = isOnline(row.host);
const connected = connectionState ? connectionState(row.host) : online;
const generating = online && !!display.generation;
- const attention = display.status?.tone === 'warning' || display.status?.tone === 'critical'
- ? resolveRemoteText(display.status.label, i18n.language) : '';
- const sessionId = conversationSessionId(row);
- const waiting = online && !generating && !!sessionId && awaiting.has(sessionId);
+ const { attention, waiting } = teammateAttention(row, online, awaiting, i18n.language);
const ambiguous = (duplicateNames.get(title.normalize('NFKC').toLocaleLowerCase(i18n.language)) ?? 0) > 1;
const unread = isRemoteResourceUnread(user?.id ?? '', row.host.deviceId, row.item.ref.id, display.lastReplyAt);
const timestamp = display.timestamp;
diff --git a/apps/mobile/src/session/homeChromeMenus.ts b/apps/mobile/src/session/homeChromeMenus.ts
index bae454f852..fa0159d3ae 100644
--- a/apps/mobile/src/session/homeChromeMenus.ts
+++ b/apps/mobile/src/session/homeChromeMenus.ts
@@ -134,7 +134,7 @@ export function buildHomeScopePullDownActions(
/**
* 显示菜单与桌面侧栏 SidebarFilterPopover 同结构:一级是「设置项 + 当前值」行,具体选项
- * 在子菜单里;三段依次是 分组 / 任务排序 / 项目排序,任务状态 / 筛选,显示 / 任务信息。
+ * 在子菜单里;三段依次是 分组 / 任务排序 / 项目排序,任务状态 / 筛选,显示 / 任务信息 / 伙伴。
* 当前值放在一级行的 subtitle:Cindy 自绘菜单(安卓 / 旧 iOS 包)显示在标题下方;系统
* UIMenu 的子菜单不显示 subtitle,选中项在子菜单内打勾。
*/
@@ -150,6 +150,7 @@ export interface HomeDisplayMenuState {
lastActivityFilter: HomeLastActivityFilter;
viewMode: HomeListViewMode;
taskInfoFields: readonly HomeTaskInfoField[];
+ showCollapsedTeammateAvatars?: boolean;
}
export type HomeDisplayPatch = Partial<Omit<HomeDisplayMenuState, "taskInfoFields">> & {
@@ -332,6 +333,9 @@ export function buildHomeDisplayPullDownActions(input: {
submenu("taskInfo", t(`${MENU}.taskInfoHeading`), homeTaskInfoSummary(state.taskInfoFields, t), "info.circle",
HOME_TASK_INFO_FIELDS.map((field) =>
checkable(`taskInfo.${field}`, t(`${MENU}.taskInfo.${field}`), state.taskInfoFields.includes(field), true))),
+ submenu("teammates", t("devices.companions.title"), "", "person.2", [
+ checkable("teammates.showCollapsedAvatars", t(`${MENU}.showCollapsedTeammateAvatars`), state.showCollapsedTeammateAvatars === true),
+ ]),
]),
];
}
@@ -341,6 +345,7 @@ export function homeDisplayActionPatch(
id: string,
state: HomeDisplayMenuState,
): HomeDisplayPatch | null {
+ if (id === "teammates.showCollapsedAvatars") return { showCollapsedTeammateAvatars: !state.showCollapsedTeammateAvatars };
if (id === "group.project") return { groupByProject: !state.groupByProject };
if (id === "group.dialogue") return { groupDialogue: !state.groupDialogue };
if (id === "filter.reset") return { lastActivityFilter: "all", projectFilter: "all", teammateFilter: "all", vendorFilter: "all" };
diff --git a/apps/mobile/src/session/homeViewPreferenceStore.ts b/apps/mobile/src/session/homeViewPreferenceStore.ts
index 5d37041d33..005f821ff0 100644
--- a/apps/mobile/src/session/homeViewPreferenceStore.ts
+++ b/apps/mobile/src/session/homeViewPreferenceStore.ts
@@ -257,8 +257,10 @@ export interface LastTeammateIdentity {
export interface HomeNavigationPreferences {
/** Preselects the computer when creating another teammate; launch never reopens it. */
lastTeammate?: LastTeammateIdentity;
- /** The task home's teammate section: rows (false/absent) or the avatar strip (true). */
+ /** The task home's teammate section: expanded rows or collapsed header. */
teammatesCollapsed?: boolean;
+ /** Explicit account override; absent defaults to hiding the collapsed avatar strip. */
+ showCollapsedTeammateAvatars?: boolean;
}
const NAVIGATION_PREFIX = 'cindy.mobile.home.navigation.v1.';
@@ -271,6 +273,7 @@ export function normalizeHomeNavigationPreferences(value: unknown): HomeNavigati
typeof last[field] === 'string' && last[field].trim().length > 0 && last[field].length <= 256);
// The retired tasks/teammates `mode` is dropped here, so the next write clears it.
return {
+ ...(typeof record.showCollapsedTeammateAvatars === 'boolean' ? { showCollapsedTeammateAvatars: record.showCollapsedTeammateAvatars } : {}),
...(typeof record.teammatesCollapsed === 'boolean' ? { teammatesCollapsed: record.teammatesCollapsed } : {}),
...(validLast ? { lastTeammate: {
deviceId: last!.deviceId as string,
@@ -291,7 +294,7 @@ export async function readHomeNavigationPreferences(owner: string): Promise<Home
export function saveHomeNavigationPreferences(
owner: string,
- patch: { lastTeammate?: LastTeammateIdentity | null; teammatesCollapsed?: boolean },
+ patch: { lastTeammate?: LastTeammateIdentity | null; teammatesCollapsed?: boolean; showCollapsedTeammateAvatars?: boolean },
): Promise<void> {
if (!owner) return Promise.resolve();
// Share the existing serialized writer; each operation captures its own owner.
diff --git a/apps/mobile/src/session/useHomeMode.ts b/apps/mobile/src/session/useHomeMode.ts
index e322f37ed0..780fec2c67 100644
--- a/apps/mobile/src/session/useHomeMode.ts
+++ b/apps/mobile/src/session/useHomeMode.ts
@@ -14,8 +14,9 @@ interface Snapshot {
hydrated: boolean;
lastTeammate: LastTeammateIdentity | null;
teammatesCollapsed: boolean;
+ showCollapsedTeammateAvatars: boolean;
}
-const initial: Snapshot = { hydrated: false, lastTeammate: null, teammatesCollapsed: false };
+const initial: Snapshot = { hydrated: false, lastTeammate: null, teammatesCollapsed: false, showCollapsedTeammateAvatars: false };
interface Entry { snapshot: Snapshot; revision: number; loading?: Promise<void> }
const entries = new Map<string, Entry>();
const listeners = new Set<() => void>();
@@ -37,11 +38,13 @@ function hydrate(owner: string, entry: Entry): Promise<void> {
entry.loading = read.initial.then(({ value: stored, timedOut }) => {
publish(entry, entry.revision === revision
? { hydrated: true, lastTeammate: stored.lastTeammate ?? null,
- teammatesCollapsed: stored.teammatesCollapsed ?? false }
+ teammatesCollapsed: stored.teammatesCollapsed ?? false,
+ showCollapsedTeammateAvatars: stored.showCollapsedTeammateAvatars ?? false }
: { hydrated: true });
if (timedOut) void read.completion.then((result) => {
// Late values only fill in what the user has not changed since the timeout.
if (result.ok && entry.revision === revision) publish(entry, {
+ showCollapsedTeammateAvatars: result.value.showCollapsedTeammateAvatars ?? false,
lastTeammate: result.value.lastTeammate ?? null, teammatesCollapsed: result.value.teammatesCollapsed ?? false,
});
});
@@ -56,7 +59,7 @@ export function useHomeMode() {
const entry = entryFor(owner);
const snapshot = useSyncExternalStore(subscribe, () => entry.snapshot, () => initial);
useEffect(() => { if (owner) void hydrate(owner, entry); }, [entry, owner]);
- const update = useCallback((patch: { lastTeammate?: LastTeammateIdentity | null; teammatesCollapsed?: boolean }) => {
+ const update = useCallback((patch: { lastTeammate?: LastTeammateIdentity | null; teammatesCollapsed?: boolean; showCollapsedTeammateAvatars?: boolean }) => {
if (!owner) return Promise.resolve();
// Hydrate first so one write cannot erase the other, not yet read, preference.
return hydrate(owner, entry).then(() => {
@@ -69,7 +72,8 @@ export function useHomeMode() {
}, [entry, owner]);
const selectTeammate = useCallback((identity: LastTeammateIdentity) => update({ lastTeammate: identity }), [update]);
const setTeammatesCollapsed = useCallback((teammatesCollapsed: boolean) => update({ teammatesCollapsed }), [update]);
- return { ...snapshot, owner, selectTeammate, setTeammatesCollapsed };
+ const setShowCollapsedTeammateAvatars = useCallback((showCollapsedTeammateAvatars: boolean) => update({ showCollapsedTeammateAvatars }), [update]);
+ return { ...snapshot, owner, selectTeammate, setTeammatesCollapsed, setShowCollapsedTeammateAvatars };
}
/** Hold the startup splash until the home's teammate section knows its stored collapse state. */
diff --git a/docs/design-rules/DESIGN.md b/docs/design-rules/DESIGN.md
index 6521bc2747..00b06fdad4 100644
--- a/docs/design-rules/DESIGN.md
+++ b/docs/design-rules/DESIGN.md
@@ -775,9 +775,9 @@ without clearing the list or splitting Cindy by computer.
### Mobile task home teammate section (owner-approved “A+B”, 2026-10-24)
-The task home opens with a “Teammates” section above shared tasks, Pinned and projects. Its header uses the project/Pinned header geometry (56pt, 22 chevron + 20 icon + 16/28 title + 13 count) and a trailing 20pt “+” whose 44pt target ends on the 16pt right edge. Expanded, it shows 78pt teammate rows (teammates and groups mixed by activity), previewing three; the “Show all N” / “Show less” row is 48pt, 15/20 secondary text aligned to the rows’ text column (72pt). Collapsed, it becomes a horizontally scrolling strip: 56pt avatars in 64pt cells, 8pt gap, 16pt side insets, 12/18 names (primary + medium when unread), the row’s 10pt unread dot in a 2pt surface ring, the presence ring while replying, and a dashed 56pt create cell last. Phones scroll instead of the Desktop +N. Both states swap with the list’s 225ms disclosure; reduced motion switches instantly. Every language must fit the header and names without widening; long names truncate to one line within the cell.
+The task home opens with a “Teammates” section above shared tasks, Pinned and projects. Its header uses the project/Pinned header geometry (56pt, 22 chevron + 20 icon + 16/28 title + 13 count) and a trailing 20pt “+” whose 44pt target ends on the 16pt right edge. Expanded, it shows 78pt teammate rows (teammates and groups mixed by activity), previewing three; the “Show all N” / “Show less” row is 48pt, 15/20 secondary text aligned to the rows’ text column (72pt). Collapsed, it keeps only the 56pt header and its small create action by default, with no empty body. The existing home display menu (···) adds an ordinary “Teammates” submenu beside Display and Task Info; its “Show avatars when collapsed” check item enables the horizontally scrolling strip: 56pt avatars in 64pt cells, 8pt gap, 16pt side insets, 12/18 names (primary + medium when unread), the row’s 10pt unread dot in a 2pt surface ring, the presence ring while replying, and a dashed 56pt create cell last. Phones scroll instead of the Desktop +N. The avatar preference is an explicit, account-scoped override, default off for both new and existing users; it is independent of the remembered fold state. Changing it while expanded leaves the rows open and takes effect on the next collapse. When hidden, existing teammate attention and bot/group unread (including threads) appear as a small header dot with an accessible status, never a fabricated count; new messages never open the section or enable avatars. Header taps only expand/collapse. Both states swap with the list’s 225ms disclosure; reduced motion switches instantly. Every language must fit the header and names without widening; long names truncate to one line within the cell.
-There is one mobile home, as on Desktop (owner decision, 2026-10-24): no separate teammate home, no Tasks/Teammates switch in the drawer and no Teammates entry in the title scope menu. Home search keeps the section and lists every matching teammate and group as expanded rows, without the fold toggle or create entries; with no match the section is absent. Teammate unread shows on the section's rows and strip cells, not as a count on a mode switch.
+There is one mobile home, as on Desktop (owner decision, 2026-10-24): no separate teammate home, no Tasks/Teammates switch in the drawer and no Teammates entry in the title scope menu. Home search keeps the section and lists every matching teammate and group as expanded rows, without the fold toggle or create entries; with no match the section is absent. Clearing search restores the saved display choice. Teammate unread shows on the section's rows, enabled strip cells, or compact header, not as a count on a mode switch. Implementation and regression coverage: `apps/mobile/src/session/HomeTeammatesSection.tsx`, `homeChromeMenus.ts`, and `src/__tests__/HomeTeammatesSection.test.tsx`.
### Mobile iOS navigation chrome / iPhone Duo
diff --git a/docs/product-rules/cindy-bots-runtime.md b/docs/product-rules/cindy-bots-runtime.md
index d26a585fed..d14a314025 100644
--- a/docs/product-rules/cindy-bots-runtime.md
+++ b/docs/product-rules/cindy-bots-runtime.md
@@ -1234,7 +1234,7 @@ Codex 切模型重建时,线程索引里的路径不等于文件已经落盘
## 导航未读与系统角标
- 桌面伙伴与任务共用一个侧栏(2026-10-13 定稿):「伙伴」是侧栏第一层的一段,固定在置顶上方,与置顶、全部任务并存;点伙伴只切换主区域,不再整栏切换,也不再有顶部导航的「伙伴 / 返回任务」入口。段名在「展开(行列表)」与「收起成单行头像」之间切换,默认展开,按账号记住;收起时只占一行,放不下的收进末尾「+N」(点开即展开),正在看的聊天始终留在行内,群聊沿用[群聊界面规则](bot-group-chat.md#5-界面)的成员组合头像与单聊区分(`features/bots/TeammatesSection.tsx`、`teammatesSectionPrefs.ts`)。原伙伴列表的新建伙伴 / 群聊、加入群聊、群聊与私聊混排、多设备 Cindy、置顶 / 隐藏 / 复制 / 删除、已隐藏、需要处理的伙伴都留在段内;伙伴不默认置顶。伙伴段没有独立搜索框:侧栏总搜索同时匹配伙伴(名字、简介、技能,含已隐藏、不含已停止)、远程伙伴(含电脑名)与群聊(群名、成员名),命中排在会话结果之前(`TeammateSearchResults`)。侧栏收窄(rail)时由一个带未读数的伙伴图标直达 `/bots`(上次看的伙伴,没有则 Cindy)。
-- 手机任务首页同样以「伙伴」段开头(2026-10-24 定稿「A+B 合一」):段头与置顶段头同款,固定在共享任务、置顶与项目组之上;**展开**为伙伴页同款伙伴行(伙伴与群聊按最近活动混排,默认 3 行,多出的收进「显示全部 N / 收起」),段头右侧「+」新建伙伴或群聊;**收起**为一排 56pt 头像(12/18 名字、未读角点、在回话环,可横滑,最后一格新建)。手机用横滑代替桌面的「+N」。收起状态按账号与首页导航偏好一起记住(`teammatesCollapsed`)。段落不跟随顶栏电脑范围筛选(与桌面一致);首页搜索时伙伴段只列出匹配的伙伴与群聊(无匹配则隐藏,搜索期间不收起、不显示新建),筛选与归档视图时隐藏;没有可用电脑、首页显示连接引导时仍保留(服务器群聊与云端伙伴不依赖电脑,这是手机上打开它们的唯一入口);没有伙伴时只显示一行「添加伙伴」,既无伙伴也无可新建的电脑或仍在首次加载时整段不显示。手机与桌面一样只有一个首页(2026-10-24 定稿):抽屉不再有「任务/伙伴」切换,标题范围菜单不列出伙伴,独立伙伴页已退役;从伙伴聊天返回总是回到任务首页,旧版本记住的「停在伙伴页」在下次写入时清除。实现见 Mobile `HomeTeammatesSection.tsx`,行与排序复用 `TeammateList.tsx` 的 `useTeammateEntries` / `useTeammateRowRenderer`。
+- 手机任务首页同样以「伙伴」段开头(2026-10-24 定稿「A+B 合一」):段头与置顶段头同款,固定在共享任务、置顶与项目组之上;**展开**为伙伴页同款伙伴行(伙伴与群聊按最近活动混排,默认 3 行,多出的收进「显示全部 N / 收起」),段头右侧「+」新建伙伴或群聊;**收起**默认只保留标题行、数量与小号新建入口,不保留头像、名字、大号新建格或空白。首页现有「···」显示菜单的外观区域增加普通「伙伴」子菜单,与「显示」「任务信息」平级,其中「收起时显示头像」勾选项开启后保留原有横向头像条(12/18 名字、未读角点、在回话环,最后一格新建);不是「筛选 → 伙伴」的任务创建者筛选。手机用横滑代替桌面的「+N」。收起状态(`teammatesCollapsed`)与头像开关(`showCollapsedTeammateAvatars`)分别按账号与首页导航偏好一起记住。新开关未设置一律关闭,不能把旧版自动显示头像当作用户选择;显式开关跨刷新、重启与首页/抽屉重挂载保留。展开期间改开关不改变当前展开状态,下次收起生效;标题点击始终只有展开/收起两种动作。隐藏头像时,伙伴未读、群聊主时间线及话题未读、既有待处理状态通过轻量标题提示承接,不另造计数或修改读位;新消息不会自动开启头像或展开列表。段落不跟随顶栏电脑范围筛选(与桌面一致);首页搜索时伙伴段只列出匹配的伙伴与群聊(无匹配则隐藏,搜索期间不收起、不显示新建,清除搜索恢复原显示选择),筛选与归档视图时隐藏;没有可用电脑、首页显示连接引导时仍保留(服务器群聊与云端伙伴不依赖电脑,这是手机上打开它们的唯一入口);没有伙伴时展开或已开启头像条仍显示一行「添加伙伴」,已收起且头像关闭则只留标题与小号新建入口;既无伙伴也无可新建的电脑或仍在首次加载时整段不显示。手机与桌面一样只有一个首页(2026-10-24 定稿):抽屉不再有「任务/伙伴」切换,标题范围菜单不列出伙伴,独立伙伴页已退役;从伙伴聊天返回总是回到任务首页,旧版本记住的「停在伙伴页」在下次写入时清除。实现见 Mobile `HomeTeammatesSection.tsx`,行与排序复用 `TeammateList.tsx` 的 `useTeammateEntries` / `useTeammateRowRenderer`。
- 系统通知(完成 / 出错 / 待回复)只由任务侧栏一处发出,`/bots` 路由同样由它观察;正在看的伙伴会话按「注视中」处理,不记未读、不发通知(`useViewedBotSessionId`)。群专线仍不通知。
- 伙伴未读按**有未读的对话数**聚合可见、未归档的伙伴私聊与群聊;私聊行仍显示原有的回复条数,群聊行标记该群未读。生成状态、工具过程、内部私信回执和静默巡检不新增未读。收起成头像时以头像角点提示未读,rail 伙伴图标显示聚合数。
- 桌面 Dock 的完整投影为本机待关注任务数 + 本机未读伙伴对话数。远程伙伴可以出现在伙伴段,但不扩大本机 Dock 范围;目录加载前的通知事件兜底仍由既有 appBadgeService 管理,目录覆盖的伙伴底层 Session ID 用于去重。
@@ -1242,7 +1242,7 @@ Codex 切模型重建时,线程索引里的路径不等于文件已经落盘
- macOS 灵动岛的伙伴私聊未读复用伙伴列表读位:重启后恢复,超过普通活动卡片的 4 小时期限仍显示;远程伙伴离线时保留已有未读,隐藏、归档或移出账号可见范围后移除聊天未读投影。聊天未读与运行活动按主聊天 Session 合成一行,运行、待回复和错误仍取运行时状态;聊天读完或隐藏伙伴不清除这些独立运行状态。滑动标为已读推进这台电脑上该伙伴的读位至卡片对应消息时间,远程伙伴也不要求主力电脑在线。声音仍按真实运行状态变化判断,聊天保持已读不阻止新回复的完成声音;恢复未读只补显示,不重放完成通知、声音或活动中继。实现见 `useCompanionIslandChats.ts` 与 `agent-island/state.ts`,读位沿用下述设备本地语义。
- 分区切换和列表刷新不是已读。只有对应对话前台可见、读到尾部并完成内容同步后,读位才推进到实际显示的回复时间;加载历史、后台窗口、生成过程、失败的远程恢复均不按当前时间清零。普通任务原有已读同步保持不变。
- 伙伴读位复用设备本地、账号隔离的持久存储;同机窗口通过 storage 事件更新。它不是跨设备已读协议,手机读过不会清除桌面伙伴角标。群聊复用同样的读位机制,旧工作端缺少回复时间字段时不凭空推断未读。首次建立读位不追溯已有历史,之后列表刷新不重置读位。
-- 手机的伙伴未读显示在任务首页伙伴段的行与收起头像角点上,不另造菜单键提示点或返回按钮。首页聚焦时任务镜像按现有连接恢复链路同步全部可用电脑;任务列表本身的筛选、消息存储和运行行为不变。离线保留已有镜像,重连后重取;解除绑定或删除条目后不再聚合。
+- 手机的伙伴未读显示在任务首页伙伴段的行、已开启的收起头像角点或头像隐藏时的标题提示点上,不另造菜单键提示点或返回按钮。首页聚焦时任务镜像按现有连接恢复链路同步全部可用电脑;任务列表本身的筛选、消息存储和运行行为不变。离线保留已有镜像,重连后重取;解除绑定或删除条目后不再聚合。
- 零不显示,入口溢出复用伙伴列表的 `99+` 规范;辅助文本保留完整数字与单位,所有界面语言一起提供。