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): 恢复 iOS 任务列表的 Reanimated 胶囊动画 (#4415)

Dash88f712116574
diff --git a/apps/mobile/src/__tests__/swipeableSessionRowIos.test.tsx b/apps/mobile/src/__tests__/swipeableSessionRowIos.test.tsx
new file mode 100644
index 0000000000..8d6044eb5b
--- /dev/null
+++ b/apps/mobile/src/__tests__/swipeableSessionRowIos.test.tsx
@@ -0,0 +1,209 @@
+// @vitest-environment jsdom
+import React, { act } from "react";
+import { createRoot, type Root } from "react-dom/client";
+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
+import type { SwipeableProps } from "@/platform/gestureHandler";
+import type { RemoteSession } from "@/session/types";
+import { SwipeableSessionRow } from "@/session/SwipeableSessionRow.ios";
+
+const runtime = vi.hoisted(() => ({
+ translation: { value: 0 },
+ props: null as SwipeableProps | null,
+ reset: vi.fn(),
+ close: vi.fn(),
+ timing: vi.fn((value: number) => value),
+ reactions: new Set<() => void>(),
+ styles: [] as Array<() => Record<string, unknown>>,
+}));
+vi.mock("react-native", () => ({
+ View: ({ children }: { children?: React.ReactNode }) => <div>{children}</div>,
+ Pressable: ({ children }: { children?: React.ReactNode }) => (
+ <button>{children}</button>
+ ),
+ StyleSheet: { create: (value: unknown) => value },
+ useWindowDimensions: () => ({ width: 400 }),
+}));
+vi.mock("@/platform/gestureHandler", async () => {
+ const { forwardRef, useImperativeHandle } = await import("react");
+ return {
+ SwipeDirection: { LEFT: "left", RIGHT: "right" },
+ ReanimatedSwipeable: forwardRef((props: SwipeableProps, ref) => {
+ runtime.props = props;
+ useImperativeHandle(ref, () => ({
+ reset: () => {
+ runtime.reset();
+ runtime.translation.value = 0;
+ },
+ close: runtime.close,
+ }));
+ // RNGH renders actions before the parent's passive recycling effect.
+ return (
+ <>
+ {props.renderLeftActions?.(
+ { value: 0 } as never,
+ runtime.translation as never,
+ {} as never,
+ )}
+ {props.renderRightActions?.(
+ { value: 0 } as never,
+ runtime.translation as never,
+ {} as never,
+ )}
+ {props.children}
+ </>
+ );
+ }),
+ };
+});
+vi.mock("react-native-reanimated", async () => {
+ const { useEffect, useRef } = await import("react");
+ return {
+ default: {
+ View: ({ children }: { children?: React.ReactNode }) => (
+ <div>{children}</div>
+ ),
+ },
+ useSharedValue: (value: number) => useRef({ value }).current,
+ useAnimatedStyle: (fn: () => Record<string, unknown>) => {
+ runtime.styles.push(fn);
+ return {};
+ },
+ useAnimatedReaction: (
+ prepare: () => boolean,
+ react: (next: boolean, prev: boolean | null) => void,
+ ) => {
+ const callback = useRef({ prepare, react });
+ callback.current = { prepare, react };
+ useEffect(() => {
+ let previous: boolean | null = null;
+ const step = () => {
+ const next = callback.current.prepare();
+ if (next !== previous) callback.current.react(next, previous);
+ previous = next;
+ };
+ runtime.reactions.add(step);
+ step();
+ return () => {
+ runtime.reactions.delete(step);
+ };
+ }, []);
+ },
+ withTiming: runtime.timing,
+ interpolate: (x: number, [a, b]: number[], [c, d]: number[]) =>
+ c + (d - c) * Math.max(0, Math.min(1, (x - a) / (b - a))),
+ };
+});
+vi.mock("lucide-react-native", () =>
+ Object.fromEntries(
+ ["Archive", "ArchiveRestore", "Ellipsis", "Pin", "PinOff"].map((name) => [
+ name,
+ () => null,
+ ]),
+ ),
+);
+vi.mock("react-i18next", () => ({
+ useTranslation: () => ({ t: (key: string) => key }),
+}));
+vi.mock("@/session/swipeRowRegistry", () => ({
+ pinToggleAction: () => ({ label: "pin" }),
+ statusToggleAction: () => ({ label: "archive", action: "archive" }),
+}));
+vi.mock("@/theme", () => ({
+ iconSize: { swipeAction: 24 },
+ iconStroke: { regular: 2 },
+ useTheme: () => ({ colors: {} }),
+ useThemedStyles: (make: (colors: object) => unknown) => make({}),
+}));
+vi.mock("@/theme/tokens", () => ({
+ radius: { pill: 9999 },
+ spacing: { md: 12 },
+}));
+
+Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true });
+let root: Root;
+const controls = {
+ onArchive: vi.fn(),
+ onTogglePin: vi.fn(),
+ onShowOptions: vi.fn(),
+ registry: { onRowOpen: vi.fn(), onRowClose: vi.fn(), closeOpenRow: vi.fn() },
+};
+function render(id: string) {
+ act(() =>
+ root.render(
+ <SwipeableSessionRow
+ {...controls}
+ session={{ id, status: "active" } as RemoteSession}
+ >
+ row
+ </SwipeableSessionRow>,
+ ),
+ );
+}
+function drag(value: number) {
+ runtime.translation.value = value;
+ runtime.reactions.forEach((step) => step());
+}
+function release(direction: "left" | "right") {
+ act(() => runtime.props?.onSwipeableWillOpen?.(direction as never));
+}
+beforeEach(() => {
+ vi.clearAllMocks();
+ runtime.translation.value = 0;
+ runtime.styles = [];
+ runtime.reactions.clear();
+ root = createRoot(document.createElement("div"));
+});
+afterEach(() => act(() => root.unmount()));
+
+describe("iOS swipe runtime contracts (mocked native boundary)", () => {
+ it.each([
+ ["left", -260, "onArchive"],
+ ["right", 260, "onTogglePin"],
+ ] as const)(
+ "full swipe still works after slot recycling: %s",
+ (direction, value, action) => {
+ render("a");
+ drag(value);
+ render("b");
+ expect(runtime.reset).toHaveBeenCalledOnce();
+ expect(runtime.translation.value).toBe(0);
+ expect(controls.registry.onRowClose).toHaveBeenCalledWith("a");
+ drag(value);
+ release(direction);
+ expect(controls[action]).toHaveBeenCalledExactlyOnceWith(
+ expect.objectContaining({ id: "b" }),
+ );
+ },
+ );
+ it.each([
+ ["left", -260, -100],
+ ["right", 260, 100],
+ ] as const)(
+ "uses release position after dragging back: %s",
+ (direction, peak, end) => {
+ render("a");
+ drag(peak);
+ drag(end);
+ release(direction);
+ expect(controls.onArchive).not.toHaveBeenCalled();
+ expect(controls.onTogglePin).not.toHaveBeenCalled();
+ },
+ );
+ it("keeps layout width responsive in both directions and resets the armed state", () => {
+ render("a");
+ expect(runtime.timing).not.toHaveBeenCalled();
+ drag(160);
+ expect(
+ runtime.styles.map((fn) => fn()).find((s) => s.width === 136),
+ ).toBeDefined();
+ drag(-260);
+ expect(
+ runtime.styles.map((fn) => fn()).find((s) => s.width === 236),
+ ).toBeDefined();
+ drag(-100);
+ expect(
+ runtime.styles.map((fn) => fn()).filter((s) => s.width === 56),
+ ).toHaveLength(2);
+ expect(runtime.timing.mock.calls.map((call) => call[0])).toEqual([1, 0]);
+ });
+});
diff --git a/apps/mobile/src/session/SwipeableSessionRow.ios.tsx b/apps/mobile/src/session/SwipeableSessionRow.ios.tsx
new file mode 100644
index 0000000000..e524eab6f9
--- /dev/null
+++ b/apps/mobile/src/session/SwipeableSessionRow.ios.tsx
@@ -0,0 +1,509 @@
+/**
+ * SwipeableSessionRow —— 首页会话行的 iOS 式滑动操作包装。
+ *
+ * 交互契约(2026-07-07 与产品确认):
+ * - 右滑露出「置顶/取消置顶」(按 pinnedAt 切换),全滑(超过屏宽 55%)松手直接触发;
+ * - 左滑露出「选项」+「归档」,全滑=归档(归档按钮越过阈值时扩展盖满,预告松手即触发);
+ * - 删除不做滑动直达,只在「选项」菜单里(带系统 Alert 确认),由页面层承接;
+ * - 同一时间只允许一行滑开:互斥由页面级 SwipeRowRegistry 驱动(开新关旧、滚动关行)。
+ *
+ * 视觉对齐新 iOS(26)的滑动操作形态(2026-07-07 产品反馈迭代两轮):
+ * 按钮是**悬浮的圆形图标钮**(radius.pill,从圆起步),随露出进度淡入 + 缩放弹入;
+ * 继续拖动时主按钮从圆**拉长成胶囊**(宽度跟手、圆角恒为半高),图标钉在行边缘一侧跟手,
+ * 全滑阈值后主按钮拉伸盖满整个露出区。非全高色块、非方角浮块。
+ *
+ * 实现要点(RNGH ReanimatedSwipeable 的测量机制决定的结构约束):
+ * - 面板 snap 宽度由 render*Actions 返回内容的布局宽度决定(库用 marker 元素测量),
+ * 因此外层「壳」必须定宽;会随拖动伸缩的按钮全部 position:'absolute',不参与测量;
+ * - friction / overshootFriction 保持默认 1:面板 1:1 跟手,overshoot 不衰减,
+ * 全滑阈值才够得着(overshootFriction>1 时 translation 被压缩,永远到不了阈值);
+ * - 全滑判定在 onSwipeableWillOpen(松手后的 JS 回调)同步读 translation,不在
+ * worklet 拖动中触发 —— 手指还按着时行被移除会拆手势树。
+ */
+import { memo, useCallback, useEffect, useRef, type ReactNode } from "react";
+import { Pressable, StyleSheet, View, useWindowDimensions } from "react-native";
+import {
+ ReanimatedSwipeable as Swipeable,
+ SwipeDirection,
+ type SwipeableMethods,
+} from "@/platform/gestureHandler";
+import Animated, {
+ interpolate,
+ useAnimatedReaction,
+ useAnimatedStyle,
+ useSharedValue,
+ withTiming,
+ type SharedValue,
+} from "react-native-reanimated";
+import {
+ Archive,
+ ArchiveRestore,
+ Ellipsis,
+ Pin,
+ PinOff,
+} from "lucide-react-native";
+import { useTranslation } from "react-i18next";
+import {
+ pinToggleAction,
+ statusToggleAction,
+ type SwipeRowRegistry,
+} from "@/session/swipeRowRegistry";
+import type { RemoteSession } from "@/session/types";
+import {
+ iconSize,
+ iconStroke,
+ useTheme,
+ useThemedStyles,
+ type ThemeColors,
+} from "@/theme";
+import { radius, spacing } from "@/theme/tokens";
+
+/** 圆形按钮直径(静置态是正圆,拖长后变胶囊;78 高的行内上下各留 11)。 */
+const BUTTON_SIZE = 56;
+/** 按钮与行边缘 / 屏幕边缘 / 相邻按钮的间距(iOS 26 的悬浮圆钮留白比色块时代更宽)。 */
+const BUTTON_GAP = spacing.md;
+/** 左面板(置顶):gap + 圆 + gap;右面板(选项 + 归档):gap + 圆 + gap + 圆 + gap。 */
+const LEFT_PANEL_WIDTH = BUTTON_GAP * 2 + BUTTON_SIZE;
+const RIGHT_PANEL_WIDTH = BUTTON_GAP * 3 + BUTTON_SIZE * 2;
+/** 全滑触发阈值:位移超过屏宽的这个比例,松手即执行(iOS Mail 惯例的 50-60% 区间)。 */
+const FULL_SWIPE_RATIO = 0.55;
+/** 「归档」按钮越过全滑阈值时扩展盖满右侧面板的过渡时长。 */
+const ARM_ANIMATION_MS = 150;
+const ICON_SIZE = iconSize.swipeAction;
+
+/**
+ * 页面级滑动控制 bundle:registry + 三个动作回调打包成一个稳定引用(useMemo),
+ * 供 ProjectRow / AutomationGroupChildren 等嵌套渲染路径向下透传——不提供时对应
+ * 行退化为不可滑动(选择态或不需要手势的调用点保持原行为)。
+ */
+export interface SessionSwipeControls {
+ registry: SwipeRowRegistry;
+ onTogglePin(session: RemoteSession): void;
+ onArchive(session: RemoteSession): void;
+ onShowOptions(session: RemoteSession): void;
+}
+
+export interface SwipeableSessionRowProps {
+ /** 目标会话:id 作互斥 key,pinnedAt 决定右滑按钮图标(Pin/PinOff)与动作方向。 */
+ session: RemoteSession;
+ registry: SwipeRowRegistry;
+ /**
+ * 回调统一带 session 入参:页面层可以传稳定引用(useCallback / setState),
+ * renderItem 里不必为每行现造闭包(否则 memo 的浅比较永远失败,review P2)。
+ */
+ /** 右滑按钮 / 右滑全滑:置顶或取消置顶(实现方负责先关行再发 RPC 的时序)。 */
+ onTogglePin(session: RemoteSession): void;
+ /** 左滑「归档」按钮 / 左滑全滑(不关行:乐观更新立即把行移出列表,失败由页面层回滚收口)。 */
+ onArchive(session: RemoteSession): void;
+ /** 左滑「选项」按钮:先关行,再由页面层弹出操作菜单。 */
+ onShowOptions(session: RemoteSession): void;
+ testID?: string;
+ children: ReactNode;
+}
+
+function SwipeableSessionRowInner({
+ session,
+ registry,
+ onTogglePin,
+ onArchive,
+ onShowOptions,
+ testID,
+ children,
+}: SwipeableSessionRowProps) {
+ const rowKey = session.id;
+ const pinnedAt = session.pinnedAt;
+ const styles = useThemedStyles(makeStyles);
+ const { colors } = useTheme();
+ const { width: windowWidth } = useWindowDimensions();
+ const fullSwipeThreshold = windowWidth * FULL_SWIPE_RATIO;
+
+ const methodsRef = useRef<SwipeableMethods | null>(null);
+ // render*Actions 的回调参数是库内部的 translation SharedValue,渲染期存进 ref,
+ // 供松手回调(handleWillOpen)同步读取当前位移做全滑判定。
+ const translationRef = useRef<SharedValue<number> | null>(null);
+ const previousRowKeyRef = useRef(rowKey);
+
+ // Project child windowing reuses a small pool of native swipe rows. When a
+ // slot starts representing another session, clear the previous gesture
+ // position immediately so an open/partially-open row cannot follow the slot
+ // onto the new session. The registry cleanup below separately retires the
+ // previous session id.
+ useEffect(() => {
+ if (previousRowKeyRef.current === rowKey) return;
+ methodsRef.current?.reset();
+ // The child has already rendered this row's action callbacks. Keep its
+ // SharedValue: reset() clears the position, not the SharedValue identity.
+ previousRowKeyRef.current = rowKey;
+ }, [rowKey]);
+
+ // 行卸载(归档/删除后随数据消失、列表虚拟化回收)时注销;registry 内部只清
+ // 「当前记录仍是自己」的条目,不会误伤已经接管的新行。
+ useEffect(
+ () => () => {
+ registry.onRowClose(rowKey);
+ },
+ [registry, rowKey],
+ );
+
+ const close = useCallback(() => {
+ methodsRef.current?.close();
+ }, []);
+
+ const handleOpenStartDrag = useCallback(() => {
+ registry.onRowOpen(rowKey, close);
+ }, [registry, rowKey, close]);
+
+ const handleClose = useCallback(() => {
+ registry.onRowClose(rowKey);
+ }, [registry, rowKey]);
+
+ // 全滑判定:松手瞬间(库在 release 时派发 WillOpen)读当前位移,超阈值即触发。
+ // direction 语义:RIGHT = 右滑(露出左面板/置顶),LEFT = 左滑(露出右面板/归档)。
+ const handleWillOpen = useCallback(
+ (direction: (typeof SwipeDirection)[keyof typeof SwipeDirection]) => {
+ const translation = translationRef.current;
+ if (!translation) return;
+ if (direction === SwipeDirection.RIGHT) {
+ if (translation.value >= fullSwipeThreshold) {
+ // 置顶后行只重排不消失:先关再发,避免重排后行停在打开态。
+ close();
+ onTogglePin(session);
+ }
+ return;
+ }
+ if (-translation.value >= fullSwipeThreshold) {
+ // 归档刻意不先关:乐观更新立即把行移出列表(卸载即收行);失败由页面层回滚 + Alert 收口。
+ onArchive(session);
+ }
+ },
+ [fullSwipeThreshold, close, onTogglePin, onArchive, session],
+ );
+
+ const handlePinPress = useCallback(() => {
+ close();
+ onTogglePin(session);
+ }, [close, onTogglePin, session]);
+
+ const handleOptionsPress = useCallback(() => {
+ close();
+ onShowOptions(session);
+ }, [close, onShowOptions, session]);
+
+ const handleArchivePress = useCallback(() => {
+ onArchive(session);
+ }, [onArchive, session]);
+
+ const pinned = !!pinnedAt;
+ const pinLabel = pinToggleAction(pinnedAt).label;
+
+ const renderLeftActions = useCallback(
+ (_progress: SharedValue<number>, translation: SharedValue<number>) => {
+ translationRef.current = translation;
+ return (
+ <PinActionPanel
+ label={pinLabel}
+ onPress={handlePinPress}
+ pinned={pinned}
+ styles={styles}
+ testID={testID ? `${testID}.pinAction` : undefined}
+ translation={translation}
+ />
+ );
+ },
+ [pinLabel, pinned, handlePinPress, styles, testID],
+ );
+
+ const statusToggle = statusToggleAction(session.status);
+
+ const renderRightActions = useCallback(
+ (_progress: SharedValue<number>, translation: SharedValue<number>) => {
+ translationRef.current = translation;
+ return (
+ <RightActionsPanel
+ archiveLabel={statusToggle.label}
+ archived={statusToggle.action === "restore"}
+ fullSwipeThreshold={fullSwipeThreshold}
+ onArchive={handleArchivePress}
+ onOptions={handleOptionsPress}
+ styles={styles}
+ testID={testID}
+ translation={translation}
+ />
+ );
+ },
+ [
+ statusToggle,
+ fullSwipeThreshold,
+ handleArchivePress,
+ handleOptionsPress,
+ styles,
+ testID,
+ ],
+ );
+
+ return (
+ <Swipeable
+ ref={methodsRef}
+ childrenContainerStyle={{ backgroundColor: colors.surface }}
+ containerStyle={{ backgroundColor: colors.surface }}
+ onSwipeableClose={handleClose}
+ onSwipeableOpenStartDrag={handleOpenStartDrag}
+ onSwipeableWillOpen={handleWillOpen}
+ renderLeftActions={renderLeftActions}
+ renderRightActions={renderRightActions}
+ testID={testID}
+ >
+ {children}
+ </Swipeable>
+ );
+}
+
+/**
+ * 右滑露出的「置顶」浮块:定宽壳决定 snap 位;按钮绝对定位、随露出进度淡入 + 微缩放
+ * 弹入;overshoot / 全滑时按钮保持圆角横向拉伸(宽度 = 位移 - 两侧 gap),图标钉在
+ * 行边缘一侧跟手(iOS Mail 同款)。
+ */
+function PinActionPanel({
+ label,
+ onPress,
+ pinned,
+ styles,
+ testID,
+ translation,
+}: {
+ label: string;
+ onPress(): void;
+ pinned: boolean;
+ styles: SwipeStyles;
+ testID?: string;
+ translation: SharedValue<number>;
+}) {
+ const { colors } = useTheme();
+ const buttonStyle = useAnimatedStyle(() => {
+ const revealed = Math.max(0, translation.value);
+ const progress = Math.min(1, revealed / LEFT_PANEL_WIDTH);
+ return {
+ opacity: interpolate(progress, [0.15, 0.7], [0, 1], "clamp"),
+ transform: [
+ { scale: interpolate(progress, [0.15, 1], [0.5, 1], "clamp") },
+ ],
+ // 静置是正圆;继续拖动从圆拉长成胶囊(radius.pill 让圆角恒为半高)。
+ width: Math.max(BUTTON_SIZE, revealed - BUTTON_GAP * 2),
+ };
+ });
+ const IconComponent = pinned ? PinOff : Pin;
+ return (
+ <View style={styles.pinShell}>
+ <Animated.View style={[styles.pinButton, buttonStyle]}>
+ <Pressable
+ accessibilityLabel={label}
+ accessibilityRole="button"
+ onPress={onPress}
+ style={styles.actionPressable}
+ testID={testID}
+ >
+ <View style={styles.pinIconWrap}>
+ <IconComponent
+ color={colors.swipeActionText}
+ size={ICON_SIZE}
+ strokeWidth={iconStroke.regular}
+ />
+ </View>
+ </Pressable>
+ </Animated.View>
+ </View>
+ );
+}
+
+/**
+ * 左滑露出的「选项 + 归档」浮块:定宽壳(152)决定 snap 位;两块绝对定位锚右缘,
+ * 随露出进度错峰淡入(靠屏缘的「归档」先现身);overshoot 时「选项」跟着行边缘
+ * 外扩保持贴行间距;越过全滑阈值「归档」150ms 拉伸盖满(预告松手即归档)、「选项」淡出。
+ */
+function RightActionsPanel({
+ archiveLabel,
+ archived,
+ fullSwipeThreshold,
+ onArchive,
+ onOptions,
+ styles,
+ testID,
+ translation,
+}: {
+ archiveLabel: string;
+ archived: boolean;
+ fullSwipeThreshold: number;
+ onArchive(): void;
+ onOptions(): void;
+ styles: SwipeStyles;
+ testID?: string;
+ translation: SharedValue<number>;
+}) {
+ const { colors } = useTheme();
+ const { t } = useTranslation();
+ const StatusIcon = archived ? ArchiveRestore : Archive;
+ // 挂载时同步落初值,只在真正跨越阈值时启动 timing。若每个面板挂载都执行
+ // withTiming(0),大项目从完整首帧切到窗口行时会留下仍在更新已卸载 Fabric tag
+ // 的空动画,最终用 Reanimated 警告栈堵住 Android 主线程。
+ const armedProgress = useSharedValue(0);
+ useAnimatedReaction(
+ () => -translation.value >= fullSwipeThreshold,
+ (next, previous) => {
+ if (previous === null) {
+ armedProgress.value = next ? 1 : 0;
+ return;
+ }
+ if (next !== previous) {
+ armedProgress.value = withTiming(next ? 1 : 0, {
+ duration: ARM_ANIMATION_MS,
+ });
+ }
+ },
+ );
+
+ const optionsStyle = useAnimatedStyle(() => {
+ const revealed = Math.max(0, -translation.value);
+ const progress = Math.min(1, revealed / RIGHT_PANEL_WIDTH);
+ return {
+ // 错峰弹入(靠内的「选项」后现身);armed 时淡出让位给拉伸的「归档」。
+ opacity:
+ interpolate(progress, [0.3, 0.8], [0, 1], "clamp") *
+ (1 - armedProgress.value),
+ // overshoot(revealed > 面板宽)时跟着行边缘外扩,保持「贴着行」的间距不脱节。
+ right: Math.max(
+ BUTTON_GAP * 2 + BUTTON_SIZE,
+ revealed - BUTTON_SIZE - BUTTON_GAP,
+ ),
+ transform: [
+ { scale: interpolate(progress, [0.3, 1], [0.5, 1], "clamp") },
+ ],
+ };
+ });
+ const archiveStyle = useAnimatedStyle(() => {
+ const revealed = Math.max(0, -translation.value);
+ const progress = Math.min(1, revealed / RIGHT_PANEL_WIDTH);
+ return {
+ opacity: interpolate(progress, [0.08, 0.45], [0, 1], "clamp"),
+ transform: [
+ { scale: interpolate(progress, [0.08, 0.6], [0.5, 1], "clamp") },
+ ],
+ // armed 时从正圆拉长成胶囊铺满整个露出区(保留两侧 gap),盖过「选项」。
+ width:
+ BUTTON_SIZE +
+ Math.max(0, revealed - BUTTON_GAP * 2 - BUTTON_SIZE) *
+ armedProgress.value,
+ };
+ });
+
+ return (
+ <View style={styles.rightShell}>
+ <Animated.View style={[styles.optionsButton, optionsStyle]}>
+ <Pressable
+ accessibilityLabel={t("session.row.moreOptions")}
+ accessibilityRole="button"
+ onPress={onOptions}
+ style={styles.actionPressable}
+ testID={testID ? `${testID}.optionsAction` : undefined}
+ >
+ <View style={styles.rightIconWrap}>
+ <Ellipsis
+ color={colors.swipeActionText}
+ size={ICON_SIZE}
+ strokeWidth={iconStroke.regular}
+ />
+ </View>
+ </Pressable>
+ </Animated.View>
+ <Animated.View style={[styles.archiveButton, archiveStyle]}>
+ <Pressable
+ accessibilityLabel={archiveLabel}
+ accessibilityRole="button"
+ onPress={onArchive}
+ style={styles.actionPressable}
+ testID={testID ? `${testID}.archiveAction` : undefined}
+ >
+ <View style={styles.rightIconWrap}>
+ <StatusIcon
+ color={colors.swipeActionText}
+ size={ICON_SIZE}
+ strokeWidth={iconStroke.regular}
+ />
+ </View>
+ </Pressable>
+ </Animated.View>
+ </View>
+ );
+}
+
+type SwipeStyles = ReturnType<typeof makeStyles>;
+
+const makeStyles = (colors: ThemeColors) =>
+ StyleSheet.create({
+ pinShell: {
+ // 定宽壳:库按内容布局宽度测 snap 位,壳宽即打开吸附宽度;伸缩按钮不参与测量。
+ // overshoot 时按钮要伸出壳外(裁剪交给库的整行 wrapper),Android 需显式 visible。
+ overflow: "visible",
+ width: LEFT_PANEL_WIDTH,
+ },
+ pinButton: {
+ backgroundColor: colors.swipeActionPin,
+ // radius.pill:正圆起步,拉长后自动变胶囊(圆角恒为半高),iOS 26 同款。
+ borderRadius: radius.pill,
+ height: BUTTON_SIZE,
+ left: BUTTON_GAP,
+ // 行高内垂直居中(面板 wrapper 与行等高):50% 锚点 + 负半径回拉,不写死行高。
+ marginTop: -BUTTON_SIZE / 2,
+ overflow: "hidden",
+ position: "absolute",
+ top: "50%",
+ },
+ pinIconWrap: {
+ // 图标钉在按钮尾缘(紧贴行内容边缘),按钮拉长成胶囊时图标跟着行走(iOS Mail 同款)。
+ alignItems: "center",
+ bottom: 0,
+ justifyContent: "center",
+ position: "absolute",
+ right: 0,
+ top: 0,
+ width: BUTTON_SIZE,
+ },
+ rightShell: {
+ overflow: "visible",
+ width: RIGHT_PANEL_WIDTH,
+ },
+ optionsButton: {
+ backgroundColor: colors.swipeActionNeutral,
+ borderRadius: radius.pill,
+ height: BUTTON_SIZE,
+ marginTop: -BUTTON_SIZE / 2,
+ overflow: "hidden",
+ position: "absolute",
+ top: "50%",
+ width: BUTTON_SIZE,
+ },
+ archiveButton: {
+ backgroundColor: colors.swipeActionArchive,
+ borderRadius: radius.pill,
+ height: BUTTON_SIZE,
+ marginTop: -BUTTON_SIZE / 2,
+ overflow: "hidden",
+ position: "absolute",
+ right: BUTTON_GAP,
+ top: "50%",
+ },
+ rightIconWrap: {
+ // 图标钉在按钮首缘(紧贴行内容一侧):归档拉伸盖满时图标不跳中心,停在行边附近。
+ alignItems: "center",
+ bottom: 0,
+ justifyContent: "center",
+ left: 0,
+ position: "absolute",
+ top: 0,
+ width: BUTTON_SIZE,
+ },
+ actionPressable: {
+ flex: 1,
+ },
+ });
+
+export const SwipeableSessionRow = memo(SwipeableSessionRowInner);
diff --git a/docs/design-rules/design-inventory.md b/docs/design-rules/design-inventory.md
index 2f60534e9a..958d2dd21c 100644
--- a/docs/design-rules/design-inventory.md
+++ b/docs/design-rules/design-inventory.md
@@ -9,7 +9,7 @@
本区块由 `scripts/design-inventory.mjs` 生成,请勿手改。
重新生成:`pnpm design:inventory`;校验:`pnpm check:design-inventory`。
-计数快照日期:2026-09-12。生成命令:`pnpm design:inventory`。裸颜色匹配与 `scripts/hardcoded-color-audit.mjs` 共用 `scripts/shared/hardcoded-color-match.mjs`(HEX / RGB / HSL / OKLCH 等字面通道),两者在共享 matcher 内统一排除纯语义包装、注释及 PR 编号;数值颜色函数还需位于样式属性、CSS 声明/函数或任意值语境,普通文案字符串里的颜色函数文本不计入;字面 fallback 仍计入——语义 token 消费与注释引用不是迁移债务;裸圆角为粗粒度(`rounded*` class、`border-radius:` 与 React style 对象的 `borderRadius:`)。Token 计数为样式源里 `var(--token)` / `hsl(var(--token)` 的去重 ID 数;Mobile 的 ThemeColors / typeScale 等 RN 属性不计入此列,不能将 0 解释为未使用 Token。
+计数快照日期:2026-09-13。生成命令:`pnpm design:inventory`。裸颜色匹配与 `scripts/hardcoded-color-audit.mjs` 共用 `scripts/shared/hardcoded-color-match.mjs`(HEX / RGB / HSL / OKLCH 等字面通道),两者在共享 matcher 内统一排除纯语义包装、注释及 PR 编号;数值颜色函数还需位于样式属性、CSS 声明/函数或任意值语境,普通文案字符串里的颜色函数文本不计入;字面 fallback 仍计入——语义 token 消费与注释引用不是迁移债务;裸圆角为粗粒度(`rounded*` class、`border-radius:` 与 React style 对象的 `borderRadius:`)。Token 计数为样式源里 `var(--token)` / `hsl(var(--token)` 的去重 ID 数;Mobile 的 ThemeColors / typeScale 等 RN 属性不计入此列,不能将 0 解释为未使用 Token。
登记 surface 数:50。平台包含 Desktop 与 Mobile;静态入口发现不表示已迁移或已实机验证。
@@ -58,9 +58,9 @@
| `mobile.chat.session` | mobile | 任务内容与输入 | app/sessions/[sessionId].tsx | AnnotationBurnInWebView, AppText, AuthContext, AuthorizationMessageCard, BlurBackdrop, CenteredScreen, ChatFileChipMenuSheet, CompanionMessageCard, ComposerAttachmentTray, ComposerKeyboardAvoidingView, ComposerRichInput, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheetGoalView, ContextSheetMediaViews, ConversationSearchFilterSheet, ConversationShareSvg, ConversationShareWebView, DeviceLinkContext, FailedScheduleNotice, HomeGlassMenuPanel, HomeNativeStackHeader, HomeSearchBar, ImageLightbox, InlineQueueSection, InlineQuoteChip, InlineReferenceChip, InteractionPanel, MarkdownBlockContent, MessageActionSheet, MessageRenderer, MobileAgentMark, MobileAgentSwitcher, MobileBoundaryNotice, MobileComposerInputRow, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileModelPickerList, MobilePermissionPickerList, MobilePrimitives, MobileProviderMark, ModelOptionsSheetView, ModelPickerSheet, NativePullDownMenu, NativeSwitch, PaperPlaneIcon, PendingSendBubble, PiSessionTreeSheet, PlanModeChip, PushNotificationsBridge, QuietSyncIndicator, QuoteCapsule, RewindPreviewPanel, SentInlineAtomBody, SessionListDrawer, SessionMenuSheet, SessionTailBanner, SessionUsageSummary, ShareMessageCheckbox, ShareSelectAllButton, ShareSelectionBar, SheetModal, SheetSurface, SimpleStackHeader, SlowSendNotice, StartupSplashOverlay, StreamingStatusText, ThemeProvider, VoiceRecordingPill, [sessionId], _layout, gestureHandler, mathWebView, mediaPlayerWebView, mermaidWebView, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/sessions/[sessionId].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/PaperPlaneIcon.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.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/session/AnnotationBurnInWebView.tsx, apps/mobile/src/session/AuthorizationMessageCard.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ChatFileChipMenuSheet.tsx, apps/mobile/src/session/CompanionMessageCard.tsx, apps/mobile/src/session/ComposerAttachmentTray.tsx, apps/mobile/src/session/ComposerKeyboardAvoidingView.tsx, apps/mobile/src/session/ComposerRichInput.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/ContextSheetGoalView.tsx, apps/mobile/src/session/ContextSheetMediaViews.tsx, apps/mobile/src/session/ConversationSearchFilterSheet.tsx, apps/mobile/src/session/ConversationShareSvg.tsx, apps/mobile/src/session/ConversationShareWebView.tsx, apps/mobile/src/session/FailedScheduleNotice.tsx, apps/mobile/src/session/HomeGlassMenuPanel.tsx, apps/mobile/src/session/HomeSearchBar.tsx, apps/mobile/src/session/ImageLightbox.tsx, apps/mobile/src/session/InlineQueueSection.tsx, apps/mobile/src/session/InlineQuoteChip.tsx, apps/mobile/src/session/InlineReferenceChip.tsx, apps/mobile/src/session/InteractionPanel.tsx, apps/mobile/src/session/MarkdownBlockContent.tsx, apps/mobile/src/session/MessageActionSheet.tsx, apps/mobile/src/session/MessageRenderer.tsx, apps/mobile/src/session/MobileAgentSwitcher.tsx, apps/mobile/src/session/MobileBoundaryNotice.tsx, apps/mobile/src/session/MobileComposerInputRow.tsx, apps/mobile/src/session/MobileModelPickerList.tsx, apps/mobile/src/session/MobilePermissionPickerList.tsx, apps/mobile/src/session/MobileProviderMark.tsx, apps/mobile/src/session/ModelOptionsSheetView.tsx, apps/mobile/src/session/ModelPickerSheet.tsx, apps/mobile/src/session/PendingSendBubble.tsx, apps/mobile/src/session/PiSessionTreeSheet.tsx, apps/mobile/src/session/PlanModeChip.tsx, apps/mobile/src/session/QuoteCapsule.tsx, apps/mobile/src/session/RewindPreviewPanel.tsx, apps/mobile/src/session/SentInlineAtomBody.tsx, apps/mobile/src/session/SessionListDrawer.tsx, apps/mobile/src/session/SessionMenuSheet.tsx, apps/mobile/src/session/SessionTailBanner.tsx, apps/mobile/src/session/SessionUsageSummary.tsx, apps/mobile/src/session/ShareMessageCheckbox.tsx, apps/mobile/src/session/ShareSelectAllButton.tsx, apps/mobile/src/session/ShareSelectionBar.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/SlowSendNotice.tsx, apps/mobile/src/session/StreamingStatusText.tsx, apps/mobile/src/session/VoiceRecordingPill.tsx, apps/mobile/src/session/composerRichInputHtml.ts, apps/mobile/src/session/conversationShareWebViewHtml.ts, apps/mobile/src/session/mathWebView.tsx, apps/mobile/src/session/mathWebViewHtml.ts, apps/mobile/src/session/mediaPlayerWebView.tsx, apps/mobile/src/session/mediaPlayerWebViewHtml.ts, apps/mobile/src/session/mermaidWebView.tsx, apps/mobile/src/session/mermaidWebViewHtml.ts, apps/mobile/src/session/selectableMarkdownHtml.ts, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts | 7 | 203 | 188 |
| `mobile.companions.direct` | mobile | 伙伴私聊回看 | app/companions/direct/[threadId].tsx | AppText, AuthContext, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, DeviceLinkContext, HomeNativeStackHeader, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, NativePullDownMenu, NativeSwitch, PushNotificationsBridge, QuietSyncIndicator, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, [threadId], _layout, gestureHandler, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/companions/direct/[threadId].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/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.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/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts | 0 | 170 | 14 |
| `mobile.device-management` | mobile | 设备管理 | app/devices/manage.tsx / app/devices/manage/[deviceId].tsx | AppText, AuthContext, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, DeviceInformationFields, DeviceInformationFields.ios, DeviceLinkContext, DeviceManagementDialogs, DeviceManagementList, DeviceManagementList.ios, HomeNativeStackHeader, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, NativePullDownMenu, NativeSwitch, PushNotificationsBridge, QuietSyncIndicator, RenameDeviceModal, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, [deviceId], _layout, gestureHandler, manage, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/devices/manage.tsx, apps/mobile/app/devices/manage/[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/DeviceInformationFields.ios.tsx, apps/mobile/src/device-link/DeviceInformationFields.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/DeviceManagementDialogs.tsx, apps/mobile/src/device-link/DeviceManagementList.ios.tsx, apps/mobile/src/device-link/DeviceManagementList.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.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/session/RenameDeviceModal.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts | 0 | 170 | 17 |
-| `mobile.devices` | mobile | 主机详情 | app/devices/[deviceId].tsx | AccountSwitcherSheet, AppText, AuthContext, AutomationTimerIcon, BlurBackdrop, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, ConversationSearchFilterSheet, DeviceLinkContext, HomeChromeDrawer, HomeChromeFrost, HomeGlassMenuPanel, HomeHeaderGlassButton, HomeNativeStackHeader, HomeProjectMachineLabel, HomeSearchBar, MobileAgentMark, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, MobileVendorIcon, NativePullDownMenu, NativeSwitch, PushNotificationsBridge, QuietSyncIndicator, RemoteAccessGuide, RenameSessionModal, SessionActionSheet, SessionOptionsExpoSheet, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, SwipeableSessionRow, ThemeProvider, [deviceId], _layout, gestureHandler, index, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/devices/[deviceId].tsx, apps/mobile/app/devices/index.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/MobileVendorIcon.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/RemoteAccessGuide.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.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/session/AccountSwitcherSheet.tsx, apps/mobile/src/session/AutomationTimerIcon.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ConversationSearchFilterSheet.tsx, apps/mobile/src/session/HomeChromeDrawer.tsx, apps/mobile/src/session/HomeChromeFrost.tsx, apps/mobile/src/session/HomeGlassMenuPanel.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/HomeProjectMachineLabel.tsx, apps/mobile/src/session/HomeSearchBar.tsx, apps/mobile/src/session/RenameSessionModal.tsx, apps/mobile/src/session/SessionActionSheet.tsx, apps/mobile/src/session/SessionOptionsExpoSheet.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/SwipeableSessionRow.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts | 0 | 170 | 57 |
+| `mobile.devices` | mobile | 主机详情 | app/devices/[deviceId].tsx | AccountSwitcherSheet, AppText, AuthContext, AutomationTimerIcon, BlurBackdrop, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, ConversationSearchFilterSheet, DeviceLinkContext, HomeChromeDrawer, HomeChromeFrost, HomeGlassMenuPanel, HomeHeaderGlassButton, HomeNativeStackHeader, HomeProjectMachineLabel, HomeSearchBar, MobileAgentMark, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, MobileVendorIcon, NativePullDownMenu, NativeSwitch, PushNotificationsBridge, QuietSyncIndicator, RemoteAccessGuide, RenameSessionModal, SessionActionSheet, SessionOptionsExpoSheet, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, SwipeableSessionRow, SwipeableSessionRow.ios, ThemeProvider, [deviceId], _layout, gestureHandler, index, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/devices/[deviceId].tsx, apps/mobile/app/devices/index.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/MobileVendorIcon.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/RemoteAccessGuide.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.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/session/AccountSwitcherSheet.tsx, apps/mobile/src/session/AutomationTimerIcon.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ConversationSearchFilterSheet.tsx, apps/mobile/src/session/HomeChromeDrawer.tsx, apps/mobile/src/session/HomeChromeFrost.tsx, apps/mobile/src/session/HomeGlassMenuPanel.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/HomeProjectMachineLabel.tsx, apps/mobile/src/session/HomeSearchBar.tsx, apps/mobile/src/session/RenameSessionModal.tsx, apps/mobile/src/session/SessionActionSheet.tsx, apps/mobile/src/session/SessionOptionsExpoSheet.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/SwipeableSessionRow.ios.tsx, apps/mobile/src/session/SwipeableSessionRow.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts | 0 | 170 | 60 |
| `mobile.files` | mobile | 任务文件与预览 | app/files/[sessionId].tsx / app/files/preview/[sessionId].tsx | AppText, AuthContext, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, DeviceLinkContext, HtmlFileReader, ImageLightbox, MarkdownFileReader, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, PushNotificationsBridge, QuietSyncIndicator, StartupSplashOverlay, ThemeProvider, [sessionId], _layout, gestureHandler, mediaPlayerWebView, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/files/[sessionId].tsx, apps/mobile/app/files/preview/[sessionId].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/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/session/HtmlFileReader.tsx, apps/mobile/src/session/ImageLightbox.tsx, apps/mobile/src/session/MarkdownFileReader.tsx, apps/mobile/src/session/mathWebViewHtml.ts, apps/mobile/src/session/mediaPlayerWebView.tsx, apps/mobile/src/session/mediaPlayerWebViewHtml.ts, apps/mobile/src/session/selectableMarkdownHtml.ts, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts | 0 | 202 | 36 |
-| `mobile.home` | mobile | 主机与资源首页 | app/index.tsx / app/devices/index.tsx | AccountSwitcherSheet, AppText, AuthContext, AutomationTimerIcon, BlurBackdrop, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, ConversationSearchFilterSheet, DeviceLinkContext, HomeChromeDrawer, HomeChromeFrost, HomeGlassMenuPanel, HomeHeaderGlassButton, HomeNativeStackHeader, HomeProjectMachineLabel, HomeSearchBar, MobileAgentMark, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, MobileVendorIcon, NativePullDownMenu, NativeSwitch, PushNotificationsBridge, QuietSyncIndicator, RemoteAccessGuide, RenameSessionModal, SessionActionSheet, SessionOptionsExpoSheet, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, SwipeableSessionRow, ThemeProvider, _layout, gestureHandler, index, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/devices/index.tsx, apps/mobile/app/index.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/MobileVendorIcon.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/RemoteAccessGuide.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.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/session/AccountSwitcherSheet.tsx, apps/mobile/src/session/AutomationTimerIcon.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ConversationSearchFilterSheet.tsx, apps/mobile/src/session/HomeChromeDrawer.tsx, apps/mobile/src/session/HomeChromeFrost.tsx, apps/mobile/src/session/HomeGlassMenuPanel.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/HomeProjectMachineLabel.tsx, apps/mobile/src/session/HomeSearchBar.tsx, apps/mobile/src/session/RenameSessionModal.tsx, apps/mobile/src/session/SessionActionSheet.tsx, apps/mobile/src/session/SessionOptionsExpoSheet.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/SwipeableSessionRow.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts | 0 | 170 | 53 |
+| `mobile.home` | mobile | 主机与资源首页 | app/index.tsx / app/devices/index.tsx | AccountSwitcherSheet, AppText, AuthContext, AutomationTimerIcon, BlurBackdrop, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, ConversationSearchFilterSheet, DeviceLinkContext, HomeChromeDrawer, HomeChromeFrost, HomeGlassMenuPanel, HomeHeaderGlassButton, HomeNativeStackHeader, HomeProjectMachineLabel, HomeSearchBar, MobileAgentMark, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, MobileVendorIcon, NativePullDownMenu, NativeSwitch, PushNotificationsBridge, QuietSyncIndicator, RemoteAccessGuide, RenameSessionModal, SessionActionSheet, SessionOptionsExpoSheet, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, SwipeableSessionRow, SwipeableSessionRow.ios, ThemeProvider, _layout, gestureHandler, index, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/devices/index.tsx, apps/mobile/app/index.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/MobileVendorIcon.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/RemoteAccessGuide.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.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/session/AccountSwitcherSheet.tsx, apps/mobile/src/session/AutomationTimerIcon.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ConversationSearchFilterSheet.tsx, apps/mobile/src/session/HomeChromeDrawer.tsx, apps/mobile/src/session/HomeChromeFrost.tsx, apps/mobile/src/session/HomeGlassMenuPanel.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/HomeProjectMachineLabel.tsx, apps/mobile/src/session/HomeSearchBar.tsx, apps/mobile/src/session/RenameSessionModal.tsx, apps/mobile/src/session/SessionActionSheet.tsx, apps/mobile/src/session/SessionOptionsExpoSheet.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/SwipeableSessionRow.ios.tsx, apps/mobile/src/session/SwipeableSessionRow.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts | 0 | 170 | 56 |
| `mobile.overlay.connection-startup` | mobile | 根布局挂载的启动与连接反馈 | app/_layout.tsx → StartupSplashOverlay / ConnectionNoticeProvider;各页面 ConnectionBanner | AppText, AuthContext, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, ConnectionNoticeProvider, DeviceLinkContext, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, PushNotificationsBridge, QuietSyncIndicator, StartupSplashOverlay, ThemeProvider, _layout, gestureHandler, useLocale | apps/mobile/app/_layout.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/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts | 0 | 170 | 13 |
| `mobile.remote-desktop` | mobile | 远程桌面 | app/devices/desktop/[deviceId].tsx | AppText, AuthContext, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, DeviceLinkContext, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, NativePullDownMenu, NativeSwitch, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopIcons, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, StartupSplashOverlay, ThemeProvider, [deviceId], _layout, gestureHandler, 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/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/gestureHandler.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.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/RemoteDesktopIcons.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/viewerHtml.ts, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts | 0 | 170 | 41 |
| `mobile.resources` | mobile | 远程资源列表与详情 | app/resources/[collectionId].tsx / app/resources/[collectionId]/[resourceId].tsx | AppText, AuthContext, CenteredScreen, ConnectionBanner, ConnectionNoticeOverlay, DeviceLinkContext, HomeNativeStackHeader, MobileLoginHandoffContext, MobileLoginHandoffStage, MobilePrimitives, NativePullDownMenu, NativeSwitch, PushNotificationsBridge, QuietSyncIndicator, RemoteCompanionAvatar, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, [collectionId], [resourceId], _layout, gestureHandler, 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/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.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/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts | 0 | 170 | 18 |