Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
feat(mobile): 新增「我的消息气泡颜色」设置
kirozenge2a2ee41da6f
diff --git a/apps/mobile/app/settings.tsx b/apps/mobile/app/settings.tsxindex e5653c74f8..83c9d85f79 100644--- a/apps/mobile/app/settings.tsx+++ b/apps/mobile/app/settings.tsx@@ -85,6 +85,7 @@ import {} from '@/session/mobileVoiceDictionaryCache';import { buildMobileVoiceDictionaryEntryViews } from '@/session/mobileVoiceDictionaryView';import { buildMobileUpdateInfoRows, currentMobileOtaVersion } from '@/settings/updateInfo';+import { UserBubbleSettings } from '@/settings/UserBubbleSettings';import { shouldCheckBundleUpdate } from '@/update/bundleUpdate';import { isGooglePlayInstallation } from '@/update/androidInstallSource';import {@@ -904,6 +905,7 @@ export default function SettingsScreen() {value={t(`settings.appearance.options.${themePreference}`)}/></NativePullDownMenu>+ <UserBubbleSettings /></SettingsGroup>{/* 显示语言:默认跟随系统,手动选择即持久化 override(恢复跟随系统 = 清除 override) */}diff --git a/apps/mobile/app/settings/user-bubble.tsx b/apps/mobile/app/settings/user-bubble.tsxnew file mode 100644index 0000000000..98e4a86fef--- /dev/null+++ b/apps/mobile/app/settings/user-bubble.tsx@@ -0,0 +1,3 @@+import { UserBubblePage } from '@/settings/UserBubblePage';++export default UserBubblePage;diff --git a/apps/mobile/docs/mobile-design-guide.md b/apps/mobile/docs/mobile-design-guide.mdindex 695c42341c..43f48c1a10 100644--- a/apps/mobile/docs/mobile-design-guide.md+++ b/apps/mobile/docs/mobile-design-guide.md@@ -12,6 +12,7 @@- **iOS 优先**,触控优先,跟随系统 light / dark 自动切换(`useColorScheme`)。- **灰度环境**:除品牌 teal(就绪态)、Heart Orange(运行/thinking 态)和已登记的 Beta 渠道红色状态徽标外,界面全是黑白之间的灰阶。不引入任何品牌蓝 / 绿 / 红等装饰色。+ - 唯一的个性化例外:用户在设置里主动选择的「我的消息气泡颜色」,只染用户自己的消息气泡,默认仍是灰阶;规则见根规范 `DESIGN.md`「Personal message bubble colors」。- **圆角走四档阶梯**(与 `src/theme/tokens.ts` 的 `radius` 一致,守护测试拦截阶梯外值):`micro`(4,缩略图内 chip、勾选指示器等微元素)/ `control`(8,卡片内层控件)/ `container`(12,卡片 / 容器)/ `pill`(9999,交互元素)。**禁止**阶梯外中间值(0 / 3 / 6 / 28 等)与字面量圆角。根规范 `docs/design-rules/DESIGN.md` §5 的三档制约束的是桌面 surface;其「Mobile」节明确把 §15.13 / §16 之外的 mobile 布局细节委托给 `apps/mobile` 的实现,mobile 圆角阶梯以 `tokens.ts` 为准。- **默认零阴影**:层次靠背景色差 + 1px 边框。2026-09-27 用户明确要求的局部例外:首页主菜单抽屉(含伙伴入口)用右侧容器圆角与柔和投影,颜色走 homeDrawerShadow,外壳承载阴影、内层裁切内容;不扩展到页面卡片或任务列表侧栏,见 DESIGN.md §6。- **字重克制**:按角色用 400 / 500 / 600(见 §3「字重与字色按角色搭配」)。**UI chrome 无 700+**。唯一例外是根规范 `docs/design-rules/DESIGN.md` §3「排版豁免登记表」已登记的域——原生 Markdown strong(`src/session/MessageRenderer.tsx` 的 `markdownStrong` → `fontWeight.bold`)与登录品牌画布(`app/(auth)/login.tsx`、`src/components/LoginSkinControls.tsx`、`src/auth/loginSkinLayout.ts`)。这些是用户内容语义与品牌画布,不算 chrome;chrome 本身的上限仍是 600。diff --git a/apps/mobile/src/__tests__/userBubblePreference.test.ts b/apps/mobile/src/__tests__/userBubblePreference.test.tsnew file mode 100644index 0000000000..e1e4834dd5--- /dev/null+++ b/apps/mobile/src/__tests__/userBubblePreference.test.ts@@ -0,0 +1,39 @@+import { describe, expect, it, vi } from "vitest";+const store = vi.hoisted(() => new Map<string, string>());+vi.mock("@react-native-async-storage/async-storage", () => ({+ default: {+ getItem: vi.fn(async (key: string) => store.get(key) ?? null),+ setItem: vi.fn(async (key: string, value: string) => {+ store.set(key, value);+ }),+ removeItem: vi.fn(async (key: string) => {+ store.delete(key);+ }),+ },+}));+vi.mock("@/theme/ThemeProvider", () => ({+ useTheme: () => ({ mode: "light" }),+}));+import AsyncStorage from "@react-native-async-storage/async-storage";+import { saveUserBubblePreference } from "@/theme/userBubblePreference";+describe("mobile bubble appearance persistence", () => {+ it("serializes rapid choices and removes the override on reset", async () => {+ await Promise.all([+ saveUserBubblePreference("blue"),+ saveUserBubblePreference("red"),+ ]);+ expect([...store.values()]).toEqual(["red"]);+ await saveUserBubblePreference("default");+ expect(store.size).toBe(0);+ });+ it("reports save failures and lets the next choice recover", async () => {+ vi.mocked(AsyncStorage.setItem).mockRejectedValueOnce(+ new Error("disk full"),+ );+ await expect(saveUserBubblePreference("peach")).rejects.toThrow(+ "disk full",+ );+ await saveUserBubblePreference("sage");+ expect([...store.values()]).toEqual(["sage"]);+ });+});diff --git a/apps/mobile/src/i18n/locales/en/settings.json b/apps/mobile/src/i18n/locales/en/settings.jsonindex 761af32ee7..397a84e322 100644--- a/apps/mobile/src/i18n/locales/en/settings.json+++ b/apps/mobile/src/i18n/locales/en/settings.json@@ -31,7 +31,29 @@"light": "Light","dark": "Dark"},- "saveFailed": "Failed to save appearance mode. The previous setting will return after restart."+ "saveFailed": "Failed to save appearance mode. The previous setting will return after restart.",+ "userBubble": {+ "title": "My message bubble color",+ "presets": "Color",+ "default": "Default",+ "peach": "First Draft",+ "yellow": "Daybreak",+ "sage": "Spark",+ "blue": "Dreamscape",+ "lavender": "Night Cat",+ "red": "Red Collar",+ "custom": "Custom color",+ "hue": "Hue",+ "preview": "Message preview",+ "sampleUser": "Help me organize today’s ideas.",+ "sampleAssistant": "Sure, let’s work through your ideas together.",+ "hint": "Colors adjust to light and dark mode so text stays easy to read. Saved on this device only.",+ "customHint": "Drag along the color strip to choose a hue. Colors adjust to light and dark mode so text stays easy to read. Saved on this device only.",+ "saveFailed": "The color is applied for now but could not be saved. Please try again.",+ "reset": "Reset to default",+ "apply": "Apply",+ "hex": "Color value"+ }},"language": {"title": "Language",diff --git a/apps/mobile/src/i18n/locales/ja/settings.json b/apps/mobile/src/i18n/locales/ja/settings.jsonindex d66a1357ec..ecfca639d5 100644--- a/apps/mobile/src/i18n/locales/ja/settings.json+++ b/apps/mobile/src/i18n/locales/ja/settings.json@@ -31,7 +31,29 @@"light": "ライト","dark": "ダーク"},- "saveFailed": "表示モードを保存できませんでした。再起動すると以前の設定に戻ります。"+ "saveFailed": "表示モードを保存できませんでした。再起動すると以前の設定に戻ります。",+ "userBubble": {+ "title": "自分のメッセージの吹き出しの色",+ "presets": "カラー",+ "default": "デフォルト",+ "peach": "したがき",+ "yellow": "あさひ",+ "sage": "ひらめき",+ "blue": "ゆめ",+ "lavender": "よるねこ",+ "red": "くびわ",+ "custom": "カスタムカラー",+ "hue": "色相",+ "preview": "メッセージのプレビュー",+ "sampleUser": "今日のアイデアを整理して。",+ "sampleAssistant": "一緒にアイデアを整理しましょう。",+ "hint": "色はライト/ダークモードに合わせて明るさが自動調整され、文字が読みやすく保たれます。この端末にのみ保存されます。",+ "customHint": "カラーバーを左右にドラッグして色を選べます。色はライト/ダークモードに合わせて明るさが自動調整され、文字が読みやすく保たれます。この端末にのみ保存されます。",+ "saveFailed": "色は適用されましたが、保存できませんでした。もう一度お試しください。",+ "reset": "デフォルトに戻す",+ "apply": "適用",+ "hex": "カラーコード"+ }},"language": {"title": "言語",diff --git a/apps/mobile/src/i18n/locales/ko/settings.json b/apps/mobile/src/i18n/locales/ko/settings.jsonindex 713f24f34f..dbe55f3f7d 100644--- a/apps/mobile/src/i18n/locales/ko/settings.json+++ b/apps/mobile/src/i18n/locales/ko/settings.json@@ -31,7 +31,29 @@"light": "라이트","dark": "다크"},- "saveFailed": "표시 모드를 저장하지 못했습니다. 다시 열면 이전 설정으로 돌아갑니다."+ "saveFailed": "표시 모드를 저장하지 못했습니다. 다시 열면 이전 설정으로 돌아갑니다.",+ "userBubble": {+ "title": "내 메시지 말풍선 색상",+ "presets": "색상",+ "default": "기본값",+ "peach": "초안",+ "yellow": "새벽빛",+ "sage": "영감",+ "blue": "꿈결",+ "lavender": "밤고양이",+ "red": "목걸이",+ "custom": "사용자 지정 색상",+ "hue": "색조",+ "preview": "메시지 미리보기",+ "sampleUser": "오늘 떠오른 아이디어를 정리해 줘.",+ "sampleAssistant": "좋아요, 함께 아이디어를 정리해 봐요.",+ "hint": "색상은 라이트·다크 모드에 맞춰 밝기가 자동 조정되어 글자가 잘 보입니다. 이 기기에만 저장됩니다.",+ "customHint": "색상 막대를 좌우로 드래그해 색을 고르세요. 색상은 라이트·다크 모드에 맞춰 밝기가 자동 조정되어 글자가 잘 보입니다. 이 기기에만 저장됩니다.",+ "saveFailed": "색상은 적용되었지만 저장하지 못했습니다. 다시 시도해 주세요.",+ "reset": "기본값으로 복원",+ "apply": "적용",+ "hex": "색상 코드"+ }},"language": {"title": "언어",diff --git a/apps/mobile/src/i18n/locales/zh-CN/settings.json b/apps/mobile/src/i18n/locales/zh-CN/settings.jsonindex 156f248ca2..cc06d1328c 100644--- a/apps/mobile/src/i18n/locales/zh-CN/settings.json+++ b/apps/mobile/src/i18n/locales/zh-CN/settings.json@@ -31,7 +31,29 @@"light": "浅色","dark": "深色"},- "saveFailed": "显示模式没有保存成功,重新打开后会恢复之前的设置"+ "saveFailed": "显示模式没有保存成功,重新打开后会恢复之前的设置",+ "userBubble": {+ "title": "我的消息气泡颜色",+ "presets": "颜色",+ "default": "默认",+ "peach": "初稿",+ "yellow": "晨光",+ "sage": "灵感",+ "blue": "梦境",+ "lavender": "夜猫",+ "red": "项圈",+ "custom": "自定义颜色",+ "hue": "色相",+ "preview": "消息预览",+ "sampleUser": "帮我整理一下今天的灵感。",+ "sampleAssistant": "好的,我们一起把想法梳理清楚。",+ "hint": "颜色会按浅色和深色模式自动调整明暗,保证文字清晰。仅保存在此设备。",+ "customHint": "左右拖动色带选择颜色。颜色会按浅色和深色模式自动调整明暗,保证文字清晰。仅保存在此设备。",+ "saveFailed": "颜色已在本次使用中生效,但未能保存。请重试。",+ "reset": "恢复默认",+ "apply": "应用",+ "hex": "颜色值"+ }},"language": {"title": "语言",diff --git a/apps/mobile/src/i18n/locales/zh-TW/settings.json b/apps/mobile/src/i18n/locales/zh-TW/settings.jsonindex 046628a1f5..dc99ef867b 100644--- a/apps/mobile/src/i18n/locales/zh-TW/settings.json+++ b/apps/mobile/src/i18n/locales/zh-TW/settings.json@@ -31,7 +31,29 @@"light": "淺色","dark": "深色"},- "saveFailed": "顯示模式沒有儲存成功,重新開啟後會恢復之前的設定"+ "saveFailed": "顯示模式沒有儲存成功,重新開啟後會恢復之前的設定",+ "userBubble": {+ "title": "我的訊息氣泡顏色",+ "presets": "顏色",+ "default": "預設",+ "peach": "初稿",+ "yellow": "晨光",+ "sage": "靈感",+ "blue": "夢境",+ "lavender": "夜貓",+ "red": "項圈",+ "custom": "自訂顏色",+ "hue": "色相",+ "preview": "訊息預覽",+ "sampleUser": "幫我整理一下今天的靈感。",+ "sampleAssistant": "好的,我們一起把想法梳理清楚。",+ "hint": "顏色會依淺色和深色模式自動調整明暗,確保文字清晰。僅儲存在此裝置。",+ "customHint": "左右拖曳色帶選擇顏色。顏色會依淺色和深色模式自動調整明暗,確保文字清晰。僅儲存在此裝置。",+ "saveFailed": "顏色已在本次使用中生效,但未能儲存。請重試。",+ "reset": "恢復預設",+ "apply": "套用",+ "hex": "色碼"+ }},"language": {"title": "語言",diff --git a/apps/mobile/src/session/MessageRenderer.tsx b/apps/mobile/src/session/MessageRenderer.tsxindex 2c59923e9a..81c2f321e1 100644--- a/apps/mobile/src/session/MessageRenderer.tsx+++ b/apps/mobile/src/session/MessageRenderer.tsx@@ -409,6 +409,7 @@ import { latexToUnicodeApproximation } from '@cindy/maker-shared/math-markdown';import type { RemoteTextFilePreviewResult } from '@/device-link/mobileMakerTransport';import { fontWeight, lineHeight, radius, spacing, typeScale } from '@/theme/tokens';import { iconSize, iconStroke, monoFont, useTheme, useThemedStyles, type ThemeColors } from '@/theme';+import { useUserBubbleAppearance } from '@/theme/userBubblePreference';import { i18n } from '@/i18n';import { formatLocalizedDuration } from '@/session/sessionDurationFormat';import { mobilePresentationLocalizer } from '@/i18n/presentationLocalizer';@@ -3334,6 +3335,7 @@ function MessageBubble({item: MobileMessageItem;actions: MessageActions & { firstUserMessageClientId?: string };}) {+ const { colors: userBubbleColors } = useUserBubbleAppearance();const styles = useThemedStyles(makeStyles);const { colors, mode } = useTheme();const { t, i18n: i18nInstance } = useTranslation();@@ -3715,6 +3717,7 @@ function MessageBubble({isUser ? styles.userBubble : styles.agentBubble,actions.companion && !isUser && !item.message.systemCardType && styles.companionAnswer,hookSource && styles.hookSourceBubble,+ isUser && !item.message.systemCardType && userBubbleColors && { backgroundColor: userBubbleColors.background, borderColor: userBubbleColors.border },]}testID={isUser ? 'message.userBubble' : 'message.agentBubble'}>diff --git a/apps/mobile/src/settings/UserBubbleHueSlider.tsx b/apps/mobile/src/settings/UserBubbleHueSlider.tsxnew file mode 100644index 0000000000..309ebb25e8--- /dev/null+++ b/apps/mobile/src/settings/UserBubbleHueSlider.tsx@@ -0,0 +1,165 @@+import { useRef, useState } from "react";+import {+ StyleSheet,+ View,+ type AccessibilityActionEvent,+ type GestureResponderEvent,+} from "react-native";+import Svg, { Defs, LinearGradient, Rect, Stop } from "react-native-svg";+import { useThemedStyles, type ThemeColors } from "@/theme";++/** 种子色的饱和度与亮度固定,用户只挑色相;浅深模式的明暗由共享解析统一处理。 */+const SATURATION = 0.75;+const VALUE = 0.9;+const TRACK = 10;+const THUMB = 28;+const HIT = 44;++export function hueToHex(h: number): string {+ const f = (n: number) => {+ const k = (n + h / 60) % 6;+ return VALUE - VALUE * SATURATION * Math.max(0, Math.min(k, 4 - k, 1));+ };+ return (+ "#" ++ [f(5), f(3), f(1)]+ .map((c) => Math.round(c * 255).toString(16).padStart(2, "0"))+ .join("")+ );+}++export function hexToHue(hex: string): number {+ const [r, g, b] = [1, 3, 5].map((i) => parseInt(hex.slice(i, i + 2), 16));+ const max = Math.max(r, g, b);+ const d = max - Math.min(r, g, b);+ if (d === 0) return 0;+ const h =+ max === r ? ((g - b) / d) % 6 : max === g ? (b - r) / d + 2 : (r - g) / d + 4;+ return (h * 60 + 360) % 360;+}++const STOPS = Array.from({ length: 13 }, (_, i) => i * 30);++/**+ * 彩虹色带:外形对齐 iOS 滑块(细轨道 + 圆形滑块),左右点按或拖动选色相。+ * iOS 没有比系统 ColorPicker 更轻的自由选色组件,这里只保留一维选择。+ */+export function UserBubbleHueSlider({+ value,+ label,+ onChange,+ onChangeEnd,+ onDragChange,+}: {+ value: string;+ label: string;+ /** 拖动中逐帧回调,只用于本页预览;不要在这里写全局偏好。 */+ onChange(hex: string): void;+ /** 松手或读屏增减时回调一次,宿主在这里保存。 */+ onChangeEnd(hex: string): void;+ /** 按下/松开时通知宿主,宿主据此暂停外层列表滚动,避免拖动被滚动抢走。 */+ onDragChange?(dragging: boolean): void;+}) {+ const styles = useThemedStyles(makeStyles);+ const [width, setWidth] = useState(0);+ const hue = hexToHue(value);+ const usable = Math.max(1, width - THUMB);+ const last = useRef(value);+ const pick = (event: GestureResponderEvent) => {+ const x = Math.min(usable, Math.max(0, event.nativeEvent.locationX - THUMB / 2));+ const next = hueToHex((x / usable) * 359);+ if (next !== last.current) {+ last.current = next;+ onChange(next);+ }+ };+ const step = (event: AccessibilityActionEvent) => {+ const delta = event.nativeEvent.actionName === "increment" ? 10 : -10;+ const next = hueToHex(Math.min(359, Math.max(0, hue + delta)));+ onChange(next);+ onChangeEnd(next);+ };+ return (+ <View+ accessible+ accessibilityLabel={label}+ accessibilityRole="adjustable"+ accessibilityValue={{ min: 0, max: 359, now: Math.round(hue) }}+ accessibilityActions={[{ name: "increment" }, { name: "decrement" }]}+ onAccessibilityAction={step}+ onLayout={(event) => setWidth(event.nativeEvent.layout.width)}+ onStartShouldSetResponder={() => true}+ onMoveShouldSetResponder={() => true}+ onResponderTerminationRequest={() => false}+ onResponderGrant={(event) => {+ last.current = value;+ onDragChange?.(true);+ pick(event);+ }}+ onResponderMove={pick}+ onResponderRelease={() => {+ onDragChange?.(false);+ onChangeEnd(last.current);+ }}+ onResponderTerminate={() => {+ onDragChange?.(false);+ onChangeEnd(last.current);+ }}+ style={styles.hit}+ testID="settings.userBubble.hue"+ >+ {width > 0 ? (+ <>+ <Svg+ width={width - THUMB}+ height={TRACK}+ style={styles.track}+ pointerEvents="none"+ >+ <Defs>+ <LinearGradient id="userBubbleHueTrack" x1="0" y1="0" x2="1" y2="0">+ {STOPS.map((h) => (+ <Stop key={h} offset={h / 360} stopColor={hueToHex(Math.min(h, 359))} />+ ))}+ </LinearGradient>+ </Defs>+ <Rect+ width={width - THUMB}+ height={TRACK}+ rx={TRACK / 2}+ fill="url(#userBubbleHueTrack)"+ />+ </Svg>+ <View+ pointerEvents="none"+ style={[styles.thumb, { left: Math.min(1, hue / 359) * usable }]}+ >+ <View style={[styles.thumbFill, { backgroundColor: value }]} />+ </View>+ </>+ ) : null}+ </View>+ );+}++const makeStyles = (colors: ThemeColors) =>+ StyleSheet.create({+ hit: { height: HIT, justifyContent: "center" },+ track: { marginHorizontal: THUMB / 2 },+ // 外圈细描边 + 内圈浅色环,在任意色相上都看得清,不用阴影。+ thumb: {+ position: "absolute",+ top: (HIT - THUMB) / 2,+ width: THUMB,+ height: THUMB,+ borderRadius: THUMB / 2,+ borderWidth: 1,+ borderColor: colors.borderStrong,+ },+ thumbFill: {+ flex: 1,+ borderRadius: THUMB / 2,+ borderWidth: 3,+ borderColor: colors.surfaceElevated,+ },+ });diff --git a/apps/mobile/src/settings/UserBubblePage.ios.tsx b/apps/mobile/src/settings/UserBubblePage.ios.tsxnew file mode 100644index 0000000000..a40fd3dca1--- /dev/null+++ b/apps/mobile/src/settings/UserBubblePage.ios.tsx@@ -0,0 +1,252 @@+import { useEffect, useState } from "react";+import { Alert, StyleSheet, View } from "react-native";+import { SafeAreaView } from "react-native-safe-area-context";+import { useRouter } from "expo-router";+import { useTranslation } from "react-i18next";+import { Host } from "@expo/ui";+import {+ Circle,+ Form,+ HStack,+ Picker,+ RNHostView,+ Section,+ Text as NativeText,+} from "@expo/ui/swift-ui";+import {+ foregroundStyle,+ frame,+ labelsHidden,+ pickerStyle,+ scrollContentBackground,+ scrollDisabled,+ strokeBorder,+ tag,+} from "@expo/ui/swift-ui/modifiers";+import {+ USER_BUBBLE_PRESETS,+ parseUserBubblePreference,+ resolveUserBubbleColors,+ userBubbleSeed,+ type UserBubblePreference,+} from "@cindy/maker-shared";+import { Text } from "@/components/AppText";+import {+ SimpleStackHeader,+ simpleScreenSafeAreaEdges,+} from "@/platform/chrome";+import {+ useTheme,+ useThemedStyles,+ type ThemeColors,+ fontWeight,+ lineHeight,+ radius,+ spacing,+ typeScale,+} from "@/theme";+import { useUserBubbleAppearance } from "@/theme/userBubblePreference";+import { goBackGuarded } from "@/utils/backGuard";+import { UserBubbleHueSlider, hexToHue, hueToHex } from "./UserBubbleHueSlider";++const CUSTOM = "custom";+const HUE_ROW_HEIGHT = 44;++/** 首次切到自定义时,色带从当前预设的色相(默认则梦境)起步。 */+function pickerSeed(preference: UserBubblePreference): string {+ if (preference.startsWith("#")) return preference;+ return hueToHex(hexToHue(userBubbleSeed(preference === "default" ? "blue" : preference)!));+}++const SWATCH = frame({ width: 24, height: 24 });+let rememberedCustom: string | null = null;+const RAINBOW = [0, 60, 120, 180, 240, 300, 359].map(hueToHex);++/**+ * iOS「我的消息气泡」:顶部实时预览(RN,与会话气泡同款),下方原生 Form。+ * 预设与「自定义颜色」同在一个 inline Picker(系统勾选行);选中自定义才在其下展开色带。+ */+export function UserBubblePage() {+ const { t } = useTranslation();+ const router = useRouter();+ const { colors, mode } = useTheme();+ const styles = useThemedStyles(makeStyles);+ const { preference, setPreference, colors: saved } =+ useUserBubbleAppearance();+ // 拖动中的颜色只留在本页;松手才写全局偏好,避免所有已挂载的会话气泡逐帧重绘。+ const [draft, setDraft] = useState<string | null>(null);+ const bubble = draft+ ? resolveUserBubbleColors(parseUserBubblePreference(draft), mode)+ : saved;+ const custom = preference.startsWith("#");+ // 偏好异步加载,首帧可能还是 default;起点在点按「自定义颜色」时再取。+ // 选过的自定义色记在模块级,App 运行期间离开页面再回来也能恢复。+ const [lastCustom, setLastCustomState] = useState(rememberedCustom);+ const setLastCustom = (hex: string) => {+ rememberedCustom = hex;+ setLastCustomState(hex);+ };+ useEffect(() => {+ if (preference.startsWith("#")) {+ rememberedCustom = preference;+ setLastCustomState(preference);+ }+ }, [preference]);+ const [dragging, setDragging] = useState(false);+ const label = (name: string) => t(`settings.appearance.userBubble.${name}`);+ const select = (next: UserBubblePreference) => {+ if (next === preference) return;+ void setPreference(next).catch(() =>+ Alert.alert(label("title"), label("saveFailed")),+ );+ };+ return (+ <SafeAreaView+ edges={simpleScreenSafeAreaEdges()}+ style={styles.screen}+ testID="settings.userBubble.screen"+ >+ <SimpleStackHeader+ title={label("title")}+ backTestID="settings.userBubble.back"+ onBack={() => goBackGuarded(router)}+ />+ <View+ accessibilityLabel={label("preview")}+ style={styles.preview}+ testID="settings.userBubble.preview"+ >+ <View+ style={[+ styles.bubble,+ bubble && {+ backgroundColor: bubble.background,+ borderColor: bubble.border,+ },+ ]}+ >+ <Text style={styles.message}>{label("sampleUser")}</Text>+ </View>+ <Text style={styles.message}>{label("sampleAssistant")}</Text>+ </View>+ <Host style={styles.form} colorScheme={mode}>+ <Form+ modifiers={[+ scrollContentBackground("hidden"),+ scrollDisabled(dragging),+ ]}+ >+ <Section+ title={label("presets")}+ footer={<NativeText>{label(custom ? "customHint" : "hint")}</NativeText>}+ >+ <Picker<string | null>+ label={label("presets")}+ selection={custom ? CUSTOM : preference}+ onSelectionChange={(next) => {+ if (next === CUSTOM)+ select(parseUserBubblePreference(lastCustom ?? pickerSeed(preference)));+ else if (next) select(next as UserBubblePreference);+ }}+ modifiers={[pickerStyle("inline"), labelsHidden()]}+ testID="settings.userBubble.presets"+ >+ {USER_BUBBLE_PRESETS.map((id) => {+ const swatch = resolveUserBubbleColors(id, mode);+ return (+ <HStack key={id} spacing={spacing.md} modifiers={[tag(id)]}>+ <Circle+ modifiers={[+ SWATCH,+ foregroundStyle(+ swatch?.background ?? colors.surfaceElevated,+ ),+ strokeBorder({+ color: swatch?.border ?? colors.border,+ shape: "circle",+ style: { lineWidth: 1 },+ }),+ ]}+ />+ <NativeText>{label(id)}</NativeText>+ </HStack>+ );+ })}+ <HStack spacing={spacing.md} modifiers={[tag(CUSTOM)]}>+ <Circle+ modifiers={[+ SWATCH,+ custom && bubble+ ? foregroundStyle(bubble.background)+ : foregroundStyle({+ type: "angularGradient",+ colors: RAINBOW,+ center: { x: 0.5, y: 0.5 },+ }),+ strokeBorder({+ color: custom && bubble ? bubble.border : colors.border,+ shape: "circle",+ style: { lineWidth: 1 },+ }),+ ]}+ />+ <NativeText>{label("custom")}</NativeText>+ </HStack>+ </Picker>+ {custom ? (+ // 尺寸交给原生行决定(含系统行内边距),RN 只填满这一行;maxWidth 取大数撑满行宽。+ <HStack modifiers={[frame({ maxWidth: 10000, height: HUE_ROW_HEIGHT })]}>+ <RNHostView>+ <View style={styles.hueRow}>+ <UserBubbleHueSlider+ label={label("hue")}+ value={draft ?? preference}+ onDragChange={setDragging}+ onChange={setDraft}+ onChangeEnd={(hex) => {+ setDraft(null);+ setLastCustom(hex);+ select(parseUserBubblePreference(hex));+ }}+ />+ </View>+ </RNHostView>+ </HStack>+ ) : null}+ </Section>+ </Form>+ </Host>+ </SafeAreaView>+ );+}++const makeStyles = (colors: ThemeColors) =>+ StyleSheet.create({+ screen: { flex: 1, backgroundColor: colors.surface },+ preview: {+ gap: spacing.lg,+ paddingHorizontal: spacing.xl,+ paddingTop: spacing.lg,+ paddingBottom: spacing.sm,+ },+ // 与 MessageRenderer 的 bubble + bubbleCompact + userBubble 一致(示例是单行短句,+ // 真实对话里走 compact 密度),预览即实际效果;那边改样式时这里要同步。+ bubble: {+ alignSelf: "flex-end",+ maxWidth: "86%",+ paddingHorizontal: spacing.md,+ paddingVertical: spacing.sm,+ borderRadius: radius.container,+ borderWidth: StyleSheet.hairlineWidth,+ backgroundColor: colors.surfaceElevated,+ borderColor: colors.border,+ },+ message: {+ color: colors.textPrimary,+ fontSize: typeScale.bodyLarge,+ lineHeight: lineHeight.bodyLarge,+ fontWeight: fontWeight.regular,+ },+ form: { flex: 1, backgroundColor: colors.surface },+ hueRow: { flex: 1, justifyContent: "center" },+ });diff --git a/apps/mobile/src/settings/UserBubblePage.tsx b/apps/mobile/src/settings/UserBubblePage.tsxnew file mode 100644index 0000000000..082445a86b--- /dev/null+++ b/apps/mobile/src/settings/UserBubblePage.tsx@@ -0,0 +1,6 @@+import { Redirect } from "expo-router";++/** 原生气泡设置页只在 iOS 提供;其它平台在设置页内用面板调整,误入时回到设置。 */+export function UserBubblePage() {+ return <Redirect href="/settings" />;+}diff --git a/apps/mobile/src/settings/UserBubbleSettings.ios.tsx b/apps/mobile/src/settings/UserBubbleSettings.ios.tsxnew file mode 100644index 0000000000..5edd2a40e6--- /dev/null+++ b/apps/mobile/src/settings/UserBubbleSettings.ios.tsx@@ -0,0 +1,24 @@+import { useTranslation } from "react-i18next";+import { ActionInfoRow } from "@/session/SettingsGroupRows";+import { useUserBubbleAppearance } from "@/theme/userBubblePreference";+import { useGuardedPush } from "@/utils/useGuardedPush";++/** iOS 设置行:复用设置页的进入子页行,点按推入原生「我的消息气泡颜色」页。 */+export function UserBubbleSettings() {+ const { t } = useTranslation();+ const push = useGuardedPush();+ const { preference } = useUserBubbleAppearance();+ const title = t("settings.appearance.userBubble.title");+ const value = t(+ `settings.appearance.userBubble.${preference.startsWith("#") ? "custom" : preference}`,+ );+ return (+ <ActionInfoRow+ accessibilityLabel={`${title}: ${value}`}+ label={title}+ onPress={() => push("/settings/user-bubble")}+ testID="settings.userBubble.open"+ value={value}+ />+ );+}diff --git a/apps/mobile/src/settings/UserBubbleSettings.tsx b/apps/mobile/src/settings/UserBubbleSettings.tsxnew file mode 100644index 0000000000..d0a359eb56--- /dev/null+++ b/apps/mobile/src/settings/UserBubbleSettings.tsx@@ -0,0 +1,301 @@+import { useState } from "react";+import {+ Alert,+ Pressable,+ StyleSheet,+ View,+ useWindowDimensions,+} from "react-native";+import { Check } from "lucide-react-native";+import { useTranslation } from "react-i18next";+import { useSafeAreaInsets } from "react-native-safe-area-context";+import {+ USER_BUBBLE_PRESETS,+ bubbleHueColor,+ parseUserBubblePreference,+ resolveUserBubbleColors,+ userBubbleSeed,+ type UserBubblePreference,+} from "@cindy/maker-shared";+import { Text, TextInput } from "@/components/AppText";+import { MainWindowActionButton } from "@/components/MobilePrimitives";+import { ActionInfoRow } from "@/session/SettingsGroupRows";+import { SheetModal } from "@/session/SheetModal";+import { SheetSurface } from "@/session/SheetSurface";+import {+ computeContextSheetSnapHeights,+ type ContextSheetSnap,+} from "@/session/contextSheetModel";+import {+ useTheme,+ useThemedStyles,+ type ThemeColors,+ fontWeight,+ iconSize,+ lineHeight,+ radius,+ spacing,+ typeScale,+} from "@/theme";+import { useUserBubbleAppearance } from "@/theme/userBubblePreference";++export function UserBubbleSettings() {+ const { t } = useTranslation();+ const { colors } = useTheme();+ const styles = useThemedStyles(makeStyles);+ const {+ preference,+ setPreference,+ mode,+ colors: bubble,+ } = useUserBubbleAppearance();+ const [open, setOpen] = useState(false);+ const [snap, setSnap] = useState<ContextSheetSnap>("full");+ const [customOpen, setCustomOpen] = useState(false);+ const [hex, setHex] = useState(() =>+ userBubbleSeed(preference === "default" ? "blue" : preference)!,+ );+ const insets = useSafeAreaInsets();+ const { height } = useWindowDimensions();+ const label = (name: string) => t(`settings.appearance.userBubble.${name}`);+ const select = (next: UserBubblePreference) => {+ void setPreference(next).catch(() =>+ Alert.alert(label("title"), label("saveFailed")),+ );+ };+ return (+ <>+ <ActionInfoRow+ accessibilityLabel={`${label("title")}: ${label(preference.startsWith("#") ? "custom" : preference)}`}+ label={label("title")}+ onPress={() => {+ setHex(+ userBubbleSeed(preference === "default" ? "blue" : preference)!,+ );+ setCustomOpen(preference.startsWith("#"));+ setSnap("full");+ setOpen(true);+ }}+ testID="settings.userBubble.open"+ value={label(preference.startsWith("#") ? "custom" : preference)}+ />+ <SheetModal+ visible={open}+ onBackdropPress={() => setOpen(false)}+ onRequestClose={() => setOpen(false)}+ >+ <SheetSurface+ title={label("title")}+ onClose={() => setOpen(false)}+ snap={snap}+ onSnapChange={setSnap}+ bottomInset={insets.bottom}+ heights={computeContextSheetSnapHeights({+ safeAreaTopInset: insets.top,+ screenHeight: height,+ })}+ testID="settings.userBubble.sheet"+ >+ <View style={styles.content}>+ <View style={styles.preview}>+ <View+ testID="settings.userBubble.preview"+ style={[+ styles.bubble,+ bubble && {+ backgroundColor: bubble.background,+ borderColor: bubble.border,+ },+ ]}+ >+ <Text style={styles.message}>{label("sampleUser")}</Text>+ </View>+ <Text style={styles.message}>{label("sampleAssistant")}</Text>+ </View>+ <View style={styles.grid}>+ {USER_BUBBLE_PRESETS.map((id) => {+ const palette = resolveUserBubbleColors(id, mode);+ return (+ <Pressable+ key={id}+ accessibilityRole="radio"+ accessibilityLabel={label(id)}+ accessibilityState={{ checked: preference === id }}+ testID={"settings.userBubble." + id}+ onPress={() => select(id)}+ style={styles.option}+ >+ <View+ style={[+ styles.swatch,+ {+ backgroundColor:+ palette?.background ?? colors.surfaceElevated,+ borderColor:+ preference === id+ ? colors.textPrimary+ : (palette?.border ?? colors.border),+ },+ ]}+ >+ {preference === id && (+ <Check size={iconSize.md} color={colors.textPrimary} />+ )}+ </View>+ <Text style={styles.optionLabel}>{label(id)}</Text>+ </Pressable>+ );+ })}+ </View>+ <MainWindowActionButton+ action={{+ label: label("custom"),+ active: customOpen,+ onPress: () => setCustomOpen(!customOpen),+ testID: "settings.userBubble.custom",+ }}+ />+ {customOpen && (+ <View style={styles.custom}>+ <View style={styles.hues}>+ {Array.from({ length: 12 }, (_, i) =>+ bubbleHueColor(i * 30),+ ).map((color) => (+ <Pressable+ key={color}+ accessibilityRole="button"+ accessibilityLabel={label("custom") + " " + color}+ onPress={() => {+ setHex(color);+ select(parseUserBubblePreference(color));+ }}+ style={styles.hueTarget}+ >+ <View+ style={[+ styles.hue,+ {+ backgroundColor: color,+ borderColor: colors.border,+ },+ ]}+ />+ </Pressable>+ ))}+ </View>+ <View style={styles.hexRow}>+ <TextInput+ accessibilityLabel={label("hex")}+ value={hex}+ onChangeText={setHex}+ maxLength={7}+ autoCapitalize="none"+ autoCorrect={false}+ style={styles.input}+ testID="settings.userBubble.hex"+ />+ <MainWindowActionButton+ action={{+ label: label("apply"),+ disabled: !/^#[\da-f]{6}$/i.test(hex),+ onPress: () => select(parseUserBubblePreference(hex)),+ }}+ />+ </View>+ </View>+ )}+ <Text style={styles.hint}>{label("hint")}</Text>+ <MainWindowActionButton+ action={{+ label: label("reset"),+ onPress: () => select("default"),+ }}+ />+ </View>+ </SheetSurface>+ </SheetModal>+ </>+ );+}++const makeStyles = (colors: ThemeColors) =>+ StyleSheet.create({+ content: { gap: spacing.lg, padding: spacing.lg },+ preview: {+ padding: spacing.md,+ gap: spacing.lg,+ backgroundColor: colors.surface,+ borderRadius: radius.container,+ },+ // 与 MessageRenderer 的 bubble + bubbleCompact + userBubble 一致,预览即实际效果。+ bubble: {+ alignSelf: "flex-end",+ maxWidth: "86%",+ paddingHorizontal: spacing.md,+ paddingVertical: spacing.sm,+ borderRadius: radius.container,+ borderWidth: StyleSheet.hairlineWidth,+ backgroundColor: colors.surfaceElevated,+ borderColor: colors.border,+ },+ message: {+ color: colors.textPrimary,+ fontSize: typeScale.bodyLarge,+ lineHeight: lineHeight.bodyLarge,+ fontWeight: fontWeight.regular,+ },+ grid: { flexDirection: "row", flexWrap: "wrap", rowGap: spacing.md },+ option: {+ width: "33.33%",+ alignItems: "center",+ gap: spacing.sm,+ paddingVertical: spacing.xs,+ },+ swatch: {+ width: 44,+ height: 44,+ borderRadius: radius.pill,+ borderWidth: 1,+ alignItems: "center",+ justifyContent: "center",+ },+ optionLabel: {+ color: colors.textPrimary,+ fontSize: typeScale.body,+ lineHeight: lineHeight.body,+ fontWeight: fontWeight.medium,+ },+ custom: { gap: spacing.md },+ hues: { flexDirection: "row", flexWrap: "wrap" },+ hueTarget: {+ width: "16.66%",+ minHeight: 44,+ alignItems: "center",+ justifyContent: "center",+ },+ hue: {+ width: 28,+ height: 28,+ borderRadius: radius.pill,+ borderWidth: StyleSheet.hairlineWidth,+ },+ hexRow: { flexDirection: "row", alignItems: "center", gap: spacing.sm },+ input: {+ flex: 1,+ minHeight: 44,+ paddingHorizontal: spacing.md,+ borderRadius: radius.pill,+ borderWidth: StyleSheet.hairlineWidth,+ borderColor: colors.border,+ backgroundColor: colors.surfaceElevated,+ color: colors.textPrimary,+ fontSize: typeScale.body,+ fontWeight: fontWeight.regular,+ },+ hint: {+ color: colors.textSecondary,+ fontSize: typeScale.footnote,+ lineHeight: lineHeight.caption,+ fontWeight: fontWeight.regular,+ },+ });diff --git a/apps/mobile/src/theme/userBubblePreference.ts b/apps/mobile/src/theme/userBubblePreference.tsnew file mode 100644index 0000000000..8616b3b779--- /dev/null+++ b/apps/mobile/src/theme/userBubblePreference.ts@@ -0,0 +1,72 @@+import { useEffect, useSyncExternalStore } from "react";+import AsyncStorage from "@react-native-async-storage/async-storage";+import {+ parseUserBubblePreference,+ resolveUserBubbleColors,+ type UserBubblePreference,+} from "@cindy/maker-shared";+import { useTheme } from "./ThemeProvider";++const key = "cindy.mobile.user-bubble.v1";+let current: UserBubblePreference = "default";+let loaded: Promise<void> | undefined;+let revision = 0;+let writes = Promise.resolve();+const listeners = new Set<() => void>();+function notify() {+ listeners.forEach((listener) => listener());+}+function subscribe(listener: () => void) {+ listeners.add(listener);+ return () => {+ listeners.delete(listener);+ };+}+function load() {+ if (!loaded) {+ const initialRevision = revision;+ loaded = AsyncStorage.getItem(key)+ .then((raw) => {+ if (initialRevision === revision) {+ current = parseUserBubblePreference(raw);+ notify();+ }+ })+ .catch(() => undefined);+ }+ return loaded;+}+export function saveUserBubblePreference(+ value: UserBubblePreference,+): Promise<void> {+ const next = parseUserBubblePreference(value);+ revision += 1;+ current = next;+ notify();+ const write = writes+ .catch(() => undefined)+ .then(() =>+ next === "default"+ ? AsyncStorage.removeItem(key)+ : AsyncStorage.setItem(key, next),+ );+ writes = write;+ return write;+}+export function useUserBubbleAppearance() {+ const { mode } = useTheme();+ const preference = useSyncExternalStore(+ subscribe,+ () => current,+ () => "default" as const,+ );+ useEffect(() => {+ void load();+ }, []);+ return {+ preference,+ setPreference: saveUserBubblePreference,+ mode,+ colors: resolveUserBubbleColors(preference, mode),+ };+}diff --git a/docs/design-rules/DESIGN.md b/docs/design-rules/DESIGN.mdindex 751a561198..28546c0924 100644--- a/docs/design-rules/DESIGN.md+++ b/docs/design-rules/DESIGN.md@@ -194,6 +194,14 @@ motion; inspect the complete action and loop boundary before accepting an asset.用户确认的任务标签色板为红、橙、黄、绿、蓝、紫、灰、粉、珊瑚、青、靛蓝、白共十二色。只用于标签色球与编辑色板,表示用户分类,不表示任务运行状态。色球为圆形、细描边,选中时勾位于球内;白色在 Light/Dark 中均保持白色,用独立深色勾保证对比度。Desktop 使用 `task-tag-*` 语义 token;Mobile 使用对应 `taskTag*` 色板字段。默认面板只显示选择列表,添加或编辑后才显示名称和两行六列色板,不显示双击编辑提示。+### Personal message bubble colors (Mobile, 2026-10-12)++手机版设置提供「我的消息气泡颜色」:默认继续跟随现有主题,另有初稿、晨光、灵感、梦境、夜猫、项圈六个预设和自定义颜色。名称取自 Cindy 自身的设定(创作的一天、黑猫与红项圈),不使用公司名或游戏 IP;各语言意译,不逐字翻译。此项是用户主动选择的个性化例外,只作用于用户消息正文气泡与设置预览,不染色 Agent 回复、系统卡片或页面背景。偏好仅保存在本机;选「默认」即删除 override。桌面端暂未提供。++颜色由 packages/maker-shared/src/userBubbleAppearance.ts 在运行期按 light/dark 生成背景、前景与描边,属于治理合同 §3.4 的运行时派生值,消费者只用该结果,不把用户输入直接拼进样式。预设柔化较强;自定义色着色更明显,深色模式的着色上限保证正文对比度不低于 7:1。项圈取品牌红色相,只用柔化后的浅红调,不直接使用品牌红。++iOS 使用原生 Form 二级页:顶部是与真实气泡同款的预览,预设与「自定义颜色」同在一个 inline Picker 勾选列表;选中自定义才在其下展开一条彩虹色带(仅选色相,外形对齐系统滑块)。iOS 没有比系统 ColorPicker 更轻的自由选色组件,系统取色面板因功能过多不采用。拖动时只更新本页预览,松手才保存。Android 沿用设置页内的面板实现。+### Chip & Button NeutralsSmall interactive chips (button backgrounds, tag pills, avatar fills, selected-nav pills) sit outside the layer system — they're foreground elements, not background layers.diff --git a/docs/design-rules/design-decision-log.md b/docs/design-rules/design-decision-log.mdindex 37a2784ea1..2cceabafea 100644--- a/docs/design-rules/design-decision-log.md+++ b/docs/design-rules/design-decision-log.md@@ -866,3 +866,7 @@ Switch 解耦。插件插槽挂载同一个媒体组件,不再维护单独拖- **危险红字**:保持 `--error-fg`,高亮时不换 `--error-fg-strong`。原话「红字先保持现在的红(B)吧。」浅色灰高亮上只有 4.23:1(不透明)/ 4.15:1(毛玻璃),低于 4.5:1(换 `-strong` 为 7.27 / 7.14:1),用户知情后选择保留。- 以上为 Design Lab 对比与 dev 实例实测,不代表 Windows 实机已验收。++### 2026-10-12: 手机版「我的消息气泡颜色」++用户在 iPhone 试用包上多轮调整后决定先提交手机版,桌面端暂不提交。预设定名为初稿、晨光、灵感、梦境、夜猫、项圈:「心动」是公司名不用;夹在灵感与梦境之间、辨识度不足的青绿色去掉,改为取品牌红色相的「项圈」。系统 ColorPicker 面板过重、大圆盘不好看,改为点选「自定义颜色」后才展开的彩虹色带。自定义色放宽柔化(浅色 30%、深色 18%),深色上限受 7:1 对比度约束。设置预览的描边与内边距按真实气泡(#5787 后的 border、compact 密度)对齐。实现见 DESIGN §2「Personal message bubble colors」。本条记录方案裁决,不代表最终视觉验收。diff --git a/docs/design-rules/design-inventory.md b/docs/design-rules/design-inventory.mdindex f27d3fff7c..d810e3f80c 100644--- a/docs/design-rules/design-inventory.md+++ b/docs/design-rules/design-inventory.md@@ -66,7 +66,7 @@| `mobile.plugins` | mobile | 插件目录、页面与原生交互 | app/plugins.tsx | AdaptiveWindow, AnchoredPullDownMenu, AnchoredPullDownMenu.android, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ClipboardSharedTaskPrompt, ComposerNativeRow, ComposerNativeRow.ios, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, DeviceLinkContext, FoldTouchpad, HomeEntryProvider, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, HomeNativeStackHeader, HtmlBrowserChrome, HtmlBrowserChrome.ios, HtmlFileReader, HtmlWebsiteBrowser, ImageLightbox, IncomingShareBridge, MobileAgentMark, MobileAgentSwitcher, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileModelPickerList, MobileModelPickerList.ios, MobileOutboxBridge, MobilePermissionPickerList, MobilePermissionPickerList.ios, MobilePrimitives, MobileProviderMark, ModelOptionsSheetView, ModelOptionsSheetView.ios, ModelPickerNativeHeader, ModelPickerNativeHeader.ios, ModelPickerSheet, NativeBottomSheet, NativeBottomSheet.android, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PluginDetailView, PluginDetailView.ios, PluginDirectoryPicker, PluginDirectoryView, PluginDirectoryView.ios, PluginMediaViewer, PluginNativeIntent, PluginPage, PluginScheduleDraft, PluginTaskPicker, PluginTaskPickerView, PluginTaskPickerView.ios, PluginToolChips, PluginsScreen, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, RemoteSourceMark, ResidentHomeList, SharedTaskAdmissionDialog, SharedTaskScreen, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, UnifiedModelPickerSheet, UnifiedModelPickerView, UnifiedModelPickerView.ios, _layout, gestureHandler, mediaPlayerWebView, peerFileTransport, plugins, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/plugins.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileAgentMark.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.android.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/plugins/PluginDetailView.ios.tsx, apps/mobile/src/plugins/PluginDetailView.tsx, apps/mobile/src/plugins/PluginDirectoryPicker.tsx, apps/mobile/src/plugins/PluginDirectoryView.ios.tsx, apps/mobile/src/plugins/PluginDirectoryView.tsx, apps/mobile/src/plugins/PluginMediaViewer.tsx, apps/mobile/src/plugins/PluginNativeIntent.tsx, apps/mobile/src/plugins/PluginPage.tsx, apps/mobile/src/plugins/PluginScheduleDraft.tsx, apps/mobile/src/plugins/PluginTaskPicker.tsx, apps/mobile/src/plugins/PluginTaskPickerView.ios.tsx, apps/mobile/src/plugins/PluginTaskPickerView.tsx, apps/mobile/src/plugins/PluginToolChips.tsx, apps/mobile/src/plugins/PluginsScreen.tsx, apps/mobile/src/plugins/pluginPageHtml.ts, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ClipboardSharedTaskPrompt.tsx, apps/mobile/src/session/ComposerNativeRow.ios.tsx, apps/mobile/src/session/ComposerNativeRow.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/HtmlBrowserChrome.ios.tsx, apps/mobile/src/session/HtmlBrowserChrome.tsx, apps/mobile/src/session/HtmlFileReader.tsx, apps/mobile/src/session/HtmlWebsiteBrowser.tsx, apps/mobile/src/session/ImageLightbox.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileAgentSwitcher.tsx, apps/mobile/src/session/MobileModelPickerList.ios.tsx, apps/mobile/src/session/MobileModelPickerList.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/MobilePermissionPickerList.ios.tsx, apps/mobile/src/session/MobilePermissionPickerList.tsx, apps/mobile/src/session/MobileProviderMark.tsx, apps/mobile/src/session/ModelOptionsSheetView.ios.tsx, apps/mobile/src/session/ModelOptionsSheetView.tsx, apps/mobile/src/session/ModelPickerNativeHeader.ios.tsx, apps/mobile/src/session/ModelPickerNativeHeader.tsx, apps/mobile/src/session/ModelPickerSheet.tsx, apps/mobile/src/session/NativeBottomSheet.android.tsx, apps/mobile/src/session/NativeBottomSheet.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/RemoteSourceMark.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SharedTaskAdmissionDialog.tsx, apps/mobile/src/session/SharedTaskScreen.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/UnifiedModelPickerSheet.tsx, apps/mobile/src/session/UnifiedModelPickerView.ios.tsx, apps/mobile/src/session/UnifiedModelPickerView.tsx, apps/mobile/src/session/mediaPlayerWebView.tsx, apps/mobile/src/session/mediaPlayerWebViewHtml.ts, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 246 | 87 || `mobile.remote-desktop` | mobile | 远程桌面 | app/devices/desktop/[deviceId].tsx | AdaptiveWindow, AnchoredPullDownMenu, AnchoredPullDownMenu.android, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ClipboardSharedTaskPrompt, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, DeviceLinkContext, FoldTouchpad, HomeEntryProvider, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, NativeBottomSheet, NativeBottomSheet.android, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, ResidentHomeList, SharedTaskAdmissionDialog, SharedTaskScreen, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, [deviceId], _layout, gestureHandler, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/devices/desktop/[deviceId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.android.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ClipboardSharedTaskPrompt.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeBottomSheet.android.tsx, apps/mobile/src/session/NativeBottomSheet.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SharedTaskAdmissionDialog.tsx, apps/mobile/src/session/SharedTaskScreen.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 214 | 55 || `mobile.resources` | mobile | 远程资源列表与详情 | app/resources/[collectionId].tsx / app/resources/[collectionId]/[resourceId].tsx | AdaptiveWindow, AnchoredPullDownMenu, AnchoredPullDownMenu.android, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ClipboardSharedTaskPrompt, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, DeviceLinkContext, FoldTouchpad, HomeEntryProvider, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, HomeNativeStackHeader, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, NativeBottomSheet, NativeBottomSheet.android, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteCompanionAvatar, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, ResidentHomeList, SharedTaskAdmissionDialog, SharedTaskScreen, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, [collectionId], [resourceId], _layout, gestureHandler, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/resources/[collectionId].tsx, apps/mobile/app/resources/[collectionId]/[resourceId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/RemoteCompanionAvatar.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.android.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ClipboardSharedTaskPrompt.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeBottomSheet.android.tsx, apps/mobile/src/session/NativeBottomSheet.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SharedTaskAdmissionDialog.tsx, apps/mobile/src/session/SharedTaskScreen.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 214 | 62 |-| `mobile.settings` | mobile | 设置(含调试与日志上传可见入口) | app/settings.tsx / app/settings/device-name.tsx / app/settings/voice-dictionary.tsx | AdaptiveWindow, AnchoredPullDownMenu, AnchoredPullDownMenu.android, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ClipboardSharedTaskPrompt, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, DeviceLinkContext, FoldTouchpad, HomeEntryProvider, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, HomeNativeStackHeader, IncomingShareBridge, MobileChoicePickerList, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, MobileUserAvatar, NativeBottomSheet, NativeBottomSheet.android, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, ResidentHomeList, SettingsGroupRows, SharedTaskAdmissionDialog, SharedTaskScreen, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, _layout, device-name, gestureHandler, listDisclosureTransition, peerFileTransport, settings, useLocale, voice-dictionary | apps/mobile/app/_layout.tsx, apps/mobile/app/settings.tsx, apps/mobile/app/settings/device-name.tsx, apps/mobile/app/settings/voice-dictionary.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/MobileUserAvatar.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.android.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ClipboardSharedTaskPrompt.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileChoicePickerList.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeBottomSheet.android.tsx, apps/mobile/src/session/NativeBottomSheet.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SettingsGroupRows.tsx, apps/mobile/src/session/SharedTaskAdmissionDialog.tsx, apps/mobile/src/session/SharedTaskScreen.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/listDisclosureTransition.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 214 | 63 |+| `mobile.settings` | mobile | 设置(含调试与日志上传可见入口) | app/settings.tsx / app/settings/device-name.tsx / app/settings/user-bubble.tsx / app/settings/voice-dictionary.tsx | AdaptiveWindow, AnchoredPullDownMenu, AnchoredPullDownMenu.android, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ClipboardSharedTaskPrompt, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, DeviceLinkContext, FoldTouchpad, HomeEntryProvider, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, HomeNativeStackHeader, IncomingShareBridge, MobileChoicePickerList, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, MobileUserAvatar, NativeBottomSheet, NativeBottomSheet.android, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, ResidentHomeList, SettingsGroupRows, SharedTaskAdmissionDialog, SharedTaskScreen, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, UserBubbleHueSlider, UserBubblePage, UserBubblePage.ios, UserBubbleSettings, UserBubbleSettings.ios, _layout, device-name, gestureHandler, listDisclosureTransition, peerFileTransport, settings, useLocale, user-bubble, voice-dictionary | apps/mobile/app/_layout.tsx, apps/mobile/app/settings.tsx, apps/mobile/app/settings/device-name.tsx, apps/mobile/app/settings/user-bubble.tsx, apps/mobile/app/settings/voice-dictionary.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/MobileUserAvatar.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.android.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ClipboardSharedTaskPrompt.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileChoicePickerList.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeBottomSheet.android.tsx, apps/mobile/src/session/NativeBottomSheet.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SettingsGroupRows.tsx, apps/mobile/src/session/SharedTaskAdmissionDialog.tsx, apps/mobile/src/session/SharedTaskScreen.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/listDisclosureTransition.tsx, apps/mobile/src/settings/UserBubbleHueSlider.tsx, apps/mobile/src/settings/UserBubblePage.ios.tsx, apps/mobile/src/settings/UserBubblePage.tsx, apps/mobile/src/settings/UserBubbleSettings.ios.tsx, apps/mobile/src/settings/UserBubbleSettings.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 214 | 71 |### 生产路由覆盖@@ -143,6 +143,7 @@| apps/mobile/app/sessions/[sessionId].tsx | SessionScreen | `mobile.chat.session` || apps/mobile/app/sessions/new.tsx | NewRemoteSessionScreen | `mobile.chat.new` || apps/mobile/app/settings/device-name.tsx | RenameSelfDeviceScreen | `mobile.settings` |+| apps/mobile/app/settings/user-bubble.tsx | UserBubblePage | `mobile.settings` || apps/mobile/app/settings/voice-dictionary.tsx | VoiceDictionaryScreen | `mobile.settings` || apps/mobile/app/settings.tsx | SettingsScreen | `mobile.settings` || apps/mobile/app/shared-session.tsx | SharedSessionScreen | `mobile.chat.sharing` |diff --git a/packages/maker-shared/src/__tests__/userBubbleAppearance.test.ts b/packages/maker-shared/src/__tests__/userBubbleAppearance.test.tsnew file mode 100644index 0000000000..512169c150--- /dev/null+++ b/packages/maker-shared/src/__tests__/userBubbleAppearance.test.ts@@ -0,0 +1,48 @@+import { describe, expect, it } from "vitest";+import {+ USER_BUBBLE_PRESETS,+ parseUserBubblePreference,+ resolveUserBubbleColors,+} from "../userBubbleAppearance";++function luminance(hex: string) {+ const rgb = [1, 3, 5]+ .map((i) => parseInt(hex.slice(i, i + 2), 16) / 255)+ .map((v) => (v <= 0.04045 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4));+ return rgb[0] * 0.2126 + rgb[1] * 0.7152 + rgb[2] * 0.0722;+}+describe("personal message bubble appearance", () => {+ it("leaves default theme values alone and rejects malformed storage values", () => {+ expect(resolveUserBubbleColors("default", "dark")).toBeNull();+ for (const value of [+ null,+ {},+ "unknown",+ "#fff",+ "#000000;url(x)",+ "#zzzzzz",+ ]) {+ expect(parseUserBubblePreference(value)).toBe("default");+ }+ expect(parseUserBubblePreference("#AbCdEf")).toBe("#abcdef");+ });+ it("keeps every preset and extreme custom color readable in both modes", () => {+ for (const mode of ["light", "dark"] as const) {+ for (const preference of [+ ...USER_BUBBLE_PRESETS.slice(1),+ "#000000",+ "#ffffff",+ "#ff0000",+ "#00ff00",+ "#0000ff",+ ] as const) {+ const colors = resolveUserBubbleColors(preference, mode)!;+ const a = luminance(colors.background);+ const b = luminance(colors.foreground);+ expect(+ (Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05),+ ).toBeGreaterThanOrEqual(7);+ }+ }+ });+});diff --git a/packages/maker-shared/src/index.ts b/packages/maker-shared/src/index.tsindex 101e496b68..8d1489dcef 100644--- a/packages/maker-shared/src/index.ts+++ b/packages/maker-shared/src/index.ts@@ -65,3 +65,4 @@ export * from './taskTags';export * from './workingStatus.js';export * from './runningTokenRateHistory.js';+export * from './userBubbleAppearance.js';diff --git a/packages/maker-shared/src/userBubbleAppearance.ts b/packages/maker-shared/src/userBubbleAppearance.tsnew file mode 100644index 0000000000..41917c7cdb--- /dev/null+++ b/packages/maker-shared/src/userBubbleAppearance.ts@@ -0,0 +1,94 @@+/** User-selected bubble appearance. Runtime color derivation; no platform/theme dependencies. */+/** 按色相排列;id 是持久化值,只增不改,显示名走各端 i18n。 */+export const USER_BUBBLE_PRESETS = [+ "default",+ "peach",+ "yellow",+ "sage",+ "blue",+ "lavender",+ "red",+] as const;+export type UserBubblePreset = (typeof USER_BUBBLE_PRESETS)[number];+export type UserBubblePreference = UserBubblePreset | `#${string}`;++const presetHues = {+ peach: 28,+ yellow: 58,+ sage: 135,+ blue: 210,+ lavender: 275,+ // 品牌红 #DF0C27 的色相;气泡只取柔化后的浅红调,不直接使用品牌红本身。+ red: 352,+};++export function parseUserBubblePreference(+ value: unknown,+): UserBubblePreference {+ if (typeof value !== "string") return "default";+ if ((USER_BUBBLE_PRESETS as readonly string[]).includes(value))+ return value as UserBubblePreset;+ return /^#[\da-f]{6}$/i.test(value)+ ? (value.toLowerCase() as `#${string}`)+ : "default";+}++/** Hues are color-picker input; output roles are generated for the current mode. */+export function bubbleHueColor(hue: number): string {+ const h = (((hue % 360) + 360) % 360) / 60;+ const x = 1 - Math.abs((h % 2) - 1);+ const channels =+ h < 1+ ? [1, x, 0]+ : h < 2+ ? [x, 1, 0]+ : h < 3+ ? [0, 1, x]+ : h < 4+ ? [0, x, 1]+ : h < 5+ ? [x, 0, 1]+ : [1, 0, x];+ return toHex(channels.map((v) => Math.round((0.35 + v * 0.45) * 255)));+}+function toHex(rgb: number[]): string {+ return (+ "#" + rgb.map((v) => Math.round(v).toString(16).padStart(2, "0")).join("")+ );+}+function rgb(hex: string): number[] {+ return [1, 3, 5].map((i) => parseInt(hex.slice(i, i + 2), 16));+}+export function userBubbleSeed(+ preference: UserBubblePreference,+): string | null {+ if (preference === "default") return null;+ return preference.startsWith("#")+ ? preference+ : bubbleHueColor(presetHues[preference as keyof typeof presetHues]);+}++/**+ * Presets stay soft; custom colors are tinted more so the chosen hue reads clearly.+ * Dark tint is capped so theme text keeps >= 7:1 contrast even on a white seed.+ */+const tint = {+ preset: { light: 0.16, dark: 0.13 },+ custom: { light: 0.3, dark: 0.18 },+};+export function resolveUserBubbleColors(+ preference: UserBubblePreference,+ mode: "light" | "dark",+) {+ const seed = userBubbleSeed(preference);+ if (!seed) return null;+ const channels = rgb(seed);+ const dark = mode === "dark";+ const strength = tint[preference.startsWith("#") ? "custom" : "preset"][mode];+ const background = toHex(+ channels.map((v) => (dark ? 27 + v * strength : 255 - (255 - v) * strength)),+ );+ const foreground = toHex(Array(3).fill(dark ? 232 : 38));+ const border = toHex(rgb(background).map((v) => (dark ? v + 22 : v - 24)));+ return { background, foreground, border };+}diff --git a/scripts/shared/design-inventory.mjs b/scripts/shared/design-inventory.mjsindex 3f7a8c546a..bac252854a 100644--- a/scripts/shared/design-inventory.mjs+++ b/scripts/shared/design-inventory.mjs@@ -1409,7 +1409,7 @@ export function mobileCatalogSurfaces() {['chat.sharing', '共享任务邀请与成员;供应商分享链接提示', ['shared-session.tsx', 'provider-share.tsx']],['chat.new', '新建任务', ['sessions/new.tsx']],['files', '任务文件与预览', ['files/[sessionId].tsx', 'files/preview/[sessionId].tsx']],- ['settings', '设置(含调试与日志上传可见入口)', ['settings.tsx', 'settings/device-name.tsx', 'settings/voice-dictionary.tsx']],+ ['settings', '设置(含调试与日志上传可见入口)', ['settings.tsx', 'settings/device-name.tsx', 'settings/user-bubble.tsx', 'settings/voice-dictionary.tsx']],['auth', '登录与添加账号', ['(auth)/login.tsx', 'add-account.tsx']],['account-deletion', '账号注销', ['account-deletion.tsx']],];