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。

fix(mobile): 保持显示设置菜单的筛选提醒为 6pt

Dash4a2a0bbf0513
diff --git a/apps/mobile/src/platform/chrome/NativePullDownMenu.tsx b/apps/mobile/src/platform/chrome/NativePullDownMenu.tsx
index df7b1882b0..516c17d940 100644
--- a/apps/mobile/src/platform/chrome/NativePullDownMenu.tsx
+++ b/apps/mobile/src/platform/chrome/NativePullDownMenu.tsx
@@ -53,14 +53,12 @@ function toMenuAction(
title: action.title,
// Fabric defaults the library's optional Int32 imageColor to transparent.
// Always pair a symbol with a visible semantic color.
- ...(action.image || action.filterReminder
+ ...(action.image
? {
- image: action.filterReminder ? "circle.fill" : action.image,
- imageColor: action.filterReminder
- ? colors.statusAccent
- : action.destructive
- ? colors.destructive
- : colors.textPrimary,
+ image: action.image,
+ imageColor: action.destructive
+ ? colors.destructive
+ : colors.textPrimary,
}
: {}),
...(action.subtitle ? { subtitle: action.subtitle } : {}),
@@ -107,9 +105,20 @@ function childDisabled(children: ReactNode): boolean {
return (children.props as { disabled?: unknown }).disabled === true;
}
+/** MenuView 只支持系统符号或原生资源,不能用 JS PNG 精确绘制 6pt 提示点。
+ * 使用提醒字段的菜单复用已有自绘路径;false 也算,切换筛选时保持同一个呈现器。
+ */
+function usesFilterReminder(actions: readonly NativePullDownAction[]): boolean {
+ return actions.some((action) =>
+ action.filterReminder !== undefined ||
+ (action.subactions !== undefined && usesFilterReminder(action.subactions)),
+ );
+}
+
/**
- * 收起时完全是调用方原来的按钮/标题;iOS 点开是系统 UIMenu 下拉,Android 是 Material
- * 下拉菜单(AnchoredPullDownMenu.android)。iOS 尚未编进 MenuView 的包只渲染 children,
+ * 收起时完全是调用方原来的按钮/标题;iOS 一般用系统 UIMenu,带筛选提醒的菜单用
+ * 现有自绘面板以保留 6pt 圆点;Android 用 Material 下拉菜单。
+ * iOS 尚未编进 MenuView 的包只渲染 children,
* 由调用方继续走自绘面板。
*/
export function NativePullDownMenu({
@@ -152,7 +161,7 @@ export function NativePullDownMenu({
return isValidElement<{ disabled?: boolean }>(children)
? cloneElement(children, { disabled: true })
: children;
- if (Platform.OS === "android") {
+ if (Platform.OS === "android" || usesFilterReminder(actions)) {
return (
<AnchoredPullDownMenu
accessibilityLabel={accessibilityLabel}
diff --git a/docs/design-rules/DESIGN.md b/docs/design-rules/DESIGN.md
index 8e3d2b15a0..204f356dc0 100644
--- a/docs/design-rules/DESIGN.md
+++ b/docs/design-rules/DESIGN.md
@@ -312,9 +312,12 @@ _Dark Mode text uses softened neutrals to reduce eye strain: **Soft Gray** (`#d4
When the sidebar display-settings trigger shows the archived-view reminder, repeat
the same static accent dot on the Task status submenu and its selected Archived
option. Desktop and Mobile retain neutral labels and selection checkmarks. Active
-and All remove the whole reminder path. Native iOS menus use their image slot for
-the dot; custom menus use the shared inline dot. This extends the existing filter
-reminder registration without changing which settings light the entry indicator.
+and All remove the whole reminder path. The native iOS toolbar menu uses its image
+slot for the dot. MenuView cannot display JS-bundled custom images, so display-settings
+menus outside the toolbar reuse the existing Cindy menu and shared 6pt inline dot,
+including when the reminder is off, keeping the presenter stable across selections.
+This extends the existing filter reminder registration without changing which
+settings light the entry indicator.
## 3. Typography Rules