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: 查看已归档任务时在列表筛选入口显示提醒点

Dash980402c09efa
diff --git a/apps/desktop/src/renderer/features/cc-agent/sidebar/MainListScopeHeader.tsx b/apps/desktop/src/renderer/features/cc-agent/sidebar/MainListScopeHeader.tsx
index f5c248d9d2..f6fe51261b 100644
--- a/apps/desktop/src/renderer/features/cc-agent/sidebar/MainListScopeHeader.tsx
+++ b/apps/desktop/src/renderer/features/cc-agent/sidebar/MainListScopeHeader.tsx
@@ -27,8 +27,6 @@ const HEADER_HOVER_ACTION_CLASS = cn(
'group-has-[[data-state=open]]/sidebar-header:pointer-events-auto group-has-[[data-state=open]]/sidebar-header:opacity-100',
);
-const HEADER_ACTIONS_CLASS = cn('flex items-center gap-0.5 -mt-px', HEADER_HOVER_ACTION_CLASS);
-
export function MainListScopeHeader({
filter,
allKnownProjects,
@@ -54,33 +52,38 @@ export function MainListScopeHeader({
<MachineSwitcherMenu onOpenDisplaySettings={() => setDisplaySettingsOpen(true)} />
</div>
<div className="flex items-center gap-0.5 -mt-px">
- <div className={HEADER_ACTIONS_CLASS}>
+ <div className="flex items-center gap-0.5 -mt-px">
{fold ? (
- <Tip text={fold.label} side="bottom">
- <button
- type="button"
- onClick={fold.onClick}
- disabled={fold.disabled}
- aria-label={fold.label}
- className={cn(
- 'flex h-7 w-7 items-center justify-center rounded-md',
- 'text-[var(--sidebar-list-muted)]',
- 'transition-colors hover:text-[var(--sidebar-nav-text)]',
- 'disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent',
- )}
- >
- <fold.Icon size={14} strokeWidth={2} />
- </button>
- </Tip>
+ <div className={HEADER_HOVER_ACTION_CLASS}>
+ <Tip text={fold.label} side="bottom">
+ <button
+ type="button"
+ onClick={fold.onClick}
+ disabled={fold.disabled}
+ aria-label={fold.label}
+ className={cn(
+ 'flex h-7 w-7 items-center justify-center rounded-md',
+ 'text-[var(--sidebar-list-muted)]',
+ 'transition-colors hover:text-[var(--sidebar-nav-text)]',
+ 'disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent',
+ )}
+ >
+ <fold.Icon size={14} strokeWidth={2} />
+ </button>
+ </Tip>
+ </div>
) : null}
- <SidebarFilterPopover
- filter={filter}
- allKnownProjects={allKnownProjects}
- dialogueCount={dialogueCount}
- hasRemoteDevices={hasRemoteDevices}
- open={displaySettingsOpen}
- onOpenChange={setDisplaySettingsOpen}
- />
+ {/* 在看已归档任务时设置按钮常驻(带点),否则跟随段头 hover 出现。 */}
+ <div className={filter.status === 'archived' ? undefined : HEADER_HOVER_ACTION_CLASS}>
+ <SidebarFilterPopover
+ filter={filter}
+ allKnownProjects={allKnownProjects}
+ dialogueCount={dialogueCount}
+ hasRemoteDevices={hasRemoteDevices}
+ open={displaySettingsOpen}
+ onOpenChange={setDisplaySettingsOpen}
+ />
+ </div>
</div>
</div>
</div>
diff --git a/apps/desktop/src/renderer/features/cc-agent/sidebar/SidebarFilterPopover.tsx b/apps/desktop/src/renderer/features/cc-agent/sidebar/SidebarFilterPopover.tsx
index 220a2d780e..a904fb2885 100644
--- a/apps/desktop/src/renderer/features/cc-agent/sidebar/SidebarFilterPopover.tsx
+++ b/apps/desktop/src/renderer/features/cc-agent/sidebar/SidebarFilterPopover.tsx
@@ -525,7 +525,8 @@ export function SidebarFilterPopover({
)
.join(t('ccAgent.sidebar.taskInfoSummarySeparator'))
: t('ccAgent.sidebar.taskInfoSummaryNone');
- const taskInfoIsDefault = taskInfoFields.length === DEFAULT_TASK_INFO_FIELDS.length &&
+ const taskInfoIsDefault =
+ taskInfoFields.length === DEFAULT_TASK_INFO_FIELDS.length &&
DEFAULT_TASK_INFO_FIELDS.every((field, index) => taskInfoFields[index] === field);
const ariaLabel = t('ccAgent.sidebar.filterAria', {
@@ -575,12 +576,20 @@ export function SidebarFilterPopover({
aria-pressed={isFilterActive}
className={cn(
// 配色与段头其余按钮统一(侧栏 token 对),不用通用 text-tertiary。
- 'flex h-7 w-7 items-center justify-center rounded-md',
+ 'relative flex h-7 w-7 items-center justify-center rounded-md',
'text-[var(--sidebar-list-muted)]',
'transition-colors hover:text-[var(--sidebar-nav-text)]',
)}
>
<SlidersHorizontal size={14} strokeWidth={2} />
+ {/* 正在看已归档任务时标一个点(与搜索筛选按钮同款),提醒列表
+ 不是平常的进行中任务;段头会让这个按钮常驻显示。 */}
+ {status === 'archived' && (
+ <span
+ aria-hidden
+ className="absolute right-1 top-1 size-1.5 rounded-full bg-[var(--status-bar-accent)]"
+ />
+ )}
</button>
</Tip>
)}
diff --git a/apps/mobile/assets/navigation/README.md b/apps/mobile/assets/navigation/README.md
index 9cc6057243..38e929d712 100644
--- a/apps/mobile/assets/navigation/README.md
+++ b/apps/mobile/assets/navigation/README.md
@@ -17,3 +17,9 @@ The native toolbar tints the template; Duo's custom 44pt button uses the same
artwork and semantic tint. Do not use an empty Stack.Toolbar.Badge: the iOS
header bridge constructs a text badge even for an empty value, producing an
oversized circle. These are JS-bundled images, not native asset-catalog inputs.
+
+The home display button uses ellipsis.svg (template) and, while the list shows
+archived tasks, ellipsis-attention-light.svg / ellipsis-attention-dark.svg. They
+share the same 26pt canvas and Lucide Ellipsis geometry as the Android header;
+the attention variants add the same 6pt dot at the upper right in statusAccent
+and are rendered as original images, so each theme has its own glyph color.
diff --git a/apps/mobile/assets/navigation/ellipsis-attention-dark.png b/apps/mobile/assets/navigation/ellipsis-attention-dark.png
new file mode 100644
index 0000000000..c6ee2d46fb
Binary files /dev/null and b/apps/mobile/assets/navigation/ellipsis-attention-dark.png differ
diff --git a/apps/mobile/assets/navigation/ellipsis-attention-dark.svg b/apps/mobile/assets/navigation/ellipsis-attention-dark.svg
new file mode 100644
index 0000000000..cd33d01b16
--- /dev/null
+++ b/apps/mobile/assets/navigation/ellipsis-attention-dark.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" viewBox="0 0 26 26"><g transform="translate(3 3) scale(0.8333333)" fill="none" stroke="#EDEDED" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/></g><circle cx="23" cy="3" r="3" fill="#EA6B17"/></svg>
\ No newline at end of file
diff --git a/apps/mobile/assets/navigation/[email protected] b/apps/mobile/assets/navigation/[email protected]
new file mode 100644
index 0000000000..06bb5b6592
Binary files /dev/null and b/apps/mobile/assets/navigation/[email protected] differ
diff --git a/apps/mobile/assets/navigation/[email protected] b/apps/mobile/assets/navigation/[email protected]
new file mode 100644
index 0000000000..9aa672a82f
Binary files /dev/null and b/apps/mobile/assets/navigation/[email protected] differ
diff --git a/apps/mobile/assets/navigation/ellipsis-attention-light.png b/apps/mobile/assets/navigation/ellipsis-attention-light.png
new file mode 100644
index 0000000000..1ca9407c34
Binary files /dev/null and b/apps/mobile/assets/navigation/ellipsis-attention-light.png differ
diff --git a/apps/mobile/assets/navigation/ellipsis-attention-light.svg b/apps/mobile/assets/navigation/ellipsis-attention-light.svg
new file mode 100644
index 0000000000..a8b516c026
--- /dev/null
+++ b/apps/mobile/assets/navigation/ellipsis-attention-light.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" viewBox="0 0 26 26"><g transform="translate(3 3) scale(0.8333333)" fill="none" stroke="#0F0F0F" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/></g><circle cx="23" cy="3" r="3" fill="#EA6B17"/></svg>
\ No newline at end of file
diff --git a/apps/mobile/assets/navigation/[email protected] b/apps/mobile/assets/navigation/[email protected]
new file mode 100644
index 0000000000..974ec23208
Binary files /dev/null and b/apps/mobile/assets/navigation/[email protected] differ
diff --git a/apps/mobile/assets/navigation/[email protected] b/apps/mobile/assets/navigation/[email protected]
new file mode 100644
index 0000000000..ccdce6c2fe
Binary files /dev/null and b/apps/mobile/assets/navigation/[email protected] differ
diff --git a/apps/mobile/assets/navigation/ellipsis.png b/apps/mobile/assets/navigation/ellipsis.png
new file mode 100644
index 0000000000..ccb5b6befe
Binary files /dev/null and b/apps/mobile/assets/navigation/ellipsis.png differ
diff --git a/apps/mobile/assets/navigation/ellipsis.svg b/apps/mobile/assets/navigation/ellipsis.svg
new file mode 100644
index 0000000000..806b8848a7
--- /dev/null
+++ b/apps/mobile/assets/navigation/ellipsis.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" viewBox="0 0 26 26"><g transform="translate(3 3) scale(0.8333333)" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/></g></svg>
\ No newline at end of file
diff --git a/apps/mobile/assets/navigation/[email protected] b/apps/mobile/assets/navigation/[email protected]
new file mode 100644
index 0000000000..ed6bd3c433
Binary files /dev/null and b/apps/mobile/assets/navigation/[email protected] differ
diff --git a/apps/mobile/assets/navigation/[email protected] b/apps/mobile/assets/navigation/[email protected]
new file mode 100644
index 0000000000..07f700d9e8
Binary files /dev/null and b/apps/mobile/assets/navigation/[email protected] differ
diff --git a/apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx b/apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx
index 5f6a77ebc6..179b3c0213 100644
--- a/apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx
+++ b/apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx
@@ -1,6 +1,7 @@
import { memo, useState } from "react";
import { Stack } from "expo-router";
import { centeredHomeTitleWidth, HomeStackHeader } from "./HomeStackHeader";
+import { homeDisplayAttentionIcon, homeDisplayIcon } from "./homeDisplayIcon";
import { nativeToolbarMenuItems } from "./nativeToolbarMenuItems";
import { QuietSyncIndicator } from '@/components/QuietSyncIndicator';
import { useDelayedConnectionNotice } from '@/components/ConnectionNoticeOverlay';
@@ -36,6 +37,7 @@ import { lineHeight, navigationChrome, spacing } from "@/theme/tokens";
export const HomeNativeStackHeader = memo(function HomeNativeStackHeader({
displayA11y,
displayActions,
+ displayBadge = false,
menuA11y,
onDisplayAction,
onOpenDeviceMenu,
@@ -52,6 +54,8 @@ export const HomeNativeStackHeader = memo(function HomeNativeStackHeader({
}: {
displayA11y: string;
displayActions: readonly NativePullDownAction[];
+ /** 在看已归档任务时,显示菜单按钮带一个点提醒。 */
+ displayBadge?: boolean;
menuA11y: string;
onDisplayAction(id: string): void;
onOpenDeviceMenu(): void;
@@ -66,7 +70,7 @@ export const HomeNativeStackHeader = memo(function HomeNativeStackHeader({
title: string;
titleA11y: string;
}) {
- const { colors } = useTheme();
+ const { colors, mode } = useTheme();
const styles = useThemedStyles(makeStyles);
const nativeMenus = usesNativePullDownMenu();
const { width } = useSafeAreaFrame();
@@ -162,7 +166,11 @@ export const HomeNativeStackHeader = memo(function HomeNativeStackHeader({
<Stack.Toolbar placement="right">
{onOpenRemoteDesktop ? <Stack.Toolbar.Button icon={require("../../../assets/navigation/monitor.png")} iconRenderingMode="template"
accessibilityLabel={remoteDesktopA11y} onPress={onOpenRemoteDesktop} /> : null}
- <Stack.Toolbar.Menu icon="ellipsis" accessibilityLabel={displayA11y}>
+ <Stack.Toolbar.Menu
+ icon={displayBadge ? homeDisplayAttentionIcon[mode === "dark" ? "dark" : "light"] : homeDisplayIcon}
+ iconRenderingMode={displayBadge ? "original" : "template"}
+ accessibilityLabel={displayA11y}
+ >
{nativeToolbarMenuItems(displayActions, onDisplayAction)}
</Stack.Toolbar.Menu>
</Stack.Toolbar>
diff --git a/apps/mobile/src/platform/chrome/homeDisplayIcon.ts b/apps/mobile/src/platform/chrome/homeDisplayIcon.ts
new file mode 100644
index 0000000000..87706f0520
--- /dev/null
+++ b/apps/mobile/src/platform/chrome/homeDisplayIcon.ts
@@ -0,0 +1,11 @@
+/**
+ * 首页「⋯」显示设置按钮的工具栏图像:与 homeMenuIcon 同为 26pt 透明画布、glyph 居中不动。
+ * 在看已归档任务时换成带 6pt 提醒点的版本;点是 statusAccent 色,不随模板着色,所以按
+ * 深浅色各出一张原色图(glyph 取 textPrimary)。不用空 Stack.Toolbar.Badge,原因见
+ * assets/navigation/README.md。
+ */
+export const homeDisplayIcon = require('../../../assets/navigation/ellipsis.png');
+export const homeDisplayAttentionIcon = {
+ light: require('../../../assets/navigation/ellipsis-attention-light.png'),
+ dark: require('../../../assets/navigation/ellipsis-attention-dark.png'),
+};
diff --git a/apps/mobile/src/session/HomeSurface.tsx b/apps/mobile/src/session/HomeSurface.tsx
index aea8c1fa6c..e8c6bde52e 100644
--- a/apps/mobile/src/session/HomeSurface.tsx
+++ b/apps/mobile/src/session/HomeSurface.tsx
@@ -3174,6 +3174,7 @@ function HomeScreenContent({ active = true, onModeChange, width, newSessionInSys
syncing={quietSyncing}
displayA11y={t('devices.list.a11y.openDisplaySettings')}
displayActions={stableDisplayActions}
+ displayBadge={statusFilter === 'archived'}
menuA11y={t('devices.list.a11y.openMenu')}
onDisplayAction={stableDisplayAction}
onOpenDeviceMenu={openDeviceMenu}
@@ -3260,7 +3261,11 @@ function HomeScreenContent({ active = true, onModeChange, width, newSessionInSys
{/* 系统菜单不可用(未编进 MenuView 的旧 iOS 包)时退回同一份菜单模型的 Cindy 自绘菜单。 */}
<HomeDisplayMenu actions={homeDisplayPullDownActions} onAction={handleDisplayAction}>
<HomeHeaderGlassButton accessibilityLabel={t('devices.list.a11y.openDisplaySettings')} onPress={() => undefined} testID="home.displaySettingsButton">
- <Ellipsis color={colors.textPrimary} size={iconSize.action} strokeWidth={iconStroke.regular} />
+ <View>
+ <Ellipsis color={colors.textPrimary} size={iconSize.action} strokeWidth={iconStroke.regular} />
+ {/* 在看已归档任务时标一个点,提醒列表不是平常的进行中任务。 */}
+ {statusFilter === 'archived' ? <View style={styles.displayFilterDot} testID="home.displayFilterDot" /> : null}
+ </View>
</HomeHeaderGlassButton>
</HomeDisplayMenu>
</View>
@@ -4956,6 +4961,15 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({
headerActionsWide: {
width: navigationChrome.target * 2 + spacing.xs,
},
+ displayFilterDot: {
+ position: 'absolute',
+ top: -1,
+ right: -2,
+ width: 6,
+ height: 6,
+ borderRadius: radius.pill,
+ backgroundColor: colors.statusAccent,
+ },
// 菜单外层替标题占住顶栏中间的剩余宽度,长设备名在这里截断而不是挤开右侧按钮。
headerTitleSlot: {
flex: 1,