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): 处理审查意见——偏好未就绪不播动画、保留麦克风命中区、胶囊内容裁剪、补控制器测试

kirozeng5e56c057c29e
diff --git a/apps/mobile/app/sessions/[sessionId].tsx b/apps/mobile/app/sessions/[sessionId].tsx
index 920515c4c9..850e5af19e 100644
--- a/apps/mobile/app/sessions/[sessionId].tsx
+++ b/apps/mobile/app/sessions/[sessionId].tsx
@@ -6799,7 +6799,7 @@ export default function SessionScreen() {
</>
);
const renderComposerVoiceButton = (buttonStyle?: StyleProp<ViewStyle>) => (
- <VoicePillWidthFrame width={voiceRecordingTimer.pillWidth}>
+ <VoicePillWidthFrame hitSlop={COMPOSER_CONTROL_HIT_SLOP} width={voiceRecordingTimer.pillWidth}>
<RouteActionButton
accessibilityLabel={voiceIsListening ? t('session.common.voiceStopRecording') : t('session.screen.voiceStartInput')}
accessibilityHint={composerLayout.voice.disabledReason ?? composerSendUnavailableReason ?? undefined}
@@ -12345,8 +12345,9 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({
justifyContent: 'center',
width: 28,
},
- // 语音按钮撑满 VoicePillWidthFrame,宽度由外框的过渡驱动。
- voicePillFill: { width: '100%' },
+ // 语音按钮撑满 VoicePillWidthFrame,宽度由外框的过渡驱动;裁剪保证展开初段
+ // 红点 + 计时尚未装下时不会溢出盖住左邻控件。
+ voicePillFill: { overflow: 'hidden', width: '100%' },
composerInlineToolButton: {
alignItems: 'center',
backgroundColor: colors.sheetActionSurface,
diff --git a/apps/mobile/app/sessions/new.tsx b/apps/mobile/app/sessions/new.tsx
index 80e8a30eac..5fdb4d2db5 100644
--- a/apps/mobile/app/sessions/new.tsx
+++ b/apps/mobile/app/sessions/new.tsx
@@ -3882,7 +3882,7 @@ export default function NewRemoteSessionScreen() {
) : null;
const renderComposerVoiceButton = (buttonStyle?: StyleProp<ViewStyle>) => (
- <VoicePillWidthFrame width={voiceRecordingTimer.pillWidth}>
+ <VoicePillWidthFrame hitSlop={10} width={voiceRecordingTimer.pillWidth}>
<Pressable
accessibilityLabel={voiceIsListening ? t('session.common.voiceStopRecording') : t('session.new.voiceInput')}
accessibilityRole="button"
@@ -7287,8 +7287,9 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({
paddingHorizontal: spacing.sm,
paddingVertical: spacing.sm,
},
- // 语音按钮撑满 VoicePillWidthFrame,宽度由外框的过渡驱动。
- voicePillFill: { width: '100%' },
+ // 语音按钮撑满 VoicePillWidthFrame,宽度由外框的过渡驱动;裁剪保证展开初段
+ // 红点 + 计时尚未装下时不会溢出盖住左邻控件。
+ voicePillFill: { overflow: 'hidden', width: '100%' },
composerIconButton: {
alignItems: 'center',
backgroundColor: colors.sheetActionSurface,
diff --git a/apps/mobile/src/__tests__/listDisclosureController.test.ts b/apps/mobile/src/__tests__/listDisclosureController.test.ts
new file mode 100644
index 0000000000..d659b83ff6
--- /dev/null
+++ b/apps/mobile/src/__tests__/listDisclosureController.test.ts
@@ -0,0 +1,127 @@
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
+
+import {
+ DISCLOSURE_WINDOW_TAIL_MS,
+ commitRegisteredLevel,
+ createDisclosureController,
+ detachDisclosureScope,
+ openDisclosureWindow,
+ runDisclosure,
+ type DisclosureLevel,
+} from '@/session/listDisclosureController';
+
+/** 模拟 ListDisclosureScope:setLevel 记录请求的档位,登记由测试手动触发。 */
+function mountScope() {
+ const controller = createDisclosureController();
+ const levels: DisclosureLevel[] = [];
+ controller.setLevel = (level) => { levels.push(level); };
+ return { controller, levels };
+}
+
+describe('list disclosure controller', () => {
+ beforeEach(() => vi.useFakeTimers());
+ afterEach(() => vi.useRealTimers());
+
+ it('applies immediately and opens no window when motion is not allowed (reduced motion or preference unknown)', () => {
+ const { controller, levels } = mountScope();
+ const apply = vi.fn();
+ runDisclosure(controller, apply, 1, false);
+ expect(apply).toHaveBeenCalledTimes(1);
+ expect(levels).toEqual([]);
+ expect(controller.timer).toBeNull();
+ expect(openDisclosureWindow(controller, 1, false)).toBe(false);
+ });
+
+ it('applies immediately when the list is not mounted', () => {
+ const controller = createDisclosureController();
+ const apply = vi.fn();
+ runDisclosure(controller, apply, 1, true);
+ expect(apply).toHaveBeenCalledTimes(1);
+ expect(controller.pending).toEqual([]);
+ });
+
+ it('opens the window and holds the change until rows have registered their animation', () => {
+ const { controller, levels } = mountScope();
+ const apply = vi.fn();
+ runDisclosure(controller, apply, 1, true);
+ expect(levels).toEqual([1]);
+ expect(apply).not.toHaveBeenCalled();
+ commitRegisteredLevel(controller, 1);
+ expect(apply).toHaveBeenCalledTimes(1);
+ expect(controller.pending).toEqual([]);
+ });
+
+ it('applies straight away once the window is already registered, but queues behind pending changes to keep order', () => {
+ const { controller } = mountScope();
+ const order: string[] = [];
+ runDisclosure(controller, () => order.push('first'), 1, true);
+ runDisclosure(controller, () => order.push('second'), 1, true);
+ expect(order).toEqual([]);
+ commitRegisteredLevel(controller, 1);
+ expect(order).toEqual(['first', 'second']);
+ runDisclosure(controller, () => order.push('third'), 1, true);
+ expect(order).toEqual(['first', 'second', 'third']);
+ });
+
+ it('raises the level for nested toggles and waits for the higher registration', () => {
+ const { controller, levels } = mountScope();
+ const plain = vi.fn();
+ const nested = vi.fn();
+ runDisclosure(controller, plain, 1, true);
+ commitRegisteredLevel(controller, 1);
+ runDisclosure(controller, nested, 2, true);
+ expect(levels).toEqual([1, 2]);
+ expect(nested).not.toHaveBeenCalled();
+ commitRegisteredLevel(controller, 2);
+ expect(nested).toHaveBeenCalledTimes(1);
+ expect(plain).toHaveBeenCalledTimes(1);
+ });
+
+ it('prepare (press-in) opens the window without applying anything, and the later change runs at once', () => {
+ const { controller, levels } = mountScope();
+ expect(openDisclosureWindow(controller, 1, true)).toBe(true);
+ commitRegisteredLevel(controller, 1);
+ expect(levels).toEqual([1]);
+ const apply = vi.fn();
+ runDisclosure(controller, apply, 1, true);
+ expect(apply).toHaveBeenCalledTimes(1);
+ expect(levels).toEqual([1]);
+ });
+
+ it('closes the window after the tail and resets, and every new change extends the tail', () => {
+ const { controller, levels } = mountScope();
+ runDisclosure(controller, vi.fn(), 1, true);
+ commitRegisteredLevel(controller, 1);
+ vi.advanceTimersByTime(DISCLOSURE_WINDOW_TAIL_MS - 10);
+ expect(levels).toEqual([1]);
+ runDisclosure(controller, vi.fn(), 1, true);
+ vi.advanceTimersByTime(DISCLOSURE_WINDOW_TAIL_MS - 10);
+ expect(levels).toEqual([1]);
+ vi.advanceTimersByTime(10);
+ expect(levels).toEqual([1, 0]);
+ expect(controller.registered).toBe(0);
+ expect(controller.requested).toBe(0);
+ expect(controller.timer).toBeNull();
+ });
+
+ it('never leaves a change stuck: pending work runs even if the window closed before registration', () => {
+ const { controller } = mountScope();
+ const apply = vi.fn();
+ runDisclosure(controller, apply, 1, true);
+ vi.advanceTimersByTime(DISCLOSURE_WINDOW_TAIL_MS);
+ expect(controller.registered).toBe(0);
+ commitRegisteredLevel(controller, 0);
+ expect(apply).toHaveBeenCalledTimes(1);
+ });
+
+ it('flushes queued changes and clears the timer when the list unmounts', () => {
+ const { controller } = mountScope();
+ const apply = vi.fn();
+ runDisclosure(controller, apply, 1, true);
+ detachDisclosureScope(controller);
+ expect(apply).toHaveBeenCalledTimes(1);
+ expect(controller.setLevel).toBeNull();
+ expect(controller.timer).toBeNull();
+ expect(controller.pending).toEqual([]);
+ });
+});
diff --git a/apps/mobile/src/__tests__/sessionComposerDesktopFirst.test.ts b/apps/mobile/src/__tests__/sessionComposerDesktopFirst.test.ts
index 78a0b9fde4..8d260f63d2 100644
--- a/apps/mobile/src/__tests__/sessionComposerDesktopFirst.test.ts
+++ b/apps/mobile/src/__tests__/sessionComposerDesktopFirst.test.ts
@@ -802,8 +802,9 @@ describe('mobile session composer desktop-first surface', () => {
// 手势被系统/滚动打断时撤销按下即录(review P1)。
expect(source).toContain('cancelVoiceForAppBackground();');
expect(source).toContain('testID="session.voiceRecordingPill"');
- // 胶囊宽度驱动语音按钮外框(过渡由 voicePillWidthMotion 负责)。
- expect(source).toContain('<VoicePillWidthFrame width={voiceRecordingTimer.pillWidth}>');
+ // 胶囊宽度驱动语音按钮外框(过渡由 voicePillWidthMotion 负责);外框要带上按钮的
+ // hitSlop,否则收起态 34pt 麦克风的命中区会因新的直接父视图而缩小。
+ expect(source).toContain('<VoicePillWidthFrame hitSlop={COMPOSER_CONTROL_HIT_SLOP} width={voiceRecordingTimer.pillWidth}>');
expect(source).not.toContain('voiceDuration');
expect(source).not.toContain('recordingDuration');
expect(source).not.toContain('formatVoiceDuration');
diff --git a/apps/mobile/src/session/listDisclosureController.ts b/apps/mobile/src/session/listDisclosureController.ts
new file mode 100644
index 0000000000..bac7a7ea34
--- /dev/null
+++ b/apps/mobile/src/session/listDisclosureController.ts
@@ -0,0 +1,92 @@
+import { listDisclosureMotion } from '@/theme/tokens';
+
+/**
+ * 列表展开 / 收起过渡的窗口控制器(纯逻辑,不依赖 React / Reanimated,便于直接单测)。
+ * 视图层见 listDisclosureTransition.tsx:ListDisclosureScope 持有开关状态并在行登记完
+ * 布局动画后调用 commitRegisteredLevel。
+ */
+
+/** 0 = 关闭;1 = cell 与分组块;2 = 另加分组块内部的逐行包裹。 */
+export type DisclosureLevel = 0 | 1 | 2;
+
+export type DisclosureController = {
+ pending: Array<() => void>;
+ registered: DisclosureLevel;
+ requested: DisclosureLevel;
+ setLevel: ((level: DisclosureLevel) => void) | null;
+ timer: ReturnType<typeof setTimeout> | null;
+};
+
+/**
+ * 窗口在最后一次变更落地后再保留一段:数据类变更(归档 / 置顶)写入 store 后还要经过
+ * 列表重算才提交,留足余量,动画结束前不收回布局动画。
+ */
+export const DISCLOSURE_WINDOW_TAIL_MS = listDisclosureMotion.duration + 300;
+
+export function createDisclosureController(): DisclosureController {
+ return { pending: [], registered: 0, requested: 0, setLevel: null, timer: null };
+}
+
+function scheduleClose(controller: DisclosureController) {
+ if (controller.timer) clearTimeout(controller.timer);
+ controller.timer = setTimeout(() => {
+ controller.timer = null;
+ controller.registered = 0;
+ controller.requested = 0;
+ controller.setLevel?.(0);
+ }, DISCLOSURE_WINDOW_TAIL_MS);
+}
+
+/**
+ * 打开(或延长)过渡窗口。系统「减弱动态效果」的约定是只有明确为 false 才播放动画
+ * (偏好还没查到的 null 也按不播处理),所以 motionAllowed 由调用方按该约定传入。
+ * 返回 false 表示不能开窗口(不播动画 / 列表不在屏上),调用方应直接执行变更。
+ */
+export function openDisclosureWindow(controller: DisclosureController, level: DisclosureLevel, motionAllowed: boolean): boolean {
+ if (!motionAllowed || !controller.setLevel) return false;
+ scheduleClose(controller);
+ if (level > controller.requested) {
+ controller.requested = level;
+ controller.setLevel(level);
+ }
+ return true;
+}
+
+/**
+ * 请求带过渡地执行 apply:窗口开着且行已登记好动画就立刻执行,否则排队,等行登记完成
+ * (commitRegisteredLevel)后按调用顺序执行。已有排队的变更时一律排队,保证乐观写入与
+ * 失败回滚按调用顺序落地。
+ */
+export function runDisclosure(controller: DisclosureController, apply: () => void, level: DisclosureLevel, motionAllowed: boolean) {
+ if (!openDisclosureWindow(controller, level, motionAllowed)
+ || (controller.registered >= level && controller.pending.length === 0)) {
+ apply();
+ return;
+ }
+ controller.pending.push(apply);
+}
+
+/** 行已按 level 登记好布局动画(同一次提交的 layout effect 里调用):执行排队的变更。 */
+export function commitRegisteredLevel(controller: DisclosureController, level: DisclosureLevel) {
+ controller.registered = level;
+ if (controller.pending.length === 0) return;
+ // 窗口已关闭时仍有排队的变更(极端慢渲染),直接落地,不能卡住。
+ if (level > 0) scheduleClose(controller);
+ const queued = controller.pending;
+ controller.pending = [];
+ queued.forEach((apply) => apply());
+}
+
+/** 列表卸载:窗口复位并把排队的变更直接落地。 */
+export function detachDisclosureScope(controller: DisclosureController) {
+ controller.setLevel = null;
+ controller.registered = 0;
+ controller.requested = 0;
+ if (controller.timer) {
+ clearTimeout(controller.timer);
+ controller.timer = null;
+ }
+ const queued = controller.pending;
+ controller.pending = [];
+ queued.forEach((apply) => apply());
+}
diff --git a/apps/mobile/src/session/listDisclosureTransition.tsx b/apps/mobile/src/session/listDisclosureTransition.tsx
index 8de4790b6c..d0b59ea8fc 100644
--- a/apps/mobile/src/session/listDisclosureTransition.tsx
+++ b/apps/mobile/src/session/listDisclosureTransition.tsx
@@ -4,6 +4,15 @@ import Reanimated, { Easing, withTiming, type LayoutAnimationsValues } from 'rea
import { getCachedReduceMotionEnabled } from '@/hooks/useReduceMotion';
import { listDisclosureMotion } from '@/theme/tokens';
+import {
+ commitRegisteredLevel,
+ createDisclosureController,
+ detachDisclosureScope,
+ openDisclosureWindow,
+ runDisclosure,
+ type DisclosureController,
+ type DisclosureLevel,
+} from './listDisclosureController';
/**
* 列表分组展开 / 收起的过渡(DESIGN.md §14.4 移动端列表节奏)。
@@ -58,64 +67,26 @@ function disclosureExit() {
};
}
-/** 0 = 关闭;1 = cell 与分组块;2 = 另加分组块内部的逐行包裹。 */
-type DisclosureLevel = 0 | 1 | 2;
-
-type DisclosureController = {
- pending: Array<() => void>;
- registered: DisclosureLevel;
- requested: DisclosureLevel;
- setLevel: ((level: DisclosureLevel) => void) | null;
- timer: ReturnType<typeof setTimeout> | null;
-};
-
const DisclosureLevelContext = createContext<DisclosureLevel>(0);
const DisclosurePrepareContext = createContext<(nested?: boolean) => void>(() => {});
-// 窗口在最后一次变更落地后再保留一段:数据类变更(归档 / 置顶)写入 store 后还要经过
-// 列表重算才提交,留足余量,动画结束前不收回布局动画。
-const WINDOW_TAIL = DURATION + 300;
-
-function scheduleClose(controller: DisclosureController) {
- if (controller.timer) clearTimeout(controller.timer);
- controller.timer = setTimeout(() => {
- controller.timer = null;
- controller.registered = 0;
- controller.requested = 0;
- controller.setLevel?.(0);
- }, WINDOW_TAIL);
-}
-
-function openWindow(controller: DisclosureController, level: DisclosureLevel): boolean {
- if (getCachedReduceMotionEnabled() === true || !controller.setLevel) return false;
- scheduleClose(controller);
- if (level > controller.requested) {
- controller.requested = level;
- controller.setLevel(level);
- }
- return true;
-}
+/** 系统「减弱动态效果」的约定:只有明确为 false 才播放(偏好未查到的 null 也不播)。 */
+const motionAllowed = () => getCachedReduceMotionEnabled() === false;
/**
* 页面持有的控制器。run(apply):请求列表挂上布局动画,行登记完成后(同一次提交的
* layout effect 里)立刻执行 apply;窗口在动画结束后自动收回。系统「减弱动态效果」
- * 开启、或列表不在屏上时直接执行。
+ * 开启、或列表不在屏上时直接执行。窗口逻辑见 listDisclosureController.ts。
*/
export function useListDisclosureTransition() {
- const controller = useRef<DisclosureController>({ pending: [], registered: 0, requested: 0, setLevel: null, timer: null }).current;
+ const controller = useRef<DisclosureController>(createDisclosureController()).current;
/** nested:要切换的分组嵌在另一个分组块里(项目里的自动化组),块内的行也要让位。 */
const run = useCallback((apply: () => void, options?: { nested?: boolean }) => {
- const level: DisclosureLevel = options?.nested ? 2 : 1;
- // 已有排队的变更时一律排队,保证乐观写入与回滚按调用顺序落地。
- if (!openWindow(controller, level) || (controller.registered >= level && controller.pending.length === 0)) {
- apply();
- return;
- }
- controller.pending.push(apply);
+ runDisclosure(controller, apply, options?.nested ? 2 : 1, motionAllowed());
}, [controller]);
/** 分组标题的 onPressIn:手指按下即提前挂上动画,松手时直接执行。 */
const prepare = useCallback(() => {
- openWindow(controller, 1);
+ openDisclosureWindow(controller, 1, motionAllowed());
}, [controller]);
useEffect(() => () => {
if (controller.timer) clearTimeout(controller.timer);
@@ -128,27 +99,14 @@ export function ListDisclosureScope({ children, controller }: { children: ReactN
const [level, setLevel] = useState<DisclosureLevel>(0);
useLayoutEffect(() => {
controller.setLevel = setLevel;
- return () => {
- controller.setLevel = null;
- controller.registered = 0;
- controller.requested = 0;
- const queued = controller.pending;
- controller.pending = [];
- queued.forEach((apply) => apply());
- };
+ return () => detachDisclosureScope(controller);
}, [controller]);
// 子行的 componentDidUpdate(登记布局动画)先于这里执行,此时再改折叠状态。
- // 窗口关闭时仍有排队的变更(极端慢渲染),直接落地,不能卡住。
useLayoutEffect(() => {
- controller.registered = level;
- if (controller.pending.length === 0) return;
- if (level > 0) scheduleClose(controller);
- const queued = controller.pending;
- controller.pending = [];
- queued.forEach((apply) => apply());
+ commitRegisteredLevel(controller, level);
}, [level, controller]);
const prepare = useCallback((nested?: boolean) => {
- openWindow(controller, nested ? 2 : 1);
+ openDisclosureWindow(controller, nested ? 2 : 1, motionAllowed());
}, [controller]);
return (
<DisclosurePrepareContext.Provider value={prepare}>
diff --git a/apps/mobile/src/session/voicePillWidthMotion.tsx b/apps/mobile/src/session/voicePillWidthMotion.tsx
index 8800e7bcba..ee874bd707 100644
--- a/apps/mobile/src/session/voicePillWidthMotion.tsx
+++ b/apps/mobile/src/session/voicePillWidthMotion.tsx
@@ -1,4 +1,5 @@
import { useEffect, type ReactNode } from 'react';
+import type { Insets } from 'react-native';
import Reanimated, { Easing, useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
import { getCachedReduceMotionEnabled } from '@/hooks/useReduceMotion';
@@ -23,8 +24,12 @@ export function useVoicePillWidthStyle(width: number) {
return useAnimatedStyle(() => ({ width: animated.value }));
}
-/** 语音按钮外框:宽度随胶囊平滑变化,按钮本身撑满外框(width: '100%')。 */
-export function VoicePillWidthFrame({ children, width }: { children: ReactNode; width: number }) {
+/**
+ * 语音按钮外框:宽度随胶囊平滑变化,按钮本身撑满外框(width: '100%')。
+ * 外框成了按钮的直接父视图,而 hitSlop 不会越过直接父视图的边界,所以调用方要把
+ * 按钮的 hitSlop 同样传给外框,收起态 34pt 麦克风的命中区才不会缩小。
+ */
+export function VoicePillWidthFrame({ children, hitSlop, width }: { children: ReactNode; hitSlop?: number | Insets; width: number }) {
const style = useVoicePillWidthStyle(width);
- return <Reanimated.View style={style}>{children}</Reanimated.View>;
+ return <Reanimated.View hitSlop={hitSlop} style={style}>{children}</Reanimated.View>;
}
diff --git a/apps/mobile/src/theme/tokens.ts b/apps/mobile/src/theme/tokens.ts
index c959cfa95a..369247a55f 100644
--- a/apps/mobile/src/theme/tokens.ts
+++ b/apps/mobile/src/theme/tokens.ts
@@ -817,9 +817,9 @@ export const motionEasing = {
/**
* 移动端列表展开 / 收起节奏(DESIGN.md §14.4 登记的移动端例外,2026-09-30 用户要求
- * 「符合 iOS 节奏」)。桌面 base 档 200ms 适合指针;手机列表按 iOS 系统节奏用 450ms
- * 二次缓出,约 300ms 完成九成位移,先快后缓、无回弹。只用于列表分组的展开 / 收起
- * (session/listDisclosureTransition.tsx)。
+ * 「符合 iOS 节奏」,同日要求把首版 450ms 加快一倍)。手机列表用 225ms 二次缓出,约
+ * 150ms 完成九成位移,先快后缓、无回弹(桌面 base 档为 200ms)。只用于列表分组的展开 /
+ * 收起(session/listDisclosureTransition.tsx)。
*/
export const listDisclosureMotion = {
duration: 225,
diff --git a/docs/design-rules/DESIGN.md b/docs/design-rules/DESIGN.md
index bc82ca8ba5..6513f347c2 100644
--- a/docs/design-rules/DESIGN.md
+++ b/docs/design-rules/DESIGN.md
@@ -919,7 +919,7 @@ long duration to leak into any other hover or transition.
**Switch feedback (owner-approved 2026-09-16).** The shared Desktop Switch uses the bounded thumb width/height changes registered in §15.17: a one-shot size transition with `--motion-fast` / `--motion-ease-out`, no overshoot, and direct pointer tracking during drag. The track and hit region do not move or grow. This is a functional transient width/height exception; it does not authorize looping layout animation. Reduced motion removes transitions and keeps immediate state feedback.
-**Mobile list disclosure rhythm (owner request, 2026-09-30).** On mobile, expanding and collapsing list groups (home pinned / shared / project / conversation groups, automation run groups on the home and device pages, the collapsible Settings debug group) and task-row moves from archive, unarchive, pin or unpin (rows leaving stay visible while the rows below close over them, then fade) follow the iOS system list rhythm instead of the Desktop `base` tier: 450ms quadratic ease-out with no overshoot, reaching about 90% of the travel within 300ms. The group opens from under its header: list cells clip their content while their position and height animate, new rows sit at their final positions and are revealed as the group grows, and the rows below move down in step; new rows do not fade in place. Collapsing reverses this: removed rows stay visible while the group closes over them and fade only near the end. The disclosure chevron switches without animation. The duration lives in mobile's `listDisclosureMotion` token and the shared implementation is `apps/mobile/src/session/listDisclosureTransition.tsx` (Reanimated layout animations, attached only during the transition window; React Native `LayoutAnimation` is a no-op in this app because Reanimated owns the Fabric mounting layer). Reduced motion switches instantly. This exception does not apply to Desktop, sheets, dialogs, or other panels.
+**Mobile list disclosure rhythm (owner request, 2026-09-30).** On mobile, expanding and collapsing list groups (home pinned / shared / project / conversation groups, automation run groups on the home and device pages, the collapsible Settings debug group) and task-row moves from archive, unarchive, pin or unpin (rows leaving stay visible while the rows below close over them, then fade) follow the iOS system list rhythm instead of the Desktop `base` tier (200ms): 225ms quadratic ease-out with no overshoot, reaching about 90% of the travel within 150ms (the owner asked for the first 450ms version to be halved the same day). The group opens from under its header: list cells clip their content while their position and height animate, new rows sit at their final positions and are revealed as the group grows, and the rows below move down in step; new rows do not fade in place. Collapsing reverses this: removed rows stay visible while the group closes over them and fade only near the end. The disclosure chevron switches without animation. The duration lives in mobile's `listDisclosureMotion` token and the shared implementation is `apps/mobile/src/session/listDisclosureTransition.tsx` (Reanimated layout animations, attached only during the transition window; React Native `LayoutAnimation` is a no-op in this app because Reanimated owns the Fabric mounting layer). Reduced motion switches instantly. This exception does not apply to Desktop, sheets, dialogs, or other panels.
#### Semantics → motion prototypes (one semantic, one motion, app-wide)
diff --git a/docs/design-rules/design-decision-log.md b/docs/design-rules/design-decision-log.md
index 9715f85bc8..21ac820d05 100644
--- a/docs/design-rules/design-decision-log.md
+++ b/docs/design-rules/design-decision-log.md
@@ -12,7 +12,7 @@
## 2026-09
-- **09-30 移动端列表展开 / 收起改为 iOS 节奏**——用户要求任务列表及同类列表从折叠到展开的过程「丝滑、符合 iOS 节奏」,并明确箭头不需要动画。排查发现原有的 150ms 折叠动画(RN `LayoutAnimation`)在本 App 里从未生效:Reanimated 接管了 Fabric 挂载层,分组实际是一帧跳变(模拟器录屏逐帧确认)。现行:改用 Reanimated 布局动画,仅在过渡窗口内挂上;列表行的位置与高度以 450ms 二次缓出变化(约 300ms 完成九成位移,无回弹),行裁剪内容,新行由变高的分组从标题下逐步露出,下方的行同步下移;收起反向合上,被移除的行临近结束才淡掉;箭头仍直接切换。覆盖首页置顶 / 共享 / 项目 / 对话分组、首页与设备页的自动化组;同日用户要求把设置页的调试分组与任务行的归档 / 置顶移位也接上同一套过渡(被移走的行保持可见、被下方上移的行盖住后淡掉;原来这两处用的旧写法同样从未生效),旧的 `configureCollapseAnimation` 随之删除。录音胶囊(红点 + 计时)展开 / 收回原先也依赖同样失效的 `LayoutAnimation`,一直是跳变;改为 Reanimated 直接驱动语音按钮外框与工具排占位的宽度,参数不变(`motionDuration.base` + `motionEasing.move`,仍在 §14.4 登记的 ≤240ms 窄变体内)。同日被取代:箭头随动画旋转与新行淡入的首版方案。桌面 `base` 200ms 不变,本条只是移动端例外。落点:`DESIGN.md §14.4`、`apps/mobile/src/theme/tokens.ts` 的 `listDisclosureMotion`、`apps/mobile/src/session/listDisclosureTransition.tsx`。模拟器录屏已确认置顶组与项目组的展开 / 收起过程,实机手感待用户验收。
+- **09-30 移动端列表展开 / 收起改为 iOS 节奏**——用户要求任务列表及同类列表从折叠到展开的过程「丝滑、符合 iOS 节奏」,并明确箭头不需要动画。排查发现原有的 150ms 折叠动画(RN `LayoutAnimation`)在本 App 里从未生效:Reanimated 接管了 Fabric 挂载层,分组实际是一帧跳变(模拟器录屏逐帧确认)。现行:改用 Reanimated 布局动画,仅在过渡窗口内挂上;列表行的位置与高度以 225ms 二次缓出变化(约 150ms 完成九成位移,无回弹;同日用户要求把首版 450ms 加快一倍),行裁剪内容,新行由变高的分组从标题下逐步露出,下方的行同步下移;收起反向合上,被移除的行临近结束才淡掉;箭头仍直接切换。覆盖首页置顶 / 共享 / 项目 / 对话分组、首页与设备页的自动化组;同日用户要求把设置页的调试分组与任务行的归档 / 置顶移位也接上同一套过渡(被移走的行保持可见、被下方上移的行盖住后淡掉;原来这两处用的旧写法同样从未生效),旧的 `configureCollapseAnimation` 随之删除。录音胶囊(红点 + 计时)展开 / 收回原先也依赖同样失效的 `LayoutAnimation`,一直是跳变;改为 Reanimated 直接驱动语音按钮外框与工具排占位的宽度,参数不变(`motionDuration.base` + `motionEasing.move`,仍在 §14.4 登记的 ≤240ms 窄变体内)。同日被取代:箭头随动画旋转与新行淡入的首版方案。同日用户反馈触发有卡顿,实测点击到开始动需要 250–390ms:开关放在页面状态、点击后整页重渲染一遍再等一帧才执行。改为开关只在包住列表的一层里切换、分组块内的逐行只在嵌套分组切换时登记、手指按下即提前准备,降到约 45–80ms(开发构建实测);动画常驻、用 UI 线程开关控制的做法会在滚动位置恢复后把行画错位置,已放弃。控制器逻辑独立成纯模块并有单测,「减弱动态效果」偏好未查到(null)时按不播处理。桌面 `base` 200ms 不变,本条只是移动端例外。落点:`DESIGN.md §14.4`、`apps/mobile/src/theme/tokens.ts` 的 `listDisclosureMotion`、`apps/mobile/src/session/listDisclosureTransition.tsx`。模拟器录屏已确认置顶组与项目组的展开 / 收起过程,实机手感待用户验收。
- **09-29 移动端新建按钮形变登记为动效例外**——用户确认保留侧栏抽屉导航与首页悬浮新建按钮:按下即原位拉长成等高输入框药丸,带一次可见的 iOS 式回弹(刚度 305、阻尼比 0.67);手动点药丸再向上展开成卡片(临界阻尼、无回弹)后聚焦。登记为 `DESIGN.md §14.4` 第七类动效例外,仅限该按钮与药丸,减弱动态效果时直接到位。方向授权不代表真机帧率验收。
- **09-28 任务标签改为紧跟标题常显**——用户要求任务标签不再作为「任务信息」里可选的显示项,而是跟在任务标题后面必然显示。桌面侧栏移除「任务信息 → 标签」复选项;文字版、列表版色球由行尾信息槽移到标题之后,置顶卡片版由底部信息行移到标题首行之后。聊天标题栏与手机端原本已在标题后常显,不变。同日用户指出悬停任务时色球「变大、描边消失」:根因是悬停把外圈改为半透明的 `sidebar-item-hover`,透出色球本色;改为悬停不换外圈色,选中与当前任务仍跟随不透明行底。被取代:09 月「标签」与时间并列、默认勾选并留在行尾信息槽的处理。现行行为见 `docs/product-rules/task-tags.md`;本条为方向裁决,不代表实机视觉验收。