Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
wip(mobile): 移动端导航与交互试用改版(本地快照,未推送)
kirozeng2e9501d64df1
diff --git a/apps/mobile/app.config.js b/apps/mobile/app.config.jsindex e5e0f20bdf..a2096ae700 100644--- a/apps/mobile/app.config.js+++ b/apps/mobile/app.config.js@@ -422,5 +422,7 @@ module.exports = (context = {}) => {}}- return next;+ return process.env.EXPO_PUBLIC_CINDY_NAV_DEMO === '1'+ ? require('./scripts/navigation-demo-config.cjs').applyNavigationDemoConfig(next)+ : next;};diff --git a/apps/mobile/app/_layout.tsx b/apps/mobile/app/_layout.tsxindex a4305e6ae9..18012d1937 100644--- a/apps/mobile/app/_layout.tsx+++ b/apps/mobile/app/_layout.tsx@@ -1,4 +1,5 @@import { recentTaskKey } from '@/session/recentTasks';+import { readComposerEntry } from '@/session/composerMorph';import { RecentMessageHistoriesProvider } from '@/session/RecentMessageHistories';import { ResidentHomeListProvider } from '@/session/ResidentHomeList';import { AndroidUpdateSheet } from '@/update/AndroidUpdateSheet';@@ -183,6 +184,11 @@ function NavigationGate() {headerBackVisible: false,headerStyle: { backgroundColor: 'transparent' },}} />+ {/* 新建页只在圆钮形变仍可交接时关掉推入动画(形变本身就是入场);+ 交接记录已过期就照常推入,页面进入后再恢复普通返回动画。 */}+ <Stack.Screen name="sessions/new" options={({ route }) => ({+ animation: readComposerEntry((route.params as { composerMorph?: string } | undefined)?.composerMorph) ? 'none' : 'default',+ })} />{/* 设置从左侧抽屉进入:接着抽屉方向从左边推出,不要默认从右边盖上来。 */}<Stack.Screen name="settings" options={{ animation: 'slide_from_left' }} /><Stack.Screendiff --git a/apps/mobile/app/account-deletion.tsx b/apps/mobile/app/account-deletion.tsxindex 251bd3dfd4..e9ac58f808 100644--- a/apps/mobile/app/account-deletion.tsx+++ b/apps/mobile/app/account-deletion.tsx@@ -25,9 +25,11 @@ import {} from '@/components/MobilePrimitives';import {SimpleStackHeader,- simpleScreenSafeAreaEdges,+ simpleScrollInsetProps,+ simpleScrollScreenSafeAreaEdges,} from '@/platform/chrome';import { goBackGuarded } from '@/utils/backGuard';+import { mobileInteractionStyles } from '@/components/mobileInteractionStyles';import { useTheme, useThemedStyles, type ThemeColors } from '@/theme';import {fontWeight,@@ -111,8 +113,9 @@ export default function AccountDeletionScreen() {const available = availability?.available;return (- <SafeAreaView edges={simpleScreenSafeAreaEdges()} style={styles.safeArea} testID="accountDeletion.screen">+ <SafeAreaView edges={simpleScrollScreenSafeAreaEdges()} style={styles.safeArea} testID="accountDeletion.screen"><SimpleStackHeader+ scrollEdgebackTestID="accountDeletion.backButton"onBack={() => goBackGuarded(router)}title={loginText('accountDeletionScreenTitle')}@@ -123,6 +126,7 @@ export default function AccountDeletionScreen() {style={styles.flex}><ScrollView+ {...simpleScrollInsetProps}contentContainerStyle={styles.content}keyboardShouldPersistTaps="handled"testID="accountDeletion.scroll"@@ -415,5 +419,5 @@ const makeStyles = (colors: ThemeColors) =>backgroundColor: colors.cta,borderColor: colors.cta,},- pressed: { opacity: 0.6 },+ pressed: mobileInteractionStyles.pressed,});diff --git a/apps/mobile/app/automations/[deviceId].tsx b/apps/mobile/app/automations/[deviceId].tsxindex e4b27d1de5..be7767989c 100644--- a/apps/mobile/app/automations/[deviceId].tsx+++ b/apps/mobile/app/automations/[deviceId].tsx@@ -29,9 +29,12 @@ import {SummaryStrip,} from '@/components/MobilePrimitives';import {+ NativeSwitch,SimpleStackHeader,- simpleScreenSafeAreaEdges,+ simpleScrollInsetProps,+ simpleScrollScreenSafeAreaEdges,} from '@/platform/chrome';+import { useGuardedPush } from '@/utils/useGuardedPush';import { buildMainWindowLayout } from '@/components/mainWindowLayout';import { useDeviceLink } from '@/device-link/DeviceLinkContext';import { formatRemoteError } from '@/device-link/remoteStatus';@@ -140,6 +143,7 @@ export default function AutomationsScreen() {const deviceId = String(params.deviceId ?? '');const deviceName = String(params.name ?? deviceId);const router = useRouter();+ const guardedPush = useGuardedPush();const { width: screenWidth } = useWindowDimensions();const { connectionIssue, openLink, status, subscribe, unsubscribe } = useDeviceLink();// 熔断 open(电脑端未响应):relay 可能仍 online,banner 文案单独入参。@@ -731,7 +735,7 @@ export default function AutomationsScreen() {next.set(run.scheduleId, markRunReadLocally(prev.get(run.scheduleId) ?? [], run.id));return next;});- router.push({+ guardedPush({pathname: '/sessions/[sessionId]',params: { sessionId: run.sessionId, deviceId, deviceName },});@@ -740,7 +744,7 @@ export default function AutomationsScreen() {} finally {setOpeningRunId(null);}- }, [deviceId, deviceName, maker, openingRunId, router]);+ }, [deviceId, deviceName, guardedPush, maker, openingRunId]);const markSingleRunRead = useCallback(async (run: RemoteScheduleRun) => {if (busyAction) return;@@ -826,7 +830,7 @@ export default function AutomationsScreen() {const showConnectionBanner = useShowConnectionBanner(status, error, connectionIssue, deviceUnresponsive);return (- <SafeAreaView edges={simpleScreenSafeAreaEdges()} style={styles.safeArea} testID="automations.screen">+ <SafeAreaView edges={simpleScrollScreenSafeAreaEdges()} style={styles.safeArea} testID="automations.screen"><SimpleStackHeadersyncing={!showConnectionBanner && (loading || runsLoading || status === 'connecting')}action={{@@ -890,6 +894,7 @@ export default function AutomationsScreen() {</SummaryStrip><ScrollView+ {...simpleScrollInsetProps}refreshControl={<RefreshControl refreshing={loading || runsLoading} onRefresh={refreshAll} />}contentContainerStyle={[styles.content,@@ -1291,7 +1296,7 @@ function ScheduleFormCard({editable={!busy}onChangeText={(value) => onChange(updateDraftBoundSessionId(draft, value,sessions.find((session) => session.id === value.trim())?.agentKind))}- placeholder="session id"+ placeholder={t('devices.automations.form.boundSessionIdPlaceholder')}placeholderTextColor={colors.textPlaceholder}style={styles.input}testID="automations.form.targetSessionInput"@@ -1430,19 +1435,11 @@ function ScheduleFormCard({/></View>- <View style={styles.fieldGroup}>- <Text style={styles.fieldLabel}>{t('devices.automations.form.field.effort')}</Text>- <TextInput- autoCapitalize="none"- editable={!busy}- onChangeText={(value) => setField('effort', value)}- placeholder="minimal / low / medium / high / xhigh / max / ultra"- placeholderTextColor={colors.textPlaceholder}- style={styles.input}- testID="automations.form.effortInput"- value={draft.effort}- />- </View>+ <EffortPicker+ disabled={busy}+ onChange={(value) => setField('effort', value)}+ value={draft.effort}+ />{(draft.agentKind === 'codex' || draft.agentKind === 'pi') && !hideWorkspaceFields ? (<ToggleRow@@ -1477,7 +1474,7 @@ function ScheduleFormCard({{draft.executionMode !== 'script' ? <Text style={styles.fieldLabel}>{t('devices.companions.automation.quietHint')}</Text> : null}{supportsPreRunHook ? <><Text style={styles.fieldLabel}>{t('devices.companions.automation.checkCommand')}</Text>- <TextInput accessibilityLabel={t('devices.companions.automation.checkCommand')} autoCapitalize="none" editable={!busy} multiline style={styles.input}+ <TextInput accessibilityLabel={t('devices.companions.automation.checkCommand')} autoCapitalize="none" editable={!busy} multiline style={[styles.input, styles.inputMultiline]}value={draft.preRunHook?.command ?? ''} onChangeText={(command) => setField('preRunHook', command ? { ...draft.preRunHook, command } : null)} /><Text style={styles.fieldLabel}>{t('devices.companions.automation.checkHint')}</Text>{draft.preRunHook ? <>@@ -1508,8 +1505,8 @@ function ScheduleFormCard({primaryActions={[{accessibilityLabel: busy ? t('devices.automations.form.savingA11y') : t('devices.automations.form.saveA11y'),- disabled: busy,- label: busy ? t('devices.common.saving') : t('devices.common.save'),+ busy,+ label: t('devices.common.save'),onPress: onSubmit,testID: 'automations.form.saveButton',tone: 'primary',@@ -1615,8 +1612,9 @@ function ScheduleDeleteCard({dangerActions={[{accessibilityLabel: t('devices.automations.delete.confirmA11y'),- disabled: busy || state.loading,- label: busy ? t('devices.common.deleting') : confirmText,+ busy,+ disabled: state.loading,+ label: confirmText,onPress: onConfirm,testID: 'automations.delete.confirmButton',tone: 'danger',@@ -1669,8 +1667,8 @@ function SchedulePauseCard({primaryActions={[{accessibilityLabel: t('devices.automations.pause.confirmA11y'),- disabled: busy,- label: busy ? t('devices.automations.pause.pausing') : t('devices.automations.pause.confirm'),+ busy,+ label: t('devices.automations.pause.confirm'),onPress: onConfirm,testID: 'automations.pause.confirmButton',tone: 'primary',@@ -1726,8 +1724,8 @@ function RunDeleteCard({dangerActions={[{accessibilityLabel: t('devices.automations.runDelete.confirmA11y'),- disabled: busy,- label: busy ? t('devices.common.deleting') : t('devices.automations.runDelete.confirm'),+ busy,+ label: t('devices.automations.runDelete.confirm'),onPress: onConfirm,testID: 'automations.runDelete.confirmButton',tone: 'danger',@@ -1819,8 +1817,9 @@ function TemplatePicker({<MainWindowActionButtonaction={{accessibilityLabel: loading ? t('devices.automations.template.loadingA11y') : t('devices.automations.template.refreshA11y'),- disabled: busy || loading,- label: loading ? t('devices.automations.template.loading') : t('devices.automations.template.refresh'),+ busy: loading,+ disabled: busy,+ label: t('devices.automations.template.refresh'),onPress: onReload,testID: 'automations.templateReloadButton',}}@@ -1998,21 +1997,69 @@ function ToggleRow({testID: string;}) {const styles = useThemedStyles(makeStyles);+ const { colors } = useTheme();return (- <MainWindowRowButton- accessibilityLabel={label}- accessibilityRole="switch"- accessibilityState={{ checked: active }}- disabled={disabled}- onPress={onPress}- style={styles.toggleRow}- testID={testID}- >+ <View style={styles.toggleRow}><Text style={styles.toggleLabel}>{label}</Text>- <View style={[styles.togglePill, active && styles.togglePillActive]}>- <View style={[styles.toggleKnob, active && styles.toggleKnobActive]} />+ <NativeSwitch+ accessibilityLabel={label}+ disabled={disabled}+ onValueChange={(next) => {+ if (next !== active) onPress();+ }}+ seedColor={colors.inputCaret}+ testID={testID}+ value={active}+ />+ </View>+ );+}++/** 推理强度:沿用模型选择器的档位列表与文案;「默认」保存为空串,与原先留空一致。 */+const EFFORT_LEVELS = ['minimal', 'low', 'medium', 'high', 'xhigh', 'max', 'ultra'] as const;++function EffortPicker({+ disabled,+ onChange,+ value,+}: {+ disabled: boolean;+ onChange: (value: string) => void;+ value: string;+}) {+ const styles = useThemedStyles(makeStyles);+ const { t } = useTranslation();+ const current = value.trim();+ // 已保存但不在档位表里的值(旧版手填)原样保留为一个可选项,不静默改写。+ const options: string[] = ['', ...EFFORT_LEVELS];+ if (current && !options.includes(current)) options.push(current);+ return (+ <View style={styles.fieldGroup}>+ <Text style={styles.fieldLabel}>{t('devices.automations.form.field.effort')}</Text>+ <View+ accessibilityLabel={t('devices.automations.form.field.effort')}+ accessibilityRole="radiogroup"+ style={styles.effortOptions}+ testID="automations.form.effortOptions"+ >+ {options.map((option) => (+ <MainWindowOptionButton+ accessibilityRole="radio"+ accessibilityState={{ checked: option === current }}+ density="default"+ disabled={disabled}+ key={option || 'default'}+ label={option+ ? t(`models.options.effortLevels.${option}`, { defaultValue: option })+ : t('devices.automations.form.effortDefault')}+ onPress={() => onChange(option)}+ selected={option === current}+ style={styles.effortOption}+ testID={`automations.form.effort.${option || 'default'}`}+ />+ ))}</View>- </MainWindowRowButton>+ </View>);}@@ -2048,7 +2095,7 @@ function ScheduleRow({<Text style={styles.scheduleSubtitle} numberOfLines={1}>{summary.subtitle}</Text><Text style={styles.scheduleDetail} numberOfLines={1}>{summary.detail}</Text></View>- <ChevronRight color={colors.textTertiary} size={iconSize.xl} strokeWidth={iconStroke.regular} />+ <ChevronRight color={colors.textTertiary} size={iconSize.lg} strokeWidth={iconStroke.regular} /></MainWindowRowButton>);}@@ -2103,10 +2150,9 @@ function ScheduleDetail({}]}primaryActions={[{accessibilityLabel: t('devices.automations.detail.runNowA11y'),+ busy: busyAction === `run:${schedule.id}`,disabled: actionBusy,- label: busyAction === `run:${schedule.id}`- ? t('devices.automations.detail.running')- : t('devices.automations.runNow'),+ label: t('devices.automations.runNow'),onPress: onRunNow,testID: 'automations.runNowButton',tone: 'primary',@@ -2177,7 +2223,7 @@ function RunRow({accessibilityLabel: t('devices.automations.run.openSessionA11y'),busy: opening,disabled: actionBusy,- label: opening ? t('devices.automations.run.opening') : (summary.openSessionLabel ?? t('devices.automations.run.session')),+ label: summary.openSessionLabel ?? t('devices.automations.run.session'),onPress: onOpenSession,testID: 'automations.openRunSessionButton',}}@@ -2191,7 +2237,7 @@ function RunRow({accessibilityLabel: t('devices.automations.run.restartA11y'),busy: busyAction === `run-restart:${run.id}`,disabled: actionBusy,- label: busyAction === `run-restart:${run.id}` ? t('devices.automations.run.restarting') : (summary.restartLabel ?? t('devices.automations.run.restart')),+ label: summary.restartLabel ?? t('devices.automations.run.restart'),onPress: onRestart,testID: 'automations.restartRunButton',}}@@ -2205,7 +2251,7 @@ function RunRow({accessibilityLabel: t('devices.automations.run.markReadA11y'),busy: busyAction === `run-read:${run.id}`,disabled: actionBusy,- label: busyAction === `run-read:${run.id}` ? t('devices.automations.run.marking') : (summary.markReadLabel ?? t('devices.automations.run.markRead')),+ label: summary.markReadLabel ?? t('devices.automations.run.markRead'),onPress: onMarkRead,testID: 'automations.markRunReadButton',}}@@ -2219,7 +2265,7 @@ function RunRow({accessibilityLabel: t('devices.automations.run.deleteA11y'),busy: busyAction === `run-delete:${run.id}`,disabled: actionBusy,- label: busyAction === `run-delete:${run.id}` ? t('devices.common.deleting') : (summary.deleteLabel ?? t('devices.common.delete')),+ label: summary.deleteLabel ?? t('devices.common.delete'),onPress: onDelete,testID: 'automations.deleteRunButton',tone: 'danger',@@ -2370,10 +2416,11 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({fieldGroup: { gap: spacing.xs },fieldLabel: { color: colors.textTertiary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption, fontWeight: fontWeight.regular },fieldHint: { color: colors.textSecondary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption },+ // 单行输入胶囊;多行编辑区(textArea / inputMultiline)保留容器圆角。input: {backgroundColor: colors.surface,borderColor: colors.border,- borderRadius: radius.container,+ borderRadius: radius.pill,borderWidth: StyleSheet.hairlineWidth,color: colors.textPrimary,fontSize: typeScale.body,@@ -2381,7 +2428,10 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({paddingHorizontal: spacing.md,paddingVertical: spacing.sm,},- textArea: { minHeight: 112 },+ textArea: { borderRadius: radius.container, minHeight: 112 },+ inputMultiline: { borderRadius: radius.container },+ effortOptions: { flexDirection: 'row', flexWrap: 'wrap', gap: spacing.sm },+ effortOption: { minHeight: 44 },templateSection: { gap: spacing.sm },templateHeader: {alignItems: 'center',@@ -2416,16 +2466,16 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({segmentRow: {backgroundColor: colors.surface,borderColor: colors.border,- borderRadius: radius.container,+ borderRadius: radius.pill,borderWidth: StyleSheet.hairlineWidth,flexDirection: 'row',gap: spacing.xs,padding: spacing.xs,},segmentButton: {- borderRadius: radius.container,+ borderRadius: radius.pill,flex: 1,- minHeight: 38,+ minHeight: 44,paddingHorizontal: spacing.sm,},toggleRow: {@@ -2438,24 +2488,7 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({minHeight: 48,paddingHorizontal: spacing.md,},- toggleLabel: { color: colors.textPrimary, fontSize: typeScale.body, lineHeight: lineHeight.body, fontWeight: fontWeight.medium },- togglePill: {- alignItems: 'flex-start',- backgroundColor: colors.surfaceChip,- borderRadius: radius.pill,- height: 28,- justifyContent: 'center',- paddingHorizontal: 3,- width: 50,- },- togglePillActive: { alignItems: 'flex-end', backgroundColor: colors.cta },- toggleKnob: {- backgroundColor: colors.surfaceElevated,- borderRadius: radius.pill,- height: 22,- width: 22,- },- toggleKnobActive: { backgroundColor: colors.ctaText },+ toggleLabel: { color: colors.textPrimary, flex: 1, fontSize: typeScale.body, lineHeight: lineHeight.body, fontWeight: fontWeight.medium },boundSessionOptions: { gap: spacing.xs },boundSessionOption: {borderColor: colors.border,diff --git a/apps/mobile/app/companions/direct/[threadId].tsx b/apps/mobile/app/companions/direct/[threadId].tsxindex e6cb69164d..265762cecb 100644--- a/apps/mobile/app/companions/direct/[threadId].tsx+++ b/apps/mobile/app/companions/direct/[threadId].tsx@@ -1,6 +1,6 @@-import { useCallback, useEffect, useSyncExternalStore } from 'react';+import { useCallback, useEffect, useRef, useState, useSyncExternalStore } from 'react';import { useFocusEffect, useLocalSearchParams, useRouter } from 'expo-router';-import { ActivityIndicator, ScrollView, StyleSheet, View } from 'react-native';+import { ActivityIndicator, RefreshControl, ScrollView, StyleSheet, View } from 'react-native';import { SafeAreaView } from 'react-native-safe-area-context';import { useTranslation } from 'react-i18next';import { resolveRemoteText } from '@cindy/device-link';@@ -9,7 +9,7 @@ import { formatBotMessageGroupTime } from '@cindy/maker-shared/botTimeline';import { Text } from '@/components/AppText';import { MainWindowActionButton } from '@/components/MobilePrimitives';import { RemoteCompanionAvatar } from '@/components/RemoteCompanionAvatar';-import { SimpleStackHeader, simpleScreenSafeAreaEdges } from '@/platform/chrome';+import { SimpleStackHeader, simpleScrollInsetProps, simpleScrollScreenSafeAreaEdges } from '@/platform/chrome';import { useAuth } from '@/auth/AuthContext';import { useDeviceLink } from '@/device-link/DeviceLinkContext';import { startFocusedTopicSubscription } from '@/device-link/focusedTopicSubscription';@@ -21,10 +21,12 @@ import {} from '@/device-link/remoteResourceCache';import { useRemoteCompanionQuery } from '@/session/useRemoteCompanionQuery';import { useTheme, useThemedStyles, type ThemeColors } from '@/theme';-import { lineHeight, radius, spacing, typeScale } from '@/theme/tokens';+import { fontWeight, lineHeight, radius, spacing, typeScale } from '@/theme/tokens';import { goBackGuarded } from '@/utils/backGuard';const AVATAR_SIZE = 28;+/** The shared query has no settled flag; stop the pull spinner if a read never reports back. */+const PULL_REFRESH_FALLBACK_MS = 8000;/** Desktop BotDirectMessageView: a read-only two-sided thread, the viewing teammate on the right. */export default function CompanionDirectMessages() {@@ -40,6 +42,19 @@ export default function CompanionDirectMessages() {const userId = user?.id ?? '';const { subscribe, unsubscribe } = useDeviceLink();const { value, error, online, refresh } = useRemoteCompanionQuery<BotDirectMessageThreadResult>(deviceId, 'maker:bot-direct-message-thread:get', [threadId, botId]);+ // Pull to refresh re-reads the thread. The spinner ends when the read reports a new value or+ // failure (or after a fallback), and offline pulls do not spin because no read can start.+ const [pulling, setPulling] = useState(false);+ const pullFallback = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);+ useEffect(() => { setPulling(false); }, [value, error]);+ useEffect(() => () => clearTimeout(pullFallback.current), []);+ const pullRefresh = useCallback(() => {+ refresh();+ if (!online) return;+ setPulling(true);+ clearTimeout(pullFallback.current);+ pullFallback.current = setTimeout(() => setPulling(false), PULL_REFRESH_FALLBACK_MS);+ }, [online, refresh]);useFocusEffect(useCallback(() => startFocusedTopicSubscription({ deviceId, owner: `companion-direct:${threadId}`, topic: 'sessions', subscribe, unsubscribe }), [deviceId, threadId, subscribe, unsubscribe]));useSyncExternalStore(subscribeRemoteResourceCache, remoteResourceCacheRevision);useEffect(() => { if (userId) void readRemoteResourceSnapshot(userId); }, [userId]);@@ -53,10 +68,11 @@ export default function CompanionDirectMessages() {const viewer = thread ? participant(botId, thread.botAId === botId ? thread.botAName : thread.botBName) : null;const peer = thread ? participant(peerId, thread.botAId === peerId ? thread.botAName : thread.botBName) : null;const messages = Array.isArray(thread?.messages) ? thread.messages : [];- return <SafeAreaView edges={simpleScreenSafeAreaEdges()} style={styles.screen}>- <SimpleStackHeader title={viewer && peer ? `${viewer.name} ⇄ ${peer.name}` : t('devices.companions.messages')}+ return <SafeAreaView edges={simpleScrollScreenSafeAreaEdges()} style={styles.screen}>+ <SimpleStackHeader scrollEdge title={viewer && peer ? `${viewer.name} ⇄ ${peer.name}` : t('devices.companions.messages')}subtitle={t('devices.companions.readOnly')} onBack={() => goBackGuarded(router)} />- <ScrollView contentContainerStyle={styles.content} testID="companion.directThread">+ <ScrollView {...simpleScrollInsetProps} contentContainerStyle={styles.content} testID="companion.directThread"+ refreshControl={<RefreshControl refreshing={pulling} onRefresh={pullRefresh} tintColor={colors.textSecondary} />}>{!online ? <Text style={styles.note}>{t('devices.resources.hostOffline')}</Text> : null}{messages.map((message) => {const ownSide = message.senderBotId === botId;@@ -86,15 +102,16 @@ export default function CompanionDirectMessages() {const makeStyles = (colors: ThemeColors) => StyleSheet.create({screen: { flex: 1, backgroundColor: colors.surface },content: { padding: spacing.lg, gap: spacing.lg },- row: { flexDirection: 'row', alignItems: 'flex-start', gap: 10 },+ row: { flexDirection: 'row', alignItems: 'flex-start', gap: spacing.sm },rowOwn: { justifyContent: 'flex-end' },rowPeer: { justifyContent: 'flex-start' },column: { maxWidth: '74%', minWidth: 0, gap: spacing.xs },columnOwn: { alignItems: 'flex-end' },columnPeer: { alignItems: 'flex-start' },meta: { color: colors.textTertiary, fontSize: typeScale.caption, lineHeight: lineHeight.caption, paddingHorizontal: spacing.xs },- bubble: { color: colors.textPrimary, fontSize: typeScale.body, lineHeight: lineHeight.body, borderRadius: radius.container,- borderWidth: StyleSheet.hairlineWidth, paddingHorizontal: 14, paddingVertical: 10, overflow: 'hidden' },+ // §3 conversation-message role: 17/26 regular.+ bubble: { color: colors.textPrimary, fontSize: typeScale.bodyLarge, lineHeight: lineHeight.bodyLarge, fontWeight: fontWeight.regular, borderRadius: radius.container,+ borderWidth: StyleSheet.hairlineWidth, paddingHorizontal: spacing.md, paddingVertical: spacing.sm, overflow: 'hidden' },// Own side reads like the user's bubble; the peer sits on the chip surface (Desktop msg-user / surface-chip).bubbleOwn: { backgroundColor: colors.surfaceElevated, borderColor: colors.borderStrong },bubblePeer: { backgroundColor: colors.surfaceChip, borderColor: colors.border },diff --git a/apps/mobile/app/devices/[deviceId].tsx b/apps/mobile/app/devices/[deviceId].tsxindex b4c7896654..2ed14edbdf 100644--- a/apps/mobile/app/devices/[deviceId].tsx+++ b/apps/mobile/app/devices/[deviceId].tsx@@ -32,7 +32,8 @@ import {} from '@/components/MobilePrimitives';import {SimpleStackHeader,- simpleScreenSafeAreaEdges,+ simpleScrollInsetProps,+ simpleScrollScreenSafeAreaEdges,} from '@/platform/chrome';import { buildMainWindowLayout } from '@/components/mainWindowLayout';import { useDeviceLink } from '@/device-link/DeviceLinkContext';@@ -682,7 +683,7 @@ function DeviceDetailScreenContent() {return !automationScopeDir || sessionMatchesProjectDir(item.session.workingDir, automationScopeDir);});return (- <SafeAreaView edges={simpleScreenSafeAreaEdges()} style={styles.safeArea} testID="deviceDetail.screen">+ <SafeAreaView edges={simpleScrollScreenSafeAreaEdges()} style={styles.safeArea} testID="deviceDetail.screen"><SimpleStackHeadersyncing={!showConnectionBanner && (loading || status === 'connecting')}backTestID="deviceDetail.backButton"@@ -704,9 +705,10 @@ function DeviceDetailScreenContent() {/>) : null}<SectionList+ {...simpleScrollInsetProps}sections={runItems.length > 0 ? [{ key: 'automation-runs', title: '', data: runItems }] : []}keyExtractor={(item) => item.session.id}- refreshControl={<RefreshControl refreshing={loading} onRefresh={loadSessions} />}+ refreshControl={<RefreshControl refreshing={loading} onRefresh={loadSessions} tintColor={colors.textSecondary} />}stickySectionHeadersEnabled={false}renderSectionHeader={() => null}contentContainerStyle={[styles.listContent, { paddingBottom: spacing.xxl }]}@@ -747,7 +749,7 @@ function DeviceDetailScreenContent() {if (projectWorkingDir) {const projectItems = sections.flatMap((section) => section.data);return (- <SafeAreaView edges={simpleScreenSafeAreaEdges()} style={styles.safeArea} testID="deviceDetail.screen">+ <SafeAreaView edges={simpleScrollScreenSafeAreaEdges()} style={styles.safeArea} testID="deviceDetail.screen"><SimpleStackHeadersyncing={!showConnectionBanner && (loading || status === 'connecting')}action={{@@ -819,12 +821,13 @@ function DeviceDetailScreenContent() {)}</View><SectionList+ {...simpleScrollInsetProps}sections={displaySections}keyExtractor={(item) => item.automationGroup?.key ?? item.session.id}// Fabric can reattach a clipped Swipeable child before its old native parent removes it.// Keep JS virtualization, but avoid the Android native detach/reattach race for this list.removeClippedSubviews={false}- refreshControl={<RefreshControl refreshing={loading} onRefresh={loadSessions} />}+ refreshControl={<RefreshControl refreshing={loading} onRefresh={loadSessions} tintColor={colors.textSecondary} />}stickySectionHeadersEnabled={false}renderSectionHeader={() => null}contentContainerStyle={[styles.listContent, { paddingBottom: spacing.xxl }]}@@ -870,7 +873,7 @@ function DeviceDetailScreenContent() {}return (- <SafeAreaView edges={simpleScreenSafeAreaEdges()} style={styles.safeArea} testID="deviceDetail.screen">+ <SafeAreaView edges={simpleScrollScreenSafeAreaEdges()} style={styles.safeArea} testID="deviceDetail.screen"><SimpleStackHeadersyncing={!showConnectionBanner && (loading || status === 'connecting')}action={{@@ -1185,9 +1188,10 @@ function DeviceDetailScreenContent() {</View><SectionList+ {...simpleScrollInsetProps}sections={displaySections}keyExtractor={(item) => item.automationGroup?.key ?? item.session.id}- refreshControl={<RefreshControl refreshing={loading} onRefresh={loadSessions} />}+ refreshControl={<RefreshControl refreshing={loading} onRefresh={loadSessions} tintColor={colors.textSecondary} />}stickySectionHeadersEnabled={false}contentContainerStyle={[styles.listContent,@@ -1453,25 +1457,6 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({paddingHorizontal: spacing.lg,paddingTop: spacing.sm,},- searchRow: {- alignItems: 'center',- flexDirection: 'row',- gap: spacing.sm,- },- searchInput: {- backgroundColor: colors.surfaceElevated,- borderColor: colors.border,- borderRadius: radius.container,- borderWidth: StyleSheet.hairlineWidth,- color: colors.textPrimary,- flex: 1,- fontSize: typeScale.body,- minHeight: 44,- paddingHorizontal: spacing.lg,- },- searchCloseButton: {- minHeight: 38,- },segmentScroll: {marginHorizontal: -spacing.lg,},diff --git a/apps/mobile/app/devices/manage.tsx b/apps/mobile/app/devices/manage.tsxindex 98581482e8..df1f460e59 100644--- a/apps/mobile/app/devices/manage.tsx+++ b/apps/mobile/app/devices/manage.tsx@@ -1,10 +1,11 @@import { useIsFocused, useRouter } from 'expo-router';-import { ActivityIndicator, Button, View } from 'react-native';+import { useCallback, useEffect, useRef } from 'react';+import { ActivityIndicator, StyleSheet, View } from 'react-native';import { SafeAreaView } from 'react-native-safe-area-context';import { useTranslation } from 'react-i18next';import { useAuth } from '@/auth/AuthContext';import { Text } from '@/components/AppText';-import { MainWindowEmptyState } from '@/components/MobilePrimitives';+import { MainWindowActionButton, MainWindowEmptyState } from '@/components/MobilePrimitives';import { toDeviceListItems } from '@/device-link/devices';import { useRevokedDevices } from '@/device-link/revokedDevicesStore';import { useDeviceManagement } from '@/device-link/useDeviceManagement';@@ -16,27 +17,64 @@ import {} from '@/platform/chrome';import { goBackGuarded } from '@/utils/backGuard';import { useGuardedPush } from '@/utils/useGuardedPush';-import { useTheme } from '@/theme';-import { spacing } from '@/theme/tokens';+import { useTheme, useThemedStyles, type ThemeColors } from '@/theme';+import { fontWeight, lineHeight, spacing, typeScale } from '@/theme/tokens';++/** 下拉刷新的兜底时长:刷新被跳过(如编辑中)时也要收起转圈。 */+const PULL_REFRESH_TIMEOUT_MS = 10_000;export default function DeviceManagementScreen() {const { accountGeneration } = useAuth();return <DeviceManagementContent key={accountGeneration} />;}+/**+ * 把 manager.refresh()(无返回值)包成「本次刷新结束才 resolve」的 Promise,+ * 供 iOS refreshable / Android RefreshControl 收起转圈。+ */+function useRefreshPromise(manager: ReturnType<typeof useDeviceManagement>) {+ const pending = useRef<{ resolve(): void; sawLoading: boolean; timer: ReturnType<typeof setTimeout> } | null>(null);+ const loadingRef = useRef(manager.loading);+ loadingRef.current = manager.loading;+ const finish = useCallback(() => {+ const current = pending.current;+ if (!current) return;+ pending.current = null;+ clearTimeout(current.timer);+ current.resolve();+ }, []);+ useEffect(() => {+ const current = pending.current;+ if (!current) return;+ if (manager.loading) current.sawLoading = true;+ else if (current.sawLoading) finish();+ }, [finish, manager.loading]);+ useEffect(() => finish, [finish]);+ const { refresh } = manager;+ return useCallback(() => new Promise<void>((resolve) => {+ finish();+ pending.current = { resolve, sawLoading: loadingRef.current, timer: setTimeout(finish, PULL_REFRESH_TIMEOUT_MS) };+ refresh();+ }), [finish, refresh]);+}+function DeviceManagementContent() {const { apiFetch } = useAuth();const manager = useDeviceManagement(apiFetch, useIsFocused());const revoked = useRevokedDevices();const { t } = useTranslation();const { colors } = useTheme();+ const styles = useThemedStyles(makeStyles);const router = useRouter();const guardedPush = useGuardedPush();+ const refresh = useRefreshPromise(manager);const rows = toDeviceListItems(manager.devices, Date.now(), revoked);+ // 首次加载才显示整页转圈;已有列表时刷新由下拉控件自己表示。+ const initialLoading = manager.loading && rows.length === 0;return (<SafeAreaViewedges={simpleScreenSafeAreaEdges()}- style={{ flex: 1, backgroundColor: colors.surface }}+ style={styles.screen}testID="deviceManagement.screen"><SimpleStackHeader@@ -45,23 +83,29 @@ function DeviceManagementContent() {onBack={() => goBackGuarded(router)}/>{manager.error ? (- <View style={{ padding: spacing.lg }}>- <Text accessibilityRole="alert" style={{ color: colors.errorText }}>+ <View style={styles.errorBlock}>+ <Text accessibilityRole="alert" style={styles.errorText}>{manager.error}</Text>- <Button- title={t('devices.management.retry')}- onPress={manager.refresh}+ <MainWindowActionButton+ action={{+ busy: manager.loading,+ label: t('devices.management.retry'),+ onPress: manager.refresh,+ testID: 'deviceManagement.retry',+ }}+ style={styles.retryButton}/></View>) : null}- {manager.loading ? (- <ActivityIndicator color={colors.textSecondary} />+ {initialLoading ? (+ <ActivityIndicator color={colors.textSecondary} style={styles.loading} />) : null}{!manager.loading && !manager.error && rows.length === 0 ? (<MainWindowEmptyStatetitle={t('devices.presentation.deviceList.emptyTitle')}copy={t('devices.presentation.deviceList.emptyCopy')}+ style={styles.empty}/>) : null}<DeviceManagementList@@ -75,8 +119,19 @@ function DeviceManagementContent() {}onRename={manager.openRename}onDelete={manager.openDelete}+ onRefresh={refresh}/><DeviceManagementDialogs manager={manager} /></SafeAreaView>);}++const makeStyles = (colors: ThemeColors) => StyleSheet.create({+ screen: { backgroundColor: colors.surface, flex: 1 },+ errorBlock: { alignItems: 'flex-start', gap: spacing.md, padding: spacing.lg },+ // 报错说明:13/18 errorText(黑白系)。+ errorText: { color: colors.errorText, fontSize: typeScale.footnote, fontWeight: fontWeight.regular, lineHeight: lineHeight.caption },+ retryButton: { alignSelf: 'flex-start' },+ loading: { paddingVertical: spacing.lg },+ empty: { margin: spacing.lg, padding: spacing.lg },+});diff --git a/apps/mobile/app/devices/manage/[deviceId].tsx b/apps/mobile/app/devices/manage/[deviceId].tsxindex 8d3b80c1f6..4118556f45 100644--- a/apps/mobile/app/devices/manage/[deviceId].tsx+++ b/apps/mobile/app/devices/manage/[deviceId].tsx@@ -3,11 +3,13 @@ import { List as SwiftUIList } from '@expo/ui/swift-ui';import { scrollContentBackground } from '@expo/ui/swift-ui/modifiers';import { useIsFocused, useLocalSearchParams, useRouter } from 'expo-router';import { useCallback } from 'react';-import { ActivityIndicator, Button, Platform, Pressable, View } from 'react-native';+import { ActivityIndicator, Platform, Pressable, StyleSheet, View } from 'react-native';import { SafeAreaView } from 'react-native-safe-area-context';import { useTranslation } from 'react-i18next';import { useAuth } from '@/auth/AuthContext';import { Text } from '@/components/AppText';+import { MainWindowActionButton } from '@/components/MobilePrimitives';+import { mobileInteractionStyles } from '@/components/mobileInteractionStyles';import { DeviceManagementDialogs } from '@/device-link/DeviceManagementDialogs';import { DeviceInformationFields } from '@/device-link/DeviceInformationFields';import { platformLabel, toDeviceListItem } from '@/device-link/devices';@@ -19,9 +21,9 @@ import {} from '@/platform/chrome';import { goBackGuarded } from '@/utils/backGuard';import { useGuardedPush } from '@/utils/useGuardedPush';-import { useTheme, iconSize, iconStroke } from '@/theme';+import { useTheme, useThemedStyles, iconSize, iconStroke, type ThemeColors } from '@/theme';import { Monitor } from 'lucide-react-native';-import { spacing } from '@/theme/tokens';+import { fontWeight, lineHeight, spacing, typeScale } from '@/theme/tokens';const DeviceInformationList = Platform.OS === 'ios' ? SwiftUIList : List;@@ -40,8 +42,9 @@ function DeviceInformationContent({ deviceId }: { deviceId: string }) {const { apiFetch } = useAuth();const manager = useDeviceManagement(apiFetch, useIsFocused());const revoked = useRevokedDevices();- const { t, i18n } = useTranslation();+ const { t } = useTranslation();const { mode, colors } = useTheme();+ const styles = useThemedStyles(makeStyles);const router = useRouter();const push = useGuardedPush();const back = useCallback(() => goBackGuarded(router), [router]);@@ -50,7 +53,6 @@ function DeviceInformationContent({ deviceId }: { deviceId: string }) {? toDeviceListItem(device, Date.now(), revoked): null;const unknown = t('devices.management.unknown');- const seen = device?.lastSeenAt ? new Date(device.lastSeenAt) : null;const fields = device? [['name', device.name],@@ -71,10 +73,11 @@ function DeviceInformationContent({ deviceId }: { deviceId: string }) {],['lastSeen',+ // 与设备列表同一条相对时间规则(刚刚 / N 分钟 / N 小时 / N 天前,更早显示日期)。device.online? t('devices.management.currentlyOnline')- : seen && Number.isFinite(seen.getTime())- ? seen.toLocaleString(i18n.language)+ : presentation?.state === 'offline'+ ? presentation.statusDetail: unknown,],['deviceId', device.deviceId],@@ -84,7 +87,7 @@ function DeviceInformationContent({ deviceId }: { deviceId: string }) {return (<SafeAreaViewedges={simpleScreenSafeAreaEdges()}- style={{ flex: 1, backgroundColor: colors.surface }}+ style={styles.screen}testID="deviceInformation.screen"><SimpleStackHeader@@ -94,7 +97,7 @@ function DeviceInformationContent({ deviceId }: { deviceId: string }) {accessibilityLabel={t('remoteDesktop.title')}onPress={() => push({ pathname: '/devices/desktop/[deviceId]', params: { deviceId, deviceName: device.name } })}testID="deviceInformation.remoteDesktop"- style={({ pressed }) => ({ width: 44, height: 44, alignItems: 'center', justifyContent: 'center', opacity: pressed ? 0.72 : 1 })}+ style={({ pressed }) => [styles.headerButton, pressed && mobileInteractionStyles.pressed]}><Monitor color={colors.textPrimary} size={iconSize.xl} strokeWidth={iconStroke.regular} /></Pressable>@@ -103,27 +106,32 @@ function DeviceInformationContent({ deviceId }: { deviceId: string }) {backTestID="deviceInformation.back"onBack={back}/>- {manager.loading ? (- <ActivityIndicator color={colors.textSecondary} />+ {manager.loading && !device ? (+ <ActivityIndicator color={colors.textSecondary} style={styles.loading} />) : null}{manager.error ? (- <View style={{ padding: spacing.lg }}>- <Text accessibilityRole="alert" style={{ color: colors.errorText }}>+ <View style={styles.errorBlock}>+ <Text accessibilityRole="alert" style={styles.errorText}>{manager.error}</Text>- <Button- title={t('devices.management.retry')}- onPress={manager.refresh}+ <MainWindowActionButton+ action={{+ busy: manager.loading,+ label: t('devices.management.retry'),+ onPress: manager.refresh,+ testID: 'deviceInformation.retry',+ }}+ style={styles.retryButton}/></View>) : null}{!device && !manager.loading && !manager.error ? (- <Text style={{ color: colors.textSecondary, padding: spacing.lg }}>+ <Text style={styles.notFound}>{t('devices.management.notFound')}</Text>) : null}{device ? (- <Host style={{ flex: 1, backgroundColor: colors.surface }} colorScheme={mode}>+ <Host style={styles.host} colorScheme={mode}><DeviceInformationList{...(Platform.OS === 'ios'? { modifiers: [scrollContentBackground('hidden')] }@@ -176,3 +184,16 @@ function DeviceInformationContent({ deviceId }: { deviceId: string }) {</SafeAreaView>);}++const makeStyles = (colors: ThemeColors) => StyleSheet.create({+ screen: { backgroundColor: colors.surface, flex: 1 },+ host: { backgroundColor: colors.surface, flex: 1 },+ headerButton: { alignItems: 'center', height: 44, justifyContent: 'center', width: 44 },+ loading: { paddingVertical: spacing.lg },+ errorBlock: { alignItems: 'flex-start', gap: spacing.md, padding: spacing.lg },+ // 报错说明:13/18 errorText(黑白系)。+ errorText: { color: colors.errorText, fontSize: typeScale.footnote, fontWeight: fontWeight.regular, lineHeight: lineHeight.caption },+ retryButton: { alignSelf: 'flex-start' },+ // 成句的说明文字:13/18 textSecondary。+ notFound: { color: colors.textSecondary, fontSize: typeScale.footnote, fontWeight: fontWeight.regular, lineHeight: lineHeight.caption, padding: spacing.lg },+});diff --git a/apps/mobile/app/files/[sessionId].tsx b/apps/mobile/app/files/[sessionId].tsxindex 210151da3d..a57cab0fa2 100644--- a/apps/mobile/app/files/[sessionId].tsx+++ b/apps/mobile/app/files/[sessionId].tsx@@ -12,7 +12,7 @@ import { SystemNavigationBack, useSystemNavigationBack } from '@/platform/chromeimport * as Clipboard from 'expo-clipboard';import { useAdaptiveWindow } from '@/platform/AdaptiveWindowContext';import { ModalContentArea } from '@/platform/ModalContentArea';-import { useFocusEffect, useLocalSearchParams, useRouter } from 'expo-router';+import { Stack, useFocusEffect, useLocalSearchParams, useRouter } from 'expo-router';import { fsWatchTopic } from '@cindy/device-link';import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';import { useTranslation } from 'react-i18next';@@ -35,6 +35,7 @@ import {X,} from 'lucide-react-native';import {+ AccessibilityInfo,ActivityIndicator,FlatList,Image,@@ -47,7 +48,12 @@ import {} from 'react-native';import { SafeAreaView } from 'react-native-safe-area-context';import { Text, TextInput } from '@/components/AppText';+import { navigationTitleMaxWidth } from '@/platform/chrome/navigationTitleWidth';import { ScreenBackButton } from '@/components/MobilePrimitives';+import { mobileInteractionStyles } from '@/components/mobileInteractionStyles';+import { simpleScreenSafeAreaEdges, usesNativeStackHeader } from '@/platform/chrome/SimpleStackHeader';+import { FileBrowserSegmentedControl } from '@/session/FileBrowserSegmentedControl';+import { useGuardedPush } from '@/utils/useGuardedPush';import { ConnectionBanner, useShowConnectionBanner } from '@/components/ConnectionBanner';import { QuietSyncIndicator } from '@/components/QuietSyncIndicator';import { useUnresponsiveDevices } from '@/device-link/unresponsiveDevicesStore';@@ -132,7 +138,11 @@ export default function RemoteFileBrowserScreen() {const deviceName = readRouteString(params.deviceName) ?? deviceId;const relPath = readRouteString(params.relPath) ?? '';const router = useRouter();+ const guardedPush = useGuardedPush();const systemBack = useSystemNavigationBack();+ // iOS 普通窗口用系统导航栏(与设置、设备管理等简单页同一顶栏);Duo 侧栏窗口+ // 继续由 SystemNavigationBack 管返回,标题留在页内 navRow;Android 自绘 navRow。+ const nativeHeader = usesNativeStackHeader() && !systemBack;const fileWindow = useAdaptiveWindow();const screenWidth = fileWindow.width - fileWindow.insets.left - fileWindow.insets.right;const auth = useAuth();@@ -185,8 +195,18 @@ export default function RemoteFileBrowserScreen() {noticeTimerRef.current = setTimeout(() => setNotice(null), NOTICE_DISMISS_MS);}, []);+ const [lightboxCopied, setLightboxCopied] = useState(false);+ const lightboxCopiedTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);+ const showLightboxCopied = useCallback(() => {+ setLightboxCopied(true);+ AccessibilityInfo.announceForAccessibility(t('files.browser.copiedPath'));+ if (lightboxCopiedTimerRef.current) clearTimeout(lightboxCopiedTimerRef.current);+ lightboxCopiedTimerRef.current = setTimeout(() => setLightboxCopied(false), NOTICE_DISMISS_MS);+ }, [t]);+useEffect(() => () => {if (noticeTimerRef.current) clearTimeout(noticeTimerRef.current);+ if (lightboxCopiedTimerRef.current) clearTimeout(lightboxCopiedTimerRef.current);}, []);// 卸载标记:长按「导出/分享」的导出轮询最长 2 分钟,退出本屏后必须中止。@@ -308,14 +328,14 @@ export default function RemoteFileBrowserScreen() {}, [workdir]);const openDirectory = useCallback((target: string) => {- router.push({+ guardedPush({pathname: '/files/[sessionId]',params: { sessionId, deviceId, deviceName, relPath: target },});- }, [deviceId, deviceName, router, sessionId]);+ }, [deviceId, deviceName, guardedPush, sessionId]);const openPreview = useCallback((target: string, line?: number) => {- router.push({+ guardedPush({pathname: '/files/preview/[sessionId]',params: {sessionId,@@ -326,7 +346,7 @@ export default function RemoteFileBrowserScreen() {...(line ? { line: String(line) } : {}),},});- }, [deviceId, deviceName, router, sessionId, sortMode]);+ }, [deviceId, deviceName, guardedPush, sessionId, sortMode]);// —— 图片统一走聊天同款 ImageLightbox(目录内全部图片为一个图集)——const presignGet = useCallback(async (ossKey: string) => {@@ -508,11 +528,15 @@ export default function RemoteFileBrowserScreen() {const lightboxActions = useMemo((): readonly ImageLightboxAction[] => [{key: 'copyPath',- label: t('files.browser.copyPath'),- icon: Copy,+ label: lightboxCopied ? t('files.browser.copiedPath') : t('files.browser.copyPath'),+ icon: lightboxCopied ? Check : Copy,onPress: (image) => {const rel = relPathFromGalleryKey(image.key);- if (rel) void Clipboard.setStringAsync(absolutePathOf(rel));+ if (!rel) return;+ void Clipboard.setStringAsync(absolutePathOf(rel));+ // lightbox 盖住了页脚 notice:复制反馈就地显示在这个按钮上(同一句「已复制路径」),+ // 与长按菜单 / 标题菜单的复制路径保持同一提示。+ showLightboxCopied();},},{@@ -535,7 +559,7 @@ export default function RemoteFileBrowserScreen() {});},},- ], [absolutePathOf, sendItemToSession, t]);+ ], [absolutePathOf, lightboxCopied, sendItemToSession, showLightboxCopied, t]);/*** lightbox 圈点标注(与聊天/托盘同一套画笔):提交只投递「图源 + 矢量笔迹」@@ -727,9 +751,62 @@ export default function RemoteFileBrowserScreen() {/>), [cellWidth, maker, openItem, workdir]);+ const syncing = !showConnectionBanner && (loading || status === 'connecting');+ const { width: windowWidth } = useWindowDimensions();+ const titleButton = (+ <Pressable+ accessibilityLabel={t('files.browser.a11yTitleMenu')}+ accessibilityRole="button"+ onPress={() => setTitleMenuOpen(true)}+ style={({ pressed }) => [styles.titleGroup, nativeHeader && styles.titleGroupNative, pressed && styles.pressed]}+ testID="files.titleMenuButton"+ >+ <Text numberOfLines={1} style={[styles.title, nativeHeader && styles.titleNative]} testID="files.title">{title}</Text>+ {/* Same plain chevron as the home title: no chip behind it. */}+ <ChevronDown color={colors.textSecondary} size={iconSize.xs} strokeWidth={iconStroke.medium} />+ <QuietSyncIndicator active={syncing} />+ </Pressable>+ );+ // 系统顶栏只在浏览态出现;搜索态由页内搜索头接管顶部(含取消),根容器补回顶部安全区。+ const nativeHeaderVisible = nativeHeader && !searchOpen;+return (- <SafeAreaView style={styles.safeArea} testID="files.screen">- <SystemNavigationBack label={t('shared.back')} onPress={() => goBackGuarded(router)} />+ <SafeAreaView+ edges={nativeHeaderVisible ? simpleScreenSafeAreaEdges() : undefined}+ style={styles.safeArea}+ testID="files.screen"+ >+ {nativeHeader ? (+ <>+ <Stack.Screen+ options={{+ headerShown: nativeHeaderVisible,+ headerShadowVisible: false,+ headerBackVisible: false,+ headerStyle: { backgroundColor: colors.surface },+ headerTintColor: colors.textPrimary,+ headerTitle: () => (+ <View style={[styles.nativeTitleWrap, { maxWidth: navigationTitleMaxWidth(windowWidth) }]} testID="files.navRow">+ {titleButton}+ </View>+ ),+ }}+ />+ {nativeHeaderVisible ? (+ <Stack.Toolbar placement="left">+ <Stack.Toolbar.Button icon="chevron.backward" accessibilityLabel={t('shared.back')} onPress={() => goBackGuarded(router)} />+ </Stack.Toolbar>+ ) : null}+ {nativeHeaderVisible ? (+ <Stack.Toolbar placement="right">+ <Stack.Toolbar.Button icon="magnifyingglass" accessibilityLabel={t('files.browser.a11ySearch')} onPress={() => setSearchOpen(true)} />+ <Stack.Toolbar.Button icon="ellipsis" accessibilityLabel={t('files.browser.a11yMore')} onPress={() => setTitleMenuOpen(true)} />+ </Stack.Toolbar>+ ) : null}+ </>+ ) : (+ <SystemNavigationBack label={t('shared.back')} onPress={() => goBackGuarded(router)} />+ )}{searchOpen ? (<SearchHeaderloading={searchLoading}@@ -746,42 +823,30 @@ export default function RemoteFileBrowserScreen() {query={query}workdirLabel={pathLevels[pathLevels.length - 1]?.label ?? ''}/>- ) : (+ ) : nativeHeader ? null : (<View style={styles.navRow} testID="files.navRow">{!systemBack ? <ScreenBackButton- hitSlop={8}onPress={() => goBackGuarded(router)}testID="files.backButton"/> : null}- <Pressable- accessibilityLabel={t('files.browser.a11yTitleMenu')}- onPress={() => setTitleMenuOpen(true)}- style={styles.titleGroup}- testID="files.titleMenuButton"- >- <Text numberOfLines={1} style={styles.title} testID="files.title">{title}</Text>- <View style={styles.titleChevronChip}>- <ChevronDown color={colors.textSecondary} size={iconSize.sm} strokeWidth={iconStroke.regular} />- </View>- <QuietSyncIndicator active={!showConnectionBanner && (loading || status === 'connecting')} />- </Pressable>+ {titleButton}<PressableaccessibilityLabel={t('files.browser.a11ySearch')}- hitSlop={8}+ accessibilityRole="button"onPress={() => setSearchOpen(true)}style={({ pressed }) => [styles.navActionBtn, pressed && styles.pressed]}testID="files.searchButton">- <Search color={colors.textPrimary} size={iconSize.lg} strokeWidth={iconStroke.regular} />+ <Search color={colors.textPrimary} size={iconSize.action} strokeWidth={iconStroke.regular} /></Pressable><PressableaccessibilityLabel={t('files.browser.a11yMore')}- hitSlop={8}+ accessibilityRole="button"onPress={() => setTitleMenuOpen(true)}style={({ pressed }) => [styles.navActionBtn, pressed && styles.pressed]}testID="files.moreButton">- <Ellipsis color={colors.textPrimary} size={iconSize.lg} strokeWidth={iconStroke.regular} />+ <Ellipsis color={colors.textPrimary} size={iconSize.action} strokeWidth={iconStroke.regular} /></Pressable></View>)}@@ -1123,15 +1188,20 @@ function SearchHeader({const styles = useThemedStyles(makeStyles);const { colors } = useTheme();const { t } = useTranslation();- const modes = [- ['name', t('files.browser.searchModeName')],- ['content', t('files.browser.searchModeContent')],- ] as const;+ const modes = (['name', 'content'] as const).map((value) => {+ const label = t(value === 'name' ? 'files.browser.searchModeName' : 'files.browser.searchModeContent');+ return {+ value,+ label,+ accessibilityLabel: t('files.browser.searchModeA11y', { mode: label }),+ testID: `files.searchMode.${value}`,+ };+ });return (<View><View style={styles.searchRow}><View style={styles.searchField}>- <Search color={colors.textTertiary} size={iconSize.md} strokeWidth={iconStroke.regular} />+ <Search color={colors.textSecondary} size={iconSize.md} strokeWidth={iconStroke.regular} /><TextInputautoCapitalize="none"autoCorrect={false}@@ -1144,33 +1214,39 @@ function SearchHeader({value={query}/>{query ? (- <Pressable accessibilityLabel={t('files.browser.a11yClear')} hitSlop={8} onPress={() => onChangeQuery('')}>+ <Pressable+ accessibilityLabel={t('files.browser.a11yClear')}+ accessibilityRole="button"+ hitSlop={4}+ onPress={() => onChangeQuery('')}+ style={({ pressed }) => [styles.searchClearButton, pressed && styles.pressed]}+ ><X color={colors.textTertiary} size={iconSize.md} strokeWidth={iconStroke.regular} /></Pressable>) : null}</View>- <Pressable accessibilityLabel={t('files.browser.a11yCancelSearch')} hitSlop={8} onPress={onCancel} testID="files.searchCancel">+ <Pressable+ accessibilityLabel={t('files.browser.a11yCancelSearch')}+ accessibilityRole="button"+ onPress={onCancel}+ style={({ pressed }) => [styles.searchCancelButton, pressed && styles.pressed]}+ testID="files.searchCancel"+ ><Text style={styles.cancelText}>{t('files.browser.cancel')}</Text></Pressable></View><View style={styles.searchModeRow}>- {modes.map(([value, label]) => (- <Pressable- accessibilityLabel={t('files.browser.searchModeA11y', { mode: label })}- key={value}- onPress={() => onChangeMode(value)}- style={[styles.searchModePill, mode === value && styles.searchModePillActive]}- testID={`files.searchMode.${value}`}- >- <Text style={[styles.searchModeLabel, mode === value && styles.searchModeLabelActive]}>- {label}- </Text>- </Pressable>- ))}- <Text style={styles.scopeHintInline}>- {t('files.browser.searchScope', { workdir: workdirLabel })}{loading ? t('files.browser.searching') : ''}- </Text>+ <FileBrowserSegmentedControl+ accessibilityLabel={t('files.browser.searchPlaceholder')}+ onChange={onChangeMode}+ options={modes}+ testID="files.searchMode"+ value={mode}+ /></View>+ <Text style={styles.scopeHint}>+ {t('files.browser.searchScope', { workdir: workdirLabel })}{loading ? t('files.browser.searching') : ''}+ </Text></View>);}@@ -1297,6 +1373,8 @@ function TitleMenu({) => (<PressableaccessibilityLabel={label}+ accessibilityRole="button"+ accessibilityState={{ selected: checked }}key={key}onPress={onPress}style={({ pressed }) => [styles.menuRow, pressed && styles.pressed]}@@ -1407,6 +1485,7 @@ function ContextMenu({{index > 0 ? <View style={styles.menuSep} /> : null}<PressableaccessibilityLabel={action.label}+ accessibilityRole="button"onPress={action.onPress}style={({ pressed }) => [styles.contextMenuRow, pressed && styles.pressed]}testID={`files.context.${action.key}`}@@ -1446,33 +1525,43 @@ function readRouteString(value: unknown): string | null {const makeStyles = (colors: ThemeColors) => StyleSheet.create({safeArea: { flex: 1, backgroundColor: colors.surface },- pressed: { opacity: 0.72 },+ pressed: mobileInteractionStyles.pressed,+ // 自绘顶栏(Android / Duo)与共享 ScreenHeader 同高同内边距,返回键落在同一位置。navRow: {alignItems: 'center',borderBottomColor: colors.border,borderBottomWidth: StyleSheet.hairlineWidth,flexDirection: 'row',gap: spacing.sm,+ minHeight: 72,paddingHorizontal: spacing.lg,- paddingVertical: spacing.md,+ paddingVertical: spacing.sm,},navActionBtn: {- // 与会话头 SessionHeaderIconButton 同规格(34×34 pill),hitSlop 补足 44 热区。alignItems: 'center',borderRadius: radius.pill,- height: 34,+ height: 44,justifyContent: 'center',- width: 34,+ width: 44,+ },+ nativeTitleWrap: {+ alignItems: 'center',+ flexDirection: 'row',},titleGroup: {alignItems: 'center',flex: 1,flexDirection: 'row',- gap: spacing.xs + 2,+ gap: spacing.sm,// 标题居左贴返回箭头(与页面式头的左对齐语义一致),不再居中。justifyContent: 'flex-start',+ minHeight: 44,minWidth: 0,},+ titleGroupNative: {+ flex: 0,+ flexShrink: 1,+ },title: {flexShrink: 1,minWidth: 0,@@ -1482,14 +1571,7 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({fontWeight: fontWeight.semibold,maxWidth: '72%',},- titleChevronChip: {- alignItems: 'center',- backgroundColor: colors.surfaceChip,- borderRadius: radius.pill,- height: 20,- justifyContent: 'center',- width: 20,- },+ titleNative: { maxWidth: '100%' },sectionRow: {alignItems: 'center',flexDirection: 'row',@@ -1508,17 +1590,18 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({list: { flex: 1 },gridContent: { paddingBottom: spacing.xl, paddingHorizontal: spacing.lg },gridRow: { gap: spacing.md, marginBottom: spacing.lg },- gridCell: { alignItems: 'center', gap: spacing.xs + 2 },+ gridCell: { alignItems: 'center', gap: spacing.sm },thumbZone: { alignItems: 'center', height: 112, justifyContent: 'center', width: '100%' },docThumb: {backgroundColor: colors.surfaceElevated,borderColor: colors.border,borderRadius: 2, // 文档缩略卡刻意 2px 锐角(iOS Files 风格,ALLOWLIST 登记豁免)borderWidth: StyleSheet.hairlineWidth,- gap: 4,+ gap: spacing.xs,height: 104,- paddingHorizontal: 8,- paddingVertical: 10,+ paddingHorizontal: spacing.sm,+ // 14 行 × 6 = 84 的微缩文本顶端对齐,底部余 4pt 留白,不裁行。+ paddingVertical: spacing.sm,width: 80,},// 微缩真实文本:模拟 iOS Files 的文档首屏缩略;禁用系统字号缩放。@@ -1576,55 +1659,45 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({paddingHorizontal: spacing.lg,paddingVertical: spacing.md,},+ // 与首页搜索条同一外观:胶囊 + 抬层底 + 1px 描边,44 高;输入字号走次级正文 15。searchField: {alignItems: 'center',- backgroundColor: colors.surfaceChip,- borderRadius: radius.container,+ backgroundColor: colors.surfaceElevated,+ borderColor: colors.border,+ borderRadius: radius.pill,+ borderWidth: StyleSheet.hairlineWidth,flex: 1,flexDirection: 'row',gap: spacing.sm,- minHeight: 36,- paddingHorizontal: spacing.md,+ minHeight: 44,+ paddingLeft: spacing.lg,+ paddingRight: spacing.xs,},searchInput: {color: colors.textPrimary,flex: 1,fontSize: typeScale.bodySmall,+ minWidth: 0,paddingVertical: spacing.sm,},- cancelText: { color: colors.textPrimary, fontSize: typeScale.body, lineHeight: lineHeight.body },- scopeHint: {- color: colors.textTertiary,- fontSize: typeScale.caption,- lineHeight: lineHeight.caption,- paddingBottom: spacing.sm,- paddingHorizontal: spacing.lg,+ searchClearButton: {+ alignItems: 'center',+ height: 36,+ justifyContent: 'center',+ width: 36,},+ searchCancelButton: { justifyContent: 'center', minHeight: 44 },+ cancelText: { color: colors.textPrimary, fontSize: typeScale.body, lineHeight: lineHeight.body },searchModeRow: {- alignItems: 'center',- flexDirection: 'row',- gap: spacing.sm,paddingBottom: spacing.sm,paddingHorizontal: spacing.lg,},- searchModePill: {- alignItems: 'center',- borderColor: colors.border,- borderRadius: radius.pill,- borderWidth: StyleSheet.hairlineWidth,- justifyContent: 'center',- minHeight: 28,- paddingHorizontal: spacing.md,- },- searchModePillActive: { backgroundColor: colors.surfaceChip, borderColor: colors.borderStrong },- searchModeLabel: { color: colors.textSecondary, fontSize: typeScale.caption, lineHeight: lineHeight.caption },- searchModeLabelActive: { color: colors.textPrimary, fontWeight: fontWeight.medium },- scopeHintInline: {- color: colors.textTertiary,- flex: 1,- fontSize: typeScale.caption,+ scopeHint: {+ color: colors.textSecondary,+ fontSize: typeScale.footnote,lineHeight: lineHeight.caption,- textAlign: 'right',+ paddingBottom: spacing.sm,+ paddingHorizontal: spacing.lg,},contentMatchRow: {alignItems: 'center',@@ -1661,10 +1734,9 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({borderColor: colors.border,borderRadius: 2, // 搜索结果迷你缩略卡同款刻意 2px 锐角(iOS Files 风格,ALLOWLIST 登记豁免)borderWidth: StyleSheet.hairlineWidth,- gap: 3,+ gap: spacing.xs,height: 36,- paddingHorizontal: 4,- paddingVertical: 5,+ padding: spacing.xs,width: 28,},miniThumbLine: { backgroundColor: colors.border, height: 1.5 },diff --git a/apps/mobile/app/files/preview/[sessionId].tsx b/apps/mobile/app/files/preview/[sessionId].tsxindex 695f67ab02..20e05bf8ea 100644--- a/apps/mobile/app/files/preview/[sessionId].tsx+++ b/apps/mobile/app/files/preview/[sessionId].tsx@@ -70,6 +70,7 @@ import type { MobileHtmlPreview } from '@/session/mobileHtmlPreview';import { prepareMobileHtmlPreview, type PrepareMobileHtmlPreview } from '@/session/mobileHtmlPreview';import { useHtmlSnapshot } from '@/session/useHtmlSnapshot';import { MainWindowActionButton } from '@/components/MobilePrimitives';+import { FileBrowserSegmentedControl } from '@/session/FileBrowserSegmentedControl';import { MarkdownFileReader } from '@/session/MarkdownFileReader';import { RemoteMediaPlayerWebView } from '@/session/mediaPlayerWebView';import {@@ -1156,19 +1157,21 @@ function TextPreviewPage({{/* HTML 的模式切换在浮动浏览器菜单中;Markdown 保留原有胶囊。 */}{canRenderRich && richKind !== 'html' ? (<View style={styles.mdToggleRow}>- {([['rendered', t('files.preview.mdRendered')], ['source', t('files.preview.mdSource')]] as const).map(([value, label]) => (- <Pressable- accessibilityLabel={t('files.preview.mdViewA11y', { view: label })}- key={value}- onPress={() => setRichView(value)}- style={[styles.mdTogglePill, richView === value && styles.mdTogglePillActive]}- testID={`filePreview.richView.${value}`}- >- <Text style={[styles.mdToggleLabel, richView === value && styles.mdToggleLabelActive]}>- {label}- </Text>- </Pressable>- ))}+ <FileBrowserSegmentedControl<'rendered' | 'source'>+ accessibilityLabel={t('files.preview.mdViewA11y', { view: richView === 'rendered' ? t('files.preview.mdRendered') : t('files.preview.mdSource') })}+ onChange={setRichView}+ options={(['rendered', 'source'] as const).map((value) => {+ const label = t(value === 'rendered' ? 'files.preview.mdRendered' : 'files.preview.mdSource');+ return {+ value,+ label,+ accessibilityLabel: t('files.preview.mdViewA11y', { view: label }),+ testID: `filePreview.richView.${value}`,+ };+ })}+ testID="filePreview.richView"+ value={richView}+ /></View>) : null}{showRendered ? (@@ -1352,14 +1355,14 @@ function ImagePreviewPage({<View style={styles.imageStateWrap} testID="filePreview.imageError"><GenericGlyph name={item.name} /><Text style={styles.hintText}>{t('files.preview.fetchOriginalFailed', { detail: failure })}</Text>- <Pressable- accessibilityLabel={t('files.preview.a11yRetryOriginal')}- onPress={() => setAttempt((n) => n + 1)}- style={({ pressed }) => [styles.retryBtn, pressed && styles.pressed]}- testID="filePreview.imageRetry"- >- <Text style={styles.retryLabel}>{t('files.preview.retry')}</Text>- </Pressable>+ <MainWindowActionButton+ action={{+ accessibilityLabel: t('files.preview.a11yRetryOriginal'),+ label: t('files.preview.retry'),+ onPress: () => setAttempt((n) => n + 1),+ testID: 'filePreview.imageRetry',+ }}+ /></View>) : (<View style={styles.imageStateWrap} testID="filePreview.imageLoading">@@ -1521,23 +1524,9 @@ const makeStyles = (colors: ThemeColors) => {truncText: { color: colors.textSecondary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption },textPage: { flex: 1 },mdToggleRow: {- flexDirection: 'row',- gap: spacing.sm,paddingHorizontal: spacing.lg,paddingVertical: spacing.sm,},- mdTogglePill: {- alignItems: 'center',- borderColor: colors.border,- borderRadius: radius.pill,- borderWidth: StyleSheet.hairlineWidth,- justifyContent: 'center',- minHeight: 28,- paddingHorizontal: spacing.md,- },- mdTogglePillActive: { backgroundColor: colors.surfaceChip, borderColor: colors.borderStrong },- mdToggleLabel: { color: colors.textSecondary, fontSize: typeScale.caption, lineHeight: lineHeight.caption },- mdToggleLabelActive: { color: colors.textPrimary, fontWeight: fontWeight.medium },codeList: { flex: 1 },codeContent: { paddingHorizontal: spacing.lg, paddingVertical: spacing.md },codeLine: { flexDirection: 'row', gap: spacing.sm + 2 },@@ -1574,16 +1563,6 @@ const makeStyles = (colors: ThemeColors) => {textAlign: 'center',width: '100%',},- retryBtn: {- alignItems: 'center',- borderColor: colors.borderStrong,- borderRadius: radius.pill,- borderWidth: StyleSheet.hairlineWidth,- justifyContent: 'center',- minHeight: 40,- paddingHorizontal: spacing.xl,- },- retryLabel: { color: colors.textPrimary, fontSize: typeScale.bodySmall, lineHeight: lineHeight.bodySmall, fontWeight: fontWeight.medium },pdfView: { flex: 1 },bigPage: {alignItems: 'center',diff --git a/apps/mobile/app/resources/[collectionId].tsx b/apps/mobile/app/resources/[collectionId].tsxindex 9fb6ab275d..1a865671c4 100644--- a/apps/mobile/app/resources/[collectionId].tsx+++ b/apps/mobile/app/resources/[collectionId].tsx@@ -10,7 +10,7 @@ import {StyleSheet,View,} from 'react-native';-import { ChevronRight } from 'lucide-react-native';+import { ChevronRight, RefreshCw } from 'lucide-react-native';import { SafeAreaView } from 'react-native-safe-area-context';import { useTranslation } from 'react-i18next';import {@@ -21,8 +21,9 @@ import { Text } from '@/components/AppText';import { useTeammateNavigation } from '@/session/useTeammateNavigation';import { TeammateList } from '@/session/TeammateList';import { RemoteCompanionAvatar } from '@/components/RemoteCompanionAvatar';-import { MainWindowEmptyState, StatusDot } from '@/components/MobilePrimitives';-import { SimpleStackHeader, simpleScreenSafeAreaEdges } from '@/platform/chrome';+import { MainWindowActionButton, MainWindowEmptyState, RemoteListSyncingPlaceholder, StatusDot } from '@/components/MobilePrimitives';+import { mobileInteractionStyles } from '@/components/mobileInteractionStyles';+import { SimpleStackHeader, simpleScrollInsetProps, simpleScrollScreenSafeAreaEdges } from '@/platform/chrome';import { useAuth } from '@/auth/AuthContext';import {type HostedRemoteCollectionItem,@@ -85,11 +86,12 @@ export default function RemoteCollectionScreen() {return (<SafeAreaView- edges={simpleScreenSafeAreaEdges()}+ edges={simpleScrollScreenSafeAreaEdges()}style={styles.safeArea}testID="remoteResources.screen"><SimpleStackHeader+ scrollEdgebackTestID="remoteResources.backButton"onBack={() => goBackGuarded(router)}subtitle={collectionId === 'teammates' ? undefined : targets.length > 1 ? t('devices.resources.hostCount', { count: targets.length }) : targets[0]?.deviceName}@@ -100,17 +102,38 @@ export default function RemoteCollectionScreen() {items={items} loading={loading} refreshing={refreshing} error={error}connectionState={connectionState}isOnline={isOnline}- onRefresh={() => void load(true)} onSelect={openItem} /> : loading && items.length === 0 ? (+ onRefresh={() => void load(true)} onSelect={openItem} scrollInsetProps={simpleScrollInsetProps} /> : loading && items.length === 0 ? (<View style={styles.center}>- <ActivityIndicator color={colors.textSecondary} />- <Text style={styles.muted}>{t('devices.resources.loading')}</Text>+ <RemoteListSyncingPlaceholder testID="remoteResources.loading" /></View>) : (<FlatList+ {...simpleScrollInsetProps}contentContainerStyle={items.length === 0 ? styles.emptyContent : styles.listContent}data={items}keyExtractor={(item) => item.key}- refreshControl={<RefreshControl refreshing={refreshing} onRefresh={() => void load(true)} />}+ refreshControl={<RefreshControl refreshing={refreshing} onRefresh={() => void load(true)} tintColor={colors.textSecondary} />}+ ListHeaderComponent={error && items.length > 0 ? (+ // 已有内容时加载失败:列表保持可读,顶部行内提示 + 重试(与伙伴列表同一呈现)。+ <View style={styles.noticeRow}>+ <Text accessibilityRole="alert" style={styles.noticeText} testID="remoteResources.error">+ {t('devices.resources.stale')}+ </Text>+ <Pressable+ accessibilityLabel={t('devices.resources.retry')}+ accessibilityRole="button"+ accessibilityState={{ busy: refreshing || undefined, disabled: refreshing }}+ disabled={refreshing}+ onPress={() => void load(true)}+ style={({ pressed }) => [styles.retry, pressed && styles.pressed]}+ testID="remoteResources.refresh"+ >+ {refreshing+ ? <ActivityIndicator color={colors.textSecondary} />+ : <RefreshCw color={colors.textSecondary} size={iconSize.sm} strokeWidth={iconStroke.regular} />}+ </Pressable>+ </View>+ ) : null}renderItem={({ item: hosted }) => {const display = hosted.item.display;const titleText = resolveRemoteText(display.title, i18n.language);@@ -155,11 +178,31 @@ export default function RemoteCollectionScreen() {);}}ListEmptyComponent={(- <MainWindowEmptyState- copy={error ?? t('devices.resources.emptyCopy')}- testID={error ? 'remoteResources.error' : 'remoteResources.empty'}- title={error ? t('devices.resources.loadFailed') : t('devices.resources.emptyTitle')}- />+ error ? (+ // 无内容时加载失败:错误态而非空态,附重试。+ <MainWindowEmptyState+ centered+ copy={error}+ style={styles.emptyState}+ testID="remoteResources.error"+ title={t('devices.resources.loadFailed')}+ >+ <MainWindowActionButton+ action={{+ busy: refreshing,+ label: t('devices.resources.retry'),+ onPress: () => void load(true),+ testID: 'remoteResources.retry',+ }}+ />+ </MainWindowEmptyState>+ ) : (+ <MainWindowEmptyState+ copy={t('devices.resources.emptyCopy')}+ testID="remoteResources.empty"+ title={t('devices.resources.emptyTitle')}+ />+ ))}/>)}@@ -170,7 +213,10 @@ export default function RemoteCollectionScreen() {const makeStyles = (colors: ThemeColors) => StyleSheet.create({safeArea: { backgroundColor: colors.surface, flex: 1 },center: { alignItems: 'center', flex: 1, gap: spacing.sm, justifyContent: 'center' },- muted: { color: colors.textSecondary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption },+ emptyState: { gap: spacing.md, padding: spacing.xl },+ noticeRow: { alignItems: 'center', flexDirection: 'row', gap: spacing.sm },+ noticeText: { color: colors.errorText, flex: 1, fontSize: typeScale.footnote, lineHeight: lineHeight.caption },+ retry: { alignItems: 'center', justifyContent: 'center', minHeight: 44, minWidth: 44 },listContent: { gap: spacing.sm, padding: spacing.md },emptyContent: { flexGrow: 1, justifyContent: 'center', padding: spacing.xl },row: {@@ -185,7 +231,7 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({paddingHorizontal: spacing.md,paddingVertical: spacing.sm,},- pressed: { opacity: 0.72 },+ pressed: mobileInteractionStyles.pressed,unread: { width: 7, height: 7, borderRadius: radius.pill, backgroundColor: colors.statusAwaiting },connectionDot: { position: 'absolute', bottom: 0, right: 0 },avatar: {diff --git a/apps/mobile/app/sessions/[sessionId].tsx b/apps/mobile/app/sessions/[sessionId].tsxindex cb2762dcc4..47a2a6e45d 100644--- a/apps/mobile/app/sessions/[sessionId].tsx+++ b/apps/mobile/app/sessions/[sessionId].tsx@@ -300,6 +300,10 @@ import {mergeSlashCommands,} from '@/session/composerPalette';import { buildComposerTouchLayout } from '@/session/composerTouchLayout';+import { useComposerDock } from '@/session/composerMorph';+import { DockKeyboardLift, DockKeyboardViewportSpacer } from '@/session/ComposerDockKeyboardFollow';+import { useComposerPillOpen } from '@/session/useComposerPillOpen';+import { composerBottomContentPadding, composerGeometry } from '@/session/composerGeometry';import {flushComposerDraftWrites,readComposerDocumentDraft,@@ -622,6 +626,8 @@ import { pathDisplayName } from '@/session/chatPathCandidate';import { fetchRemoteAbsFileToUrl } from '@/session/remoteAbsFileFetch';import { showActionMenu, usesSystemActionMenu } from '@/platform/chrome';import { ChatFileChipMenuSheet } from '@/session/ChatFileChipMenuSheet';+import { SessionTransientNotice, type SessionTransientNoticeValue } from '@/session/SessionTransientNotice';+import { formatLocalizedSeconds } from '@/session/sessionDurationFormat';import {chatFileChipMenuRows,chatFileChipMenuTitle,@@ -2485,6 +2491,26 @@ export default function SessionScreen() {() => currentSession ? buildSessionRuntimeOptions(currentSession, capabilities) : null,[capabilities, currentSession],);+ // 任务菜单用量卡的模型名:能力目录 / 供应商目录里的展示名,找不到时由卡片自行兜底(不直接露原始 id)。+ const sessionModelDisplayName = useMemo((): string | null => {+ const model = currentSession?.model?.trim();+ if (!model) return null;+ const fromRuntime = runtimeOptions?.currentModel?.label?.trim();+ if (fromRuntime && fromRuntime !== model) return fromRuntime;+ const providers = composerDeviceProviders.providers;+ const ordered = currentSession?.providerId+ ? [...providers.filter((p) => p.id === currentSession.providerId), ...providers.filter((p) => p.id !== currentSession.providerId)]+ : providers;+ for (const provider of ordered) {+ const catalogs: ReadonlyArray<ReadonlyArray<{ id: string; name?: string }> | undefined> = Object.values(provider.models ?? {});+ for (const models of catalogs) {+ const match: { id: string; name?: string } | undefined = models?.find((item) => item.id === model);+ const name: string | undefined = match?.name?.trim();+ if (name && name !== model) return name;+ }+ }+ return null;+ }, [composerDeviceProviders.providers, currentSession?.model, currentSession?.providerId, runtimeOptions]);// pending intent 只覆盖 composer / selector 的展示,不改 RemoteSession 的真实 DB 字段;// main 在下一条消息发送时提交切换,sessions:patched 回流后展示自然交回真实行。const composerDisplaySession = useMemo(() => {@@ -2689,9 +2715,10 @@ export default function SessionScreen() {windowDimensions.height,detailViewport.width,]);- const composerTouchLayout = useMemo(() => buildComposerTouchLayout({- screenWidth: detailViewport.width,- }), [detailViewport.width]);+ const composerDock = useComposerDock();+ const composerTouchLayout = useMemo(() => ({ ...buildComposerTouchLayout({ screenWidth: detailViewport.width }),+ ...(composerDock.enabled ? { composerPaddingHorizontal: composerGeometry.horizontalInset } : {}),+ }), [detailViewport.width, composerDock.enabled]);// Wide nonpersistent windows offer quick switching separately from back navigation.const wideSessionNav = useMemo(() => buildWideSessionNavLayout({iosPad: Platform.OS === 'ios' && Platform.isPad,@@ -5542,16 +5569,27 @@ export default function SessionScreen() {setError(t('session.outbox.creationRecoveryRequired'));return;}- setQueueSelectedClientId(null);- const owner = getMobileAuthOwner();- const remove = async () => {- if (isDurableOutboxUnsent(record)) {- await mobileDurableOutbox.update(record, { state: 'host-owned', cleanupOutcome: 'cancelled', cancelRequested: true, error: undefined });- } else await mobileDurableOutbox.update(record, { cancelRequested: true, state: 'confirming' });+ // 删除发送失败的消息不可撤销:先确认(破坏性按钮),确认后才真正移除。+ const confirmRemove = () => {+ setQueueSelectedClientId(null);+ const owner = getMobileAuthOwner();+ const remove = async () => {+ if (isDurableOutboxUnsent(record)) {+ await mobileDurableOutbox.update(record, { state: 'host-owned', cleanupOutcome: 'cancelled', cancelRequested: true, error: undefined });+ } else await mobileDurableOutbox.update(record, { cancelRequested: true, state: 'confirming' });+ };+ void remove().catch((err) => {+ if (isMobileAuthOwnerCurrent(owner) && outboxSessionAliveRef.current === sessionId) setError(formatRemoteError(err));+ });};- void remove().catch((err) => {- if (isMobileAuthOwnerCurrent(owner) && outboxSessionAliveRef.current === sessionId) setError(formatRemoteError(err));- });+ Alert.alert(+ t('session.outbox.deleteConfirmTitle'),+ t('session.outbox.deleteConfirmBody'),+ [+ { text: t('session.common.cancel'), style: 'cancel' },+ { text: t('session.common.delete'), style: 'destructive', onPress: confirmRemove },+ ],+ );};const outboxDisplayItems = useMemo(() => outboxItems.map(outboxDisplayItem), [outboxItems]);@@ -8187,6 +8225,14 @@ export default function SessionScreen() {// chip 长按菜单(浮动面板,ContextSheet/模型选择面板同款):target 即开关。const [chipMenuTarget, setChipMenuTarget] = useState<ChatFilePathTarget | null>(null);+ // 会话页的短暂提示(复制路径等),与文件浏览器「已复制路径」同口径。+ const [transientNotice, setTransientNotice] = useState<SessionTransientNoticeValue | null>(null);+ const transientNoticeSeqRef = useRef(0);+ const showTransientNotice = useCallback((message: string) => {+ transientNoticeSeqRef.current += 1;+ setTransientNotice({ id: transientNoticeSeqRef.current, message });+ }, []);+ const dismissTransientNotice = useCallback(() => setTransientNotice(null), []);const [chipShareBusy, setChipShareBusy] = useState(false);screenshotBlockedByOverlayRef.current = Boolean(settingsOpen@@ -8361,14 +8407,21 @@ export default function SessionScreen() {}case 'copyPath':// 对齐桌面「复制文件路径」:保留远端原始绝对路径,不换算本机形态。- void Clipboard.setStringAsync(target.absPath).catch(() => undefined);+ // 反馈与文件浏览器一致:成功短暂提示「已复制路径」,失败明确告知(不再静默吞掉)。setChipMenuTarget(null);+ void Clipboard.setStringAsync(target.absPath).then(+ (ok) => {+ if (ok === false) Alert.alert(t('message.renderer.copyPathFailed'));+ else showTransientNotice(t('message.renderer.copiedPath'));+ },+ () => Alert.alert(t('message.renderer.copyPathFailed')),+ );return;case 'share':void shareChipFile(target);return;}- }, [applyComposerDocument, applyComposerDraft, deviceId, deviceName, openChatPathTarget, router, sessionId, shareChipFile]);+ }, [applyComposerDocument, applyComposerDraft, deviceId, deviceName, openChatPathTarget, router, sessionId, shareChipFile, showTransientNotice, t]);handleChipMenuActionRef.current = handleChipMenuAction;// 会话菜单元数据操作(重命名 / 置顶 / 归档 / 删除 / 恢复)乐观写:与首页@@ -8777,6 +8830,9 @@ export default function SessionScreen() {}}, [applyComposerDocument, deviceId, maker, messageActionBusy, requestSync, rewindState, sessionId]);+ const dockKeyboardFollow = Platform.OS === 'ios' && composerDock.enabled && nativeComposerFrameAvailable+ && adaptiveWindow.regions.length === 0 && sessionOperationLayout.composerSlot === 'editable'+ && !shareSelectionActive && !isSharedTaskAccessRevoked;const headerNode = (<><Stack.Screen options={{ gestureEnabled: !sessionListDrawerOverlayMounted }} />@@ -8785,6 +8841,7 @@ export default function SessionScreen() {<CompanionHeader key={`${auth.accountGeneration}:${deviceId}:${companionResource.ref.id}`}resource={companionResource} deviceId={deviceId} deviceName={deviceName} online={!remoteUnavailableReason} controlsReady={companionEntry.ready}onSearch={() => setSearchOpen(true)}+ onBack={goBackToHome}onOpenNavigation={() => setCompanionNavigation({ scope: companionNavigationScope, open: true })} /></> : <SessionHeaderBarhorizontalSystemHeader={horizontalSystemHeader}@@ -8807,7 +8864,7 @@ export default function SessionScreen() {onNewSession={paneLayout.persistent ? handleDrawerNewSession : undefined}onOpenFiles={() => {if (!currentSession?.workingDir) return;- router.push({+ guardedPush({pathname: '/files/[sessionId]',params: { sessionId, deviceId, deviceName },});@@ -8816,7 +8873,7 @@ export default function SessionScreen() {onOpenUsage={() => openSessionMenu('info')}onOpenRemoteDesktop={() => {if (!deviceId) return;- router.push({+ guardedPush({pathname: '/devices/desktop/[deviceId]',params: { deviceId, deviceName },});@@ -8846,6 +8903,8 @@ export default function SessionScreen() {<PaneViewportProvider value={detailViewport}><ComposerKeyboardAvoidingViewkeyboard={keyboardState}+ // iOS composer dock: the spacer / lift below follow the keyboard per frame instead.+ enabled={!dockKeyboardFollow}// 抽屉开着时把背后内容从读屏树里摘掉:iOS 用 accessibilityElementsHidden// (与抽屉侧 accessibilityViewIsModal 配对),Android 用 importantForAccessibility// ——后者才对 TalkBack 生效(与 ComposerRichInput 的双平台配对惯例一致)。@@ -8892,9 +8951,10 @@ export default function SessionScreen() {leavingSharing={sharedTaskExit.busy}onOpenSharing={() => {setSettingsOpen(false);- router.push({ pathname: '/shared-session', params: { sessionId, deviceId } });+ guardedPush({ pathname: '/shared-session', params: { sessionId, deviceId } });}}providerName={providerAccountLabel}+ modelLabel={sessionModelDisplayName}messageOnly={sessionManagedByHost}onOpenSearch={() => {setSessionSearchPendingOpen(true);@@ -8920,7 +8980,7 @@ export default function SessionScreen() {onOpenWorkspace={() => {if (!currentSession.workingDir) return;setSettingsOpen(false);- router.push({+ guardedPush({pathname: '/files/[sessionId]',params: { sessionId, deviceId, deviceName },});@@ -9337,13 +9397,17 @@ export default function SessionScreen() {</View>{!isSharedTaskAccessRevoked && nativeComposerFrameAvailable && sessionOperationLayout.composerSlot === 'editable' && !shareSelectionActive ? (- <SessionHeaderNativeBlur- edge="bottom"- height={bottomOverlayHeight + spacing.xxl}- inset={nativeShellLayout.keyboardBottomInset}- />+ <DockKeyboardLift active={dockKeyboardFollow} restingBottom={composerDock.restingBottom} keyboardGap={composerDock.keyboardGap}+ pointerEvents="none" style={StyleSheet.absoluteFill}>+ <SessionHeaderNativeBlur+ edge="bottom"+ height={bottomOverlayHeight + spacing.xxl}+ inset={dockKeyboardFollow ? 0 : nativeShellLayout.keyboardBottomInset}+ />+ </DockKeyboardLift>) : null}- {!isSharedTaskAccessRevoked && <View+ {!isSharedTaskAccessRevoked && <DockKeyboardLift+ active={dockKeyboardFollow} restingBottom={composerDock.restingBottom} keyboardGap={composerDock.keyboardGap}pointerEvents="box-none"testID="session.bottomViewport"style={[@@ -9378,7 +9442,7 @@ export default function SessionScreen() {// Region already excludes the keyboard. Its boundary clips only// the existing safe-area padding, without lifting the input twice.{ bottom: adaptiveWindow.regions.length > 0- ? -insets.bottom : nativeShellLayout.keyboardBottomInset },+ ? -insets.bottom : dockKeyboardFollow ? 0 : nativeShellLayout.keyboardBottomInset },]}testID="session.bottomLayer">@@ -9391,7 +9455,20 @@ export default function SessionScreen() {{paddingBottom: sessionOperationLayout.composerSlot === 'pending-interaction'? 0- : insets.bottom,+ : dockKeyboardFollow+ // Constant resting padding; DockKeyboardLift adds the keyboard part.+ ? composerBottomContentPadding(composerDock.restingBottom, 0, spacing.xs)+ : composerDock.enabled && sessionOperationLayout.composerSlot === 'editable'+ ? keyboardState.visible+ // The existing native shell / reservation viewport owns+ // keyboard lift. Keep its safe-area compensation once.+ ? insets.bottom + composerDock.keyboardGap - spacing.xs+ : composerBottomContentPadding(composerDock.restingBottom,+ adaptiveWindow.regions.length > 0+ ? windowDimensions.height - composerRegion.y - composerRegion.height - insets.bottom+ : nativeShellLayout.keyboardBottomInset,+ spacing.xs)+ : insets.bottom,},nativeShellLayout.wideViewport && { maxWidth: nativeShellLayout.contentMaxWidth },]}@@ -9663,7 +9740,8 @@ export default function SessionScreen() {) : null}</View></View>- </View>}+ </DockKeyboardLift>}+ <DockKeyboardViewportSpacer active={dockKeyboardFollow} /></ComposerKeyboardAvoidingView></PaneViewportProvider>@@ -9682,6 +9760,11 @@ export default function SessionScreen() {width={windowDimensions.width}/>) : null}+ <SessionTransientNotice+ notice={transientNotice}+ onDismiss={dismissTransientNotice}+ top={Math.max(topOverlayHeight, insets.top + 44) + spacing.sm}+ /><MessageHistoryOverlay>{/* Keep the drawer above resident histories, including its closing animation. */}<SessionListDrawer@@ -10447,7 +10530,9 @@ function SessionComposerInput({const { colors } = useTheme();const styles = useThemedStyles(makeStyles);const windowDimensions = useWindowDimensions();+ const composerDock = useComposerDock();const [composerFocused, setComposerFocused] = useState(false);+ const composerPillOpen = useComposerPillOpen(composerDock.enabled && canUseComposer, () => composerInputRef.current?.focus());const [composerInputContentHeight, setComposerInputContentHeight] = useState(COMPOSER_INPUT_SINGLE_LINE_CONTENT_HEIGHT);const [voiceDraftCaretFrame, setVoiceDraftCaretFrame] = useState({ left: 0, top: 0 });const voiceDraftCaretRef = useRef<View>(null);@@ -10546,7 +10631,7 @@ function SessionComposerInput({armed: composerVoiceHoldArmed,draftText: draft,});- const composerCardActive = (canUseComposer && composerFocused)+ const composerCardActive = (canUseComposer && (composerFocused || composerPillOpen.opening))|| modelSheetOpen|| permissionSheetOpen|| voiceStartPending@@ -10811,6 +10896,7 @@ function SessionComposerInput({<ComposerFrameonTouchStart={recommendationPresentation.hide}expanded={composerCardActive}+ expandToken={composerPillOpen.expandToken}unframed={!nativeComposerFrameAvailable}style={styles.composerScrollFrame}>@@ -10832,6 +10918,8 @@ function SessionComposerInput({<MobileComposerInputRowkey={sessionId}frameOutside={nativeComposerFrameAvailable}+ collapsedHeight={composerDock.enabled ? composerDock.pillHeight : undefined}+ onCollapsedPress={composerPillOpen.onCollapsedPress}accessibilityLabel={t('session.screen.composerPlaceholder')}accessibilityHint={composerLayout.input.disabledReason ?? undefined}accessoryAbove={controls.attachmentTray}@@ -11001,18 +11089,22 @@ function SessionSearchSheet({</View></View><View style={styles.searchPanel} testID="session.searchPanel">- <TextInput- accessibilityLabel={t('session.screen.searchPlaceholder')}- autoCapitalize="none"- autoCorrect={false}- autoFocus={MOBILE_VISUAL_MOCK_ENABLED && visible}- onChangeText={onChangeQuery}- placeholder={t('session.screen.searchPlaceholder')}- placeholderTextColor={colors.textPlaceholder}- style={styles.searchInput}- testID="session.searchInput"- value={query}- />+ {/* 单行搜索框统一胶囊:底色 / 描边 / 高度与首页 HomeSearchBar 对齐(HomeSearchBar 自带筛选钮,这里不需要,故只对齐样式)。 */}+ <View style={styles.searchInputPill}>+ <Search color={colors.textSecondary} size={iconSize.md} strokeWidth={iconStroke.regular} />+ <TextInput+ accessibilityLabel={t('session.screen.searchPlaceholder')}+ autoCapitalize="none"+ autoCorrect={false}+ autoFocus={MOBILE_VISUAL_MOCK_ENABLED && visible}+ onChangeText={onChangeQuery}+ placeholder={t('session.screen.searchPlaceholder')}+ placeholderTextColor={colors.textPlaceholder}+ style={styles.searchInput}+ testID="session.searchInput"+ value={query}+ />+ </View><View style={styles.searchToolbar}><Text style={styles.searchCounter} testID="session.searchCounter">{normalizedQuery@@ -11024,6 +11116,7 @@ function SessionSearchSheet({accessibilityLabel={t('session.screen.searchPrevious')}disabled={!hasHits}onPress={() => onMove('previous')}+ hitSlop={5}style={styles.searchNavButton}testID="session.searchPreviousButton">@@ -11033,6 +11126,7 @@ function SessionSearchSheet({accessibilityLabel={t('session.screen.searchNext')}disabled={!hasHits}onPress={() => onMove('next')}+ hitSlop={5}style={styles.searchNavButton}testID="session.searchNextButton">@@ -11082,6 +11176,7 @@ function SessionSyncPlaceholder({<RouteActionButtonaccessibilityLabel={t('session.screen.resync')}disabled={loading}+ hitSlop={7}onPress={onSync}style={styles.sessionSyncButton}testID="session.unsyncedSyncButton"@@ -11474,10 +11569,8 @@ function formatModelWindowTokens(value: number): string {}function formatComposerActivityElapsed(seconds: number): string {- const safeSeconds = Math.max(0, Math.floor(seconds));- const minutes = Math.floor(safeSeconds / 60);- const rest = safeSeconds % 60;- return minutes > 0 ? `${minutes}m ${rest}s` : `${rest}s`;+ // 按界面语言本地化(中文「3 分 25 秒」),不再固定输出英文 `3m 25s`。+ return formatLocalizedSeconds(seconds, { alwaysShowSeconds: true });}function formatComposerActivityTokenCount(tokenUsage: number): string {@@ -11736,16 +11829,23 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({paddingHorizontal: spacing.lg,paddingVertical: spacing.md,},- searchInput: {- backgroundColor: colors.surface,+ searchInputPill: {+ alignItems: 'center',+ backgroundColor: colors.surfaceElevated,borderColor: colors.border,- borderRadius: radius.container,+ borderRadius: radius.pill,borderWidth: StyleSheet.hairlineWidth,+ flexDirection: 'row',+ gap: spacing.sm,+ minHeight: 44,+ paddingHorizontal: spacing.lg,+ },+ searchInput: {color: colors.textPrimary,- fontSize: typeScale.body,- minHeight: 42,- paddingHorizontal: spacing.md,- paddingVertical: spacing.xs,+ flex: 1,+ fontSize: typeScale.bodySmall,+ minWidth: 0,+ paddingVertical: spacing.sm,},searchToolbar: {alignItems: 'center',@@ -11762,7 +11862,8 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({searchButtons: {alignItems: 'center',flexDirection: 'row',- gap: spacing.xs,+ // 两钮各 hitSlop 5 扩到 44pt 命中区,间距 ≥10 才不互相重叠。+ gap: spacing.md,},searchNavButton: {alignItems: 'center',diff --git a/apps/mobile/app/sessions/new.tsx b/apps/mobile/app/sessions/new.tsxindex f0b46442d3..84a4957c80 100644--- a/apps/mobile/app/sessions/new.tsx+++ b/apps/mobile/app/sessions/new.tsx@@ -5,10 +5,14 @@ import { buildOutboxItem, createOutboxClientId } from '@/session/sessionOutbox';import type { DurableOutboxRecord } from '@/session/durableOutbox';import { stripTrailingPathSeparators } from '@cindy/maker-shared/path-text';import { takeRefinementContextTail } from '@cindy/voice-input-core';-import { Stack, useIsFocused, useLocalSearchParams, useRouter } from 'expo-router';+import { Stack, useIsFocused, useLocalSearchParams, useNavigation, useRouter } from 'expo-router';import { NewTaskSelectionSheet } from '@/session/NewTaskSelectionSheet';import { resolveWorkspacePickerFrame, type WorkspacePickerFrame } from '@/session/workspacePickerPlacement';import { simpleScreenSafeAreaEdges } from '@/platform/chrome/SimpleStackHeader';+import { readComposerEntry, useComposerDock } from '@/session/composerMorph';+import { useComposerPillOpen } from '@/session/useComposerPillOpen';+import { ComposerDockKeyboardSpacer } from '@/session/ComposerDockKeyboardSpacer';+import { composerGeometry } from '@/session/composerGeometry';import Constants from 'expo-constants';import { MOBILE_VISUAL_MOCK_ENABLED } from '@/config/env';import { formatMobileBuildLabel, normalizeBuildInfo } from '@/config/buildInfo';@@ -436,6 +440,7 @@ export default function NewRemoteSessionScreen() {workingDir?: string;deviceExplicit?: string;visualFocusComposer?: string;+ composerMorph?: string;visualDraft?: string;suggestion?: string;recoverySessionId?: string;@@ -444,6 +449,20 @@ export default function NewRemoteSessionScreen() {const routeDeviceName = String(params.deviceName ?? routeDeviceId);const initialWorkingDir = readRouteString(params.workingDir);const visualFocusComposer = MOBILE_VISUAL_MOCK_ENABLED && readRouteString(params.visualFocusComposer) === '1';+ // The home action lands in the compact pill; only a user's tap opens the card and keyboard.+ const [entryMorph] = useState(() => readComposerEntry(readRouteString(params.composerMorph) ?? undefined));+ const navigation = useNavigation();+ // The morph stood in for the push; leaving should still slide back normally.+ // Switch only after the entry transition: changing it on mount would make the+ // push itself slide in under the morph overlay.+ useEffect(() => {+ if (!entryMorph) return;+ const restore = () => navigation.setOptions({ animation: 'default' });+ const unsubscribe = navigation.addListener('transitionEnd' as never, restore);+ const fallback = setTimeout(restore, 1600);+ return () => { unsubscribe(); clearTimeout(fallback); };+ }, [entryMorph, navigation]);+ const composerDock = useComposerDock();const visualInitialDraft = MOBILE_VISUAL_MOCK_ENABLED ? readRouteString(params.visualDraft) : null;const router = useRouter();const nativeSelectionSheet = Platform.OS === 'ios';@@ -857,6 +876,7 @@ export default function NewRemoteSessionScreen() {const userTouchedDeviceRef = useRef(false);const userTouchedWorkspaceRef = useRef(false);const firstMessageInputRef = useRef<NativeTextInput>(null);+ const composerPillOpen = useComposerPillOpen(composerDock.enabled, () => firstMessageInputRef.current?.focus());const voiceDraftScrollRef = useRef<ScrollView>(null);const voiceRecordingActiveRef = useRef(false);const voicePermissionRequestInFlightRef = useRef(false);@@ -874,7 +894,7 @@ export default function NewRemoteSessionScreen() {const voiceDictionaryLearningTrackerRef = useRef<MobileVoiceDictionaryLearningTracker | null>(null);const creatingRef = useRef(false);const [firstMessageInputContentHeight, setFirstMessageInputContentHeight] = useState(MOBILE_COMPOSER_INPUT_SINGLE_LINE_HEIGHT);- const [firstMessageInputFocused, setFirstMessageInputFocused] = useState(false);+ const [firstMessageInputFocused, setFirstMessageInputFocused] = useState(visualFocusComposer);const [voiceDraftCaretFrame, setVoiceDraftCaretFrame] = useState({ left: 0, top: 0 });const voiceDraftCaretRef = useRef<View>(null);const voiceDraftMeasuredBlockRef = useRef<View>(null);@@ -1635,7 +1655,7 @@ export default function NewRemoteSessionScreen() {armed: composerVoiceHoldArmed,draftText: draft.firstMessage,});- const composerCardActive = firstMessageInputFocused+ const composerCardActive = firstMessageInputFocused || composerPillOpen.opening|| modelSheetOpen|| permissionSheetOpen|| voiceStartPending@@ -5511,7 +5531,7 @@ export default function NewRemoteSessionScreen() {]);return (- <SafeAreaView edges={simpleScreenSafeAreaEdges()} style={styles.safeArea} testID="newSession.screen">+ <SafeAreaView edges={composerDock.enabled ? ['left', 'right'] : simpleScreenSafeAreaEdges()} style={styles.safeArea} testID="newSession.screen">{Platform.OS === 'ios' ? (<><Stack.Screen options={{ headerShown: true, headerBackVisible: false, headerShadowVisible: false, title: '', headerStyle: { backgroundColor: colors.surface }, headerTintColor: colors.textPrimary }} />@@ -5523,12 +5543,14 @@ export default function NewRemoteSessionScreen() {<ComposerKeyboardAvoidingViewkeyboard={keyboardState}bottomInset={safeAreaInsets.bottom}+ // The dock spacer below follows the keyboard frame by frame instead.+ enabled={!composerDock.enabled}behavior={keyboardAvoidingBehaviorForPlatform(Platform.OS === 'ios' ? 'ios' : Platform.OS === 'android' ? 'android' : 'web',)}style={styles.keyboard}>- <View style={styles.screen}>+ <View style={[styles.screen, composerDock.enabled && { paddingHorizontal: composerGeometry.horizontalInset }]}>{Platform.OS !== 'ios' || buildLabel || creating ? <View style={styles.topBar}>{Platform.OS !== 'ios' ? <ScreenBackButtonhitSlop={12}@@ -5543,7 +5565,7 @@ export default function NewRemoteSessionScreen() {</View> : null}<View ref={workspacePickerHostRef} collapsable={false} onLayout={measureWorkspacePicker} style={{ flex: 1 }}>- <ScrollView style={{ flex: 1 }} contentContainerStyle={styles.bottomCluster}+ <ScrollView style={{ flex: 1 }} contentContainerStyle={[styles.bottomCluster, composerDock.enabled && { paddingBottom: 0 }]}onScrollBeginDrag={() => setWorkspacePickerOpen(false)}keyboardShouldPersistTaps="handled" showsVerticalScrollIndicator={false}><View style={styles.selectorStack}>@@ -5980,6 +6002,10 @@ export default function NewRemoteSessionScreen() {accessibilityLabel={t('session.new.firstMessagePlaceholder')}accessoryAbove={attachments.length > 0 || pendingUploads.length > 0 || pastePlaceholderCount > 0 ? renderComposerAttachmentTray() : null}autoFocus={visualFocusComposer}+ entryTransitionId={entryMorph?.id}+ collapsedHeight={composerDock.enabled ? composerDock.pillHeight : undefined}+ onCollapsedPress={composerPillOpen.onCollapsedPress}+ expandToken={composerPillOpen.expandToken}cardActive={composerCardActive}caretHidden={voiceIsListening}cursorColor={colors.inputCaret}@@ -6073,6 +6099,9 @@ export default function NewRemoteSessionScreen() {</View></View></ScrollView>+ {composerDock.enabled ? (+ <ComposerDockKeyboardSpacer restingBottom={composerDock.restingBottom} keyboardGap={composerDock.keyboardGap} />+ ) : null}{/* Keep the floating panel inside its native touch bounds on Android. */}{!nativeSelectionSheet && workspacePickerOpen && workspacePickerFrame ? (<View style={[styles.workspacePickerPanel, workspacePickerFrame]} testID="newSession.workspacePickerPanel">@@ -6717,9 +6746,10 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({lineHeight: lineHeight.caption,marginTop: 1,},+ // 成句说明:§3「说明、提示」档 13/18 · textSecondary。workspaceEmptyText: {- color: colors.textTertiary,- fontSize: typeScale.caption,+ color: colors.textSecondary,+ fontSize: typeScale.footnote,lineHeight: lineHeight.caption,paddingHorizontal: spacing.sm,paddingVertical: spacing.sm,@@ -7162,6 +7192,7 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({borderColor: colors.border,},sendButtonPressed: { opacity: 0.86 },- pressed: { opacity: 0.65 },+ // 与 mobileInteractionStyles.pressed 同值(0.72),全端按压反馈统一。+ pressed: { opacity: 0.72 },disabled: { opacity: 0.44 },});diff --git a/apps/mobile/app/settings.tsx b/apps/mobile/app/settings.tsxindex 1c5f3cc4e2..588182fc9d 100644--- a/apps/mobile/app/settings.tsx+++ b/apps/mobile/app/settings.tsx@@ -5,12 +5,10 @@ import * as Clipboard from 'expo-clipboard';import * as Updates from 'expo-updates';import { useUpdates } from 'expo-updates';import { useRouter } from 'expo-router';-import { Children, Fragment, isValidElement, useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from 'react';+import { useCallback, useEffect, useMemo, useRef, useState } from 'react';import {Alert,DevSettings,- FlatList,- Image,Linking,Platform,Pressable,@@ -19,11 +17,10 @@ import {View,useWindowDimensions,} from 'react-native';-import { Text, TextInput } from '@/components/AppText';+import { Text } from '@/components/AppText';import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context';-import { ChevronDown, ChevronRight, Ellipsis, X } from 'lucide-react-native';+import { Ellipsis } from 'lucide-react-native';import { useTranslation } from 'react-i18next';-import type { DeviceView } from '@cindy/device-link';import { useAuth } from '@/auth/AuthContext';import { loginText } from '@/auth/loginMessages';import {@@ -44,11 +41,13 @@ import {MainWindowActionGroup,StatusDot,} from '@/components/MobilePrimitives';+import { mobileInteractionStyles } from '@/components/mobileInteractionStyles';+import { MobileUserAvatar } from '@/components/MobileUserAvatar';import {NativePullDownMenu,- NativeSwitch,SimpleStackHeader,- simpleScreenSafeAreaEdges,+ simpleScrollInsetProps,+ simpleScrollScreenSafeAreaEdges,usesNativePullDownMenu,} from '@/platform/chrome';import {@@ -56,7 +55,6 @@ import {AUTH_API_BASE_URL,AUTH_REGION,DESKTOP_PACKAGE_VERSION,- DEVICE_LINK_API_BASE_URL,IS_OTA_SELFHOST,IS_TESTFLIGHT_BUILD,REVIEW_MODE,@@ -84,18 +82,9 @@ import {import {hydrateMobileVoiceDictionary,readCachedMobileVoiceDictionarySnapshot,- refreshMobileVoiceDictionary,subscribeMobileVoiceDictionaryCache,} from '@/session/mobileVoiceDictionaryCache';-import {- buildMobileVoiceDictionaryEntryViews,- collectMobileVoiceDictionaryHosts,- patchMobileVoiceDictionaryHosts,- type MobileVoiceDictionaryEntryView,- type MobileVoiceDictionaryHost,-} from '@/session/mobileVoiceDictionaryView';-import { DEVICE_LINK_VOICE_DICTIONARY_GET_CHANNEL } from '@cindy/maker-shared/device-link-contract';-import type { MobileVoiceDictionarySnapshotResult } from '@cindy/maker-shared/device-link-contract';+import { buildMobileVoiceDictionaryEntryViews } from '@/session/mobileVoiceDictionaryView';import { buildMobileUpdateInfoRows, currentMobileOtaVersion } from '@/settings/updateInfo';import { shouldCheckBundleUpdate } from '@/update/bundleUpdate';import {@@ -113,15 +102,22 @@ import { SheetModal } from '@/session/SheetModal';import { SheetSurface } from '@/session/SheetSurface';import { computeContextSheetSnapHeights, type ContextSheetSnap } from '@/session/contextSheetModel';import type { MobileChoiceOption } from '@/session/agentCapabilities';+import {+ ActionInfoRow,+ ChoicePickerRow,+ InfoRow,+ SettingsDisclosureRow,+ SettingsGroup,+ SettingsSwitchRow,+} from '@/session/SettingsGroupRows';+import { useSettingsDeviceDirectory } from '@/session/settingsDeviceDirectory';+import { confirmLogout } from '@/session/confirmLogout';import { THEME_PREFERENCES, useTheme, useThemedStyles, type ThemeColors } from '@/theme';import { fontWeight, iconSize, iconStroke, lineHeight, radius, spacing, typeScale } from '@/theme/tokens';+import { remoteSessionStore } from '@/session/remoteSessionStore';+import { useGuardedPush } from '@/utils/useGuardedPush';type UpdatePhase = 'idle' | 'checking' | 'downloading' | 'uptodate' | 'error';-type SelfDeviceNameSaveOptions = { acceptClosedDraft?: boolean };-type SelfDeviceNameQueuedWrite =- | { kind: 'rename'; name: string; options: SelfDeviceNameSaveOptions }- | { kind: 'reset' };-const SETTINGS_DEVICE_TIMEOUT_MS = 12_000;// 显示语言选项:「跟随系统」在前,英语作为第一个显式语言,其余语言按支持列表顺序排列。const LANGUAGE_OPTIONS: readonly LocalePreference[] = ['system',@@ -129,16 +125,25 @@ const LANGUAGE_OPTIONS: readonly LocalePreference[] = [...SUPPORTED_LOCALES.filter((locale) => locale !== 'en'),];+function hasRunningRemoteTasks(): boolean {+ return remoteSessionStore.getSessions().some((session) => remoteSessionStore.isSessionRunning(session.id));+}++/**+ * 设置页。二级页(语音词典、本机名称)是独立 stack 路由(app/settings/*),+ * 系统返回只退回这里。+ */export default function SettingsScreen() {const styles = useThemedStyles(makeStyles);const { colors, preference: themePreference, setPreference: setThemePreference } = useTheme();const router = useRouter();+ const push = useGuardedPush();const auth = useAuth();const { t } = useTranslation();const { locale, setLocale } = useLocale();const windowDimensions = useWindowDimensions();const safeAreaInsets = useSafeAreaInsets();- const { lastPresenceSnapshot, status, invoke } = useDeviceLink();+ const { status } = useDeviceLink();const [copiedRowId, setCopiedRowId] = useState<string | null>(null);const [loggingOut, setLoggingOut] = useState(false);const [localLogsEnabled, setLocalLogsEnabled] = useState(false);@@ -215,23 +220,10 @@ export default function SettingsScreen() {const [devServerEnvironmentBusy, setDevServerEnvironmentBusy] =useState(false);const updateCheckInFlightRef = useRef(false);- // 语音词典:手机只读展示被控桌面的词典快照(正本在桌面,手机不参与合并)。- const [dictionaryScreenOpen, setDictionaryScreenOpen] = useState(false);- const [desktopDevices, setDesktopDevices] = useState<readonly MobileVoiceDictionaryHost[]>([]);- const [dictionaryRefreshing, setDictionaryRefreshing] = useState(false);- /** 缓存在模块里,组件用这个计数强制重渲染(每次刷新完成 +1)。 */+ // 语音词典:手机只读展示被控桌面的词典快照(正本在桌面,手机不参与合并)。查看页是独立路由。+ const { desktopDevices, selfDeviceName } = useSettingsDeviceDirectory();+ /** 缓存在模块里,组件用这个计数强制重渲染。 */const [dictionaryRevision, setDictionaryRevision] = useState(0);- const [selfDeviceName, setSelfDeviceName] = useState<string | null>(null);- const [selfDeviceNameDraft, setSelfDeviceNameDraft] = useState('');- const [selfDeviceNameEditing, setSelfDeviceNameEditing] = useState(false);- const [selfDeviceNameSaving, setSelfDeviceNameSaving] = useState(false);- const [selfDeviceNameMessage, setSelfDeviceNameMessage] = useState<string | null>(null);- const selfDeviceNameDraftRef = useRef('');- const selfDeviceNameSaveSeqRef = useRef(0);- const selfDeviceNameWriteInFlightRef = useRef(false);- const selfDeviceNameCurrentWriteRef = useRef<SelfDeviceNameQueuedWrite | null>(null);- const selfDeviceNameQueuedWriteRef = useRef<SelfDeviceNameQueuedWrite | null>(null);- const selfDeviceNameRunQueuedWriteRef = useRef<() => void>(() => {});const systemDeviceName = buildMobileDeviceName({constantsDeviceName: Constants.deviceName,@@ -333,38 +325,6 @@ export default function SettingsScreen() {});}, [setThemePreference, t]);- useEffect(() => {- if (!auth.isAuthenticated || !auth.deviceId) {- setSelfDeviceName(null);- // 登出/未登录才清空电脑列表 —— 拉取失败不清(见下面 catch 的说明)。- setDesktopDevices([]);- return;- }-- let cancelled = false;- void auth.apiFetch<{ devices: DeviceView[] }>('/api/device-link/devices', {- baseUrl: DEVICE_LINK_API_BASE_URL,- timeoutMs: SETTINGS_DEVICE_TIMEOUT_MS,- })- .then((res) => {- if (cancelled) return;- const self = res.devices.find((device) => device.deviceId === auth.deviceId);- setSelfDeviceName(self?.name?.trim() || null);- // 同一份设备清单顺带筛出电脑:词典正本在电脑上,手机按电脑分别展示。- setDesktopDevices(collectMobileVoiceDictionaryHosts(res.devices));- })- .catch(() => {- if (cancelled) return;- setSelfDeviceName(null);- // 电脑列表刻意不清空:这只是一次拉取失败(断网、超时),不代表用户没有电脑。- // 清掉的话词典页会显示成「还没有电脑」,连带 hydrate/refresh 也没有 host 可- // 跑 —— 明明本地还有一份可用的离线缓存。真正该清空的时机是登出。- });-- return () => {- cancelled = true;- };- }, [auth]);useEffect(() => {if (!auth.isAuthenticated) {@@ -457,169 +417,9 @@ export default function SettingsScreen() {updatesEnabled,]);- const updateSelfDeviceNameDraft = useCallback((value: string) => {- selfDeviceNameDraftRef.current = value;- setSelfDeviceNameMessage(null);- setSelfDeviceNameDraft(value);- }, []);-- const saveSelfDeviceNameDraft = useCallback(async (rawName: string, options: SelfDeviceNameSaveOptions = {}) => {- const name = rawName.trim();- if (name.length === 0) {- setSelfDeviceNameMessage(t('settings.deviceNameEditor.emptyError'));- return;- }- if (!auth.deviceId) {- setSelfDeviceNameMessage(t('settings.deviceNameEditor.deviceInitializing'));- return;- }- if (selfDeviceNameWriteInFlightRef.current) {- if (- name === systemDeviceName.trim() &&- (selfDeviceNameCurrentWriteRef.current?.kind === 'reset' ||- selfDeviceNameQueuedWriteRef.current?.kind === 'reset')- ) {- return;- }- if (- selfDeviceNameCurrentWriteRef.current?.kind === 'rename' &&- selfDeviceNameCurrentWriteRef.current.name === name- ) {- return;- }- selfDeviceNameQueuedWriteRef.current = { kind: 'rename', name, options };- setSelfDeviceNameMessage(t('settings.deviceNameEditor.saving'));- return;- }- if (name === deviceName.trim()) {- setSelfDeviceNameMessage(null);- return;- }-- const seq = selfDeviceNameSaveSeqRef.current + 1;- selfDeviceNameSaveSeqRef.current = seq;- selfDeviceNameWriteInFlightRef.current = true;- selfDeviceNameCurrentWriteRef.current = { kind: 'rename', name, options };- setSelfDeviceNameSaving(true);- setSelfDeviceNameMessage(t('settings.deviceNameEditor.saving'));- try {- const res = await auth.apiFetch<{ deviceId: string; name: string }>(- `/api/device-link/devices/${encodeURIComponent(auth.deviceId)}`,- {- baseUrl: DEVICE_LINK_API_BASE_URL,- body: { name },- method: 'PATCH',- timeoutMs: SETTINGS_DEVICE_TIMEOUT_MS,- },- );- const draftStillCurrent = options.acceptClosedDraft === true || selfDeviceNameDraftRef.current.trim() === name;- if (selfDeviceNameSaveSeqRef.current === seq && draftStillCurrent) {- setSelfDeviceName(res.name);- setSelfDeviceNameMessage(t('settings.deviceNameEditor.saved'));- }- } catch (err) {- if (selfDeviceNameSaveSeqRef.current === seq) setSelfDeviceNameMessage(formatRemoteError(err));- } finally {- if (selfDeviceNameSaveSeqRef.current === seq) {- selfDeviceNameWriteInFlightRef.current = false;- selfDeviceNameCurrentWriteRef.current = null;- setSelfDeviceNameSaving(false);- selfDeviceNameRunQueuedWriteRef.current();- }- }- }, [auth, deviceName, systemDeviceName, t]);-- const resetSelfDeviceName = useCallback(async () => {- if (!auth.deviceId) {- setSelfDeviceNameMessage(t('settings.deviceNameEditor.deviceInitializing'));- return;- }- if (selfDeviceNameWriteInFlightRef.current) {- selfDeviceNameQueuedWriteRef.current = { kind: 'reset' };- setSelfDeviceNameMessage(t('settings.deviceNameEditor.restoringDefault'));- return;- }-- const seq = selfDeviceNameSaveSeqRef.current + 1;- selfDeviceNameSaveSeqRef.current = seq;- selfDeviceNameWriteInFlightRef.current = true;- selfDeviceNameCurrentWriteRef.current = { kind: 'reset' };- setSelfDeviceNameSaving(true);- setSelfDeviceNameMessage(t('settings.deviceNameEditor.restoringDefault'));- try {- const res = await auth.apiFetch<{ deviceId: string; name: string; manualName?: string | null }>(- `/api/device-link/devices/${encodeURIComponent(auth.deviceId)}`,- {- baseUrl: DEVICE_LINK_API_BASE_URL,- body: { name: null },- method: 'PATCH',- timeoutMs: SETTINGS_DEVICE_TIMEOUT_MS,- },- );- if (selfDeviceNameSaveSeqRef.current === seq) {- setSelfDeviceName(res.name);- updateSelfDeviceNameDraft(res.name);- setSelfDeviceNameMessage(t('settings.deviceNameEditor.restoredDefault'));- }- } catch (err) {- if (selfDeviceNameSaveSeqRef.current === seq) setSelfDeviceNameMessage(formatRemoteError(err));- } finally {- if (selfDeviceNameSaveSeqRef.current === seq) {- selfDeviceNameWriteInFlightRef.current = false;- selfDeviceNameCurrentWriteRef.current = null;- setSelfDeviceNameSaving(false);- selfDeviceNameRunQueuedWriteRef.current();- }- }- }, [auth, t, updateSelfDeviceNameDraft]);-- selfDeviceNameRunQueuedWriteRef.current = () => {- const queued = selfDeviceNameQueuedWriteRef.current;- if (!queued) return;- selfDeviceNameQueuedWriteRef.current = null;- if (queued.kind === 'reset') {- void resetSelfDeviceName();- return;- }- void saveSelfDeviceNameDraft(queued.name, queued.options);- };-- useEffect(() => {- if (!selfDeviceNameEditing) return;- const name = selfDeviceNameDraft.trim();- if (name.length === 0) {- setSelfDeviceNameMessage(t('settings.deviceNameEditor.emptyError'));- return;- }- if (name === deviceName.trim()) {- return;- }- if (selfDeviceNameSaving) return;- const timer = setTimeout(() => {- void saveSelfDeviceNameDraft(name);- }, 650);- return () => clearTimeout(timer);- }, [deviceName, saveSelfDeviceNameDraft, selfDeviceNameDraft, selfDeviceNameEditing, selfDeviceNameSaving, t]);-const openSelfDeviceNameEditor = useCallback(() => {- updateSelfDeviceNameDraft(deviceName);- setSelfDeviceNameMessage(null);- setSelfDeviceNameEditing(true);- }, [deviceName, updateSelfDeviceNameDraft]);-- const closeSelfDeviceNameEditor = useCallback(() => {- const name = selfDeviceNameDraftRef.current.trim();- if (name.length === 0) {- updateSelfDeviceNameDraft(deviceName);- setSelfDeviceNameMessage(null);- setSelfDeviceNameEditing(false);- return;- }- if (name !== deviceName.trim()) {- void saveSelfDeviceNameDraft(name, { acceptClosedDraft: true });- }- setSelfDeviceNameEditing(false);- }, [deviceName, saveSelfDeviceNameDraft, updateSelfDeviceNameDraft]);+ push('/settings/device-name');+ }, [push]);const logout = useCallback(async () => {if (loggingOut) return;@@ -634,6 +434,13 @@ export default function SettingsScreen() {}}, [auth, loggingOut, router, t]);+ // 退出登录先确认(与首页抽屉、伙伴页同一套 confirmLogout 文案):运行中任务要额外说明。+ const requestLogout = useCallback(() => {+ if (loggingOut) return;+ confirmLogout(t, hasRunningRemoteTasks(), () => void logout());+ }, [loggingOut, logout, t]);++const switchDevServerEnvironment = useCallback(async (next: DevServerEnvironment) => {if (@@ -885,70 +692,27 @@ export default function SettingsScreen() {}}, [analyticsBusy, resumeAnalyticsReporting, t]);- // REST 设备清单是「打开设置页那一刻」的快照,之后电脑上线/下线不会反映进来。- // 设置页可能开着很久,不跟 presence 的话:某台电脑上线了,这里仍认为全部离线,- // 刷新按钮直接 return,用户只能退出重进才能拉词典。- useEffect(() => {- if (!lastPresenceSnapshot) return;- setDesktopDevices((current) => patchMobileVoiceDictionaryHosts(current, lastPresenceSnapshot));- }, [lastPresenceSnapshot]);-- /**- * 向所有在线电脑各拉一次词典快照。- *- * 它们本来就该收敛到同一份内容,拉多台只是为了容错(某台是旧版本、某台正好断线)。- * 失败一律静默:电脑离线、没开「允许被控」、老版本不认识这个 channel 都是常态,- * 页面继续显示上次缓存,不弹错。- */- const refreshVoiceDictionary = useCallback(() => {- const online = desktopDevices.filter((host) => host.online);- if (online.length === 0) return;- setDictionaryRefreshing(true);- void Promise.all(- online.map((host) => refreshMobileVoiceDictionary(- host.deviceId,- () => invoke<MobileVoiceDictionarySnapshotResult>(- host.deviceId,- DEVICE_LINK_VOICE_DICTIONARY_GET_CHANNEL,- [],- ),- { force: true },- )),- ).finally(() => {- setDictionaryRefreshing(false);- // 缓存写在模块里,组件靠这个计数触发重渲染。- setDictionaryRevision((value) => value + 1);- });- }, [desktopDevices, invoke]);-- // 页面打开后再由 effect 读取缓存和刷新。设备清单本身是异步 REST 请求,不能只- // 捕获点击瞬间的 desktopDevices=[],否则清单稍后到达时历史缓存永远不会 hydrate。- const openVoiceDictionary = useCallback(() => {- setDictionaryScreenOpen(true);- }, []);-+ // 词条数来自本机缓存:进入设置时先把盘上缓存读进内存,查看页刷新后经缓存订阅同步回来。useEffect(() => {- if (!dictionaryScreenOpen || desktopDevices.length === 0) return;+ if (desktopDevices.length === 0) return;let cancelled = false;- // 进页面先把盘上缓存读进内存(离线也有内容可看),再拉一次最新的。这个 effect- // 同时依赖 desktopDevices,因此设备清单在页面打开后才到达时也会走同一条路径。void Promise.all(desktopDevices.map((host) => hydrateMobileVoiceDictionary(host.deviceId))).then(() => {if (!cancelled) setDictionaryRevision((value) => value + 1);}).catch(() => undefined);- refreshVoiceDictionary();return () => {cancelled = true;};- }, [desktopDevices, dictionaryScreenOpen, refreshVoiceDictionary]);+ }, [desktopDevices]);- useEffect(() => {- if (!dictionaryScreenOpen) return;- return subscribeMobileVoiceDictionaryCache(() => {- setDictionaryRevision((value) => value + 1);- });- }, [dictionaryScreenOpen]);+ useEffect(() => subscribeMobileVoiceDictionaryCache(() => {+ setDictionaryRevision((value) => value + 1);+ }), []);++ const openVoiceDictionary = useCallback(() => {+ push('/settings/voice-dictionary');+ }, [push]);// dictionaryRevision 只作为依赖存在:缓存是模块级的,刷新完成后靠它触发重算。const dictionaryEntries = useMemo(@@ -959,65 +723,37 @@ export default function SettingsScreen() {[desktopDevices, dictionaryRevision],);- const dictionaryStatus = desktopDevices.length === 0- ? 'no-desktops'- : desktopDevices.some((host) => host.online)- ? 'ready'- : 'all-offline';-- const avatarLabel = (overview.header.name.trim()[0] ?? '?').toUpperCase();const updateBusy = updatePhase === 'checking' || updatePhase === 'downloading';- const updateButtonLabel = updatePhase === 'checking' ? t('settings.version.checking')- : updatePhase === 'downloading' ? t('settings.version.updating')- : t(- IS_TESTFLIGHT_BUILD- ? 'settings.version.testFlightCheckAction'- : 'settings.version.checkAction',- );-- if (dictionaryScreenOpen) {- return (- <VoiceDictionaryScreen- entries={dictionaryEntries}- onBack={() => setDictionaryScreenOpen(false)}- onRefresh={refreshVoiceDictionary}- refreshing={dictionaryRefreshing}- status={dictionaryStatus}- />- );- }-- if (selfDeviceNameEditing) {- return (- <RenameSelfDeviceScreen- draft={selfDeviceNameDraft}- message={selfDeviceNameMessage}- onChangeDraft={updateSelfDeviceNameDraft}- onDone={closeSelfDeviceNameEditor}- onResetDefault={resetSelfDeviceName}- />- );- }+ const updateActionLabel = t(+ IS_TESTFLIGHT_BUILD+ ? 'settings.version.testFlightCheckAction'+ : 'settings.version.checkAction',+ );+ // 面向用户的更新方式说明;OTA 版本号、运行来源等技术细节在「调试 / 开发者」里。+ const updateMethodHint = REVIEW_MODE+ ? null+ : IS_TESTFLIGHT_BUILD+ ? (updatesEnabled ? null : t('settings.version.testFlightContentUpdateUnavailable'))+ : updatesEnabled+ ? t('settings.version.updateMethodInApp')+ : bundleCheckEnabled+ ? t('settings.version.updateMethodPackage')+ : t('settings.version.updateMethodUnavailable');return (- <SafeAreaView edges={simpleScreenSafeAreaEdges()} style={styles.safeArea} testID="settings.screen">+ <SafeAreaView edges={simpleScrollScreenSafeAreaEdges()} style={styles.safeArea} testID="settings.screen"><SimpleStackHeader+ scrollEdgebackTestID="settings.backButton"onBack={() => goBackGuarded(router)}title={t('settings.title')}titleTestID="settings.title"/>- <ScrollView contentContainerStyle={styles.content} testID="settings.scroll">+ <ScrollView {...simpleScrollInsetProps} contentContainerStyle={styles.content} testID="settings.scroll">{/* 账号头部:身份 + 连接状态一次性呈现,下面分组不再重复 */}<View style={styles.headerCard} testID="settings.accountHeader">- <View style={styles.avatar}>- {auth.user?.avatar ? (- <Image source={{ uri: auth.user.avatar }} style={styles.avatarImage} />- ) : (- <Text style={styles.avatarText}>{avatarLabel}</Text>- )}- </View>+ <MobileUserAvatar imageUrl={auth.user?.avatar} name={overview.header.name} size="large" /><View style={styles.headerTexts}><Text style={styles.headerName} numberOfLines={1}>{overview.header.name}</Text>{overview.header.email ? (@@ -1037,38 +773,31 @@ export default function SettingsScreen() {{[<View key="version" style={styles.versionRow} testID="settings.version"><View style={styles.versionTexts}>- <Text style={styles.rowLabel}>{t('settings.version.currentLabel')}</Text><View style={styles.versionValueRow}>- <Text style={styles.versionValue} numberOfLines={1}>{t('settings.version.bundleVersion', { version: appVersion })}</Text>+ <Text style={styles.versionLabel} testID="settings.appVersion">{t('settings.version.appVersion', { version: appVersion })}</Text>{showBetaBadge ? (<View style={styles.betaChannelBadge} testID="settings.betaChannelBadge"><Text style={styles.betaChannelBadgeText}>{t('settings.betaChannel.badge')}</Text></View>) : null}</View>- <Text style={styles.rowDetail} numberOfLines={1} testID="settings.otaVersion">{t('settings.version.otaVersion', { version: otaVersion })}</Text>{/* 二级版本号:自建线打包所配对的桌面产品线版本(0.0.x),不是在线电脑的实时版本;仅自建线且已注入时显示 */}{IS_OTA_SELFHOST && DESKTOP_PACKAGE_VERSION ? (- <Text style={styles.rowDetail} numberOfLines={1} testID="settings.desktopVersion">{t('settings.version.pairedDesktopVersion', { version: DESKTOP_PACKAGE_VERSION })}</Text>+ <Text style={styles.versionDetail} testID="settings.desktopVersion">{t('settings.version.pairedDesktopVersion', { version: DESKTOP_PACKAGE_VERSION })}</Text>) : null}{IS_TESTFLIGHT_BUILD ? (- <Text style={styles.rowDetail} numberOfLines={2} testID="settings.testFlightUpdateHint">+ <Text style={styles.versionDetail} testID="settings.testFlightUpdateHint">{t('settings.version.testFlightUpdateManaged')}</Text>) : null}{updateMessage ? (- <Text style={styles.rowDetail} numberOfLines={2} testID="settings.updateMessage">{updateMessage}</Text>- ) : !REVIEW_MODE && !updatesEnabled ? (- <Text style={styles.rowDetail} numberOfLines={2}>- {t(- IS_TESTFLIGHT_BUILD- ? 'settings.version.testFlightContentUpdateUnavailable'- : 'settings.version.devNoOta',- )}- </Text>+ <Text style={styles.versionDetail} testID="settings.updateMessage">{updateMessage}</Text>+ ) : updateMethodHint ? (+ <Text style={styles.versionDetail} testID="settings.updateMethod">{updateMethodHint}</Text>) : null}</View>- {/* 审核模式(清单 review 命中当前二进制版本):隐藏检查更新入口,版本号照常展示 */}+ {/* 审核模式(清单 review 命中当前二进制版本):隐藏检查更新入口,版本号照常展示。+ 次级按钮(描边 + 正文色),避免灰底读成禁用;加载时只转圈。 */}{!REVIEW_MODE ? (<MainWindowActionButtonaction={{@@ -1078,19 +807,14 @@ export default function SettingsScreen() {? 'settings.version.testFlightCheckingAccessibility': 'settings.version.checkingAccessibility',)- : t(- IS_TESTFLIGHT_BUILD- ? 'settings.version.testFlightCheckAction'- : 'settings.version.checkAction',- ),+ : updateActionLabel,busy: updateBusy,disabled: !updateCheckEnabled,- label: updateButtonLabel,+ label: updateActionLabel,onPress: () => void checkForUpdate(),testID: 'settings.checkUpdateButton',- tone: 'primary',+ tone: 'secondary',}}- density="compact"style={styles.versionButton}/>) : null}@@ -1101,27 +825,18 @@ export default function SettingsScreen() {{/* 通知:任务完成推送(仅 iOS;Android 待 FCM/厂商通道) */}{isPushSupported() ? (<SettingsGroup title={t('settings.notifications.sectionTitle')}>- {[- <View key="push-toggle" style={styles.switchRow} testID="settings.pushToggleRow">- <View style={styles.switchTexts}>- <Text style={styles.rowLabel}>{t('settings.notifications.taskDone')}</Text>- <Text style={styles.hint}>- {t('settings.notifications.taskDoneHint')}- </Text>- {pushMessage ? (- <Text style={styles.hint} testID="settings.pushMessage">{pushMessage}</Text>- ) : null}- </View>- <NativeSwitch- accessibilityLabel={t('settings.notifications.taskDone')}- disabled={pushBusy}- onValueChange={() => void togglePushNotifications()}- seedColor={colors.inputCaret}- testID="settings.pushToggle"- value={pushEnabled}- />- </View>,- ]}+ <SettingsSwitchRow+ accessibilityLabel={t('settings.notifications.taskDone')}+ disabled={pushBusy}+ hint={t('settings.notifications.taskDoneHint')}+ key="push-toggle"+ label={t('settings.notifications.taskDone')}+ messages={[pushMessage ? { text: pushMessage, testID: 'settings.pushMessage' } : null]}+ onValueChange={() => void togglePushNotifications()}+ switchTestID="settings.pushToggle"+ testID="settings.pushToggleRow"+ value={pushEnabled}+ /></SettingsGroup>) : null}@@ -1130,16 +845,14 @@ export default function SettingsScreen() {footer={t('settings.voiceDictionary.hint')}title={t('settings.voiceDictionary.sectionTitle')}>- {[- <ActionInfoRow- accessibilityLabel={t('settings.voiceDictionary.openAccessibility')}- key="voice-dictionary"- label={t('settings.voiceDictionary.label')}- onPress={openVoiceDictionary}- testID="settings.voiceDictionary.row"- value={t('settings.voiceDictionary.entryCount', { count: dictionaryEntries.length })}- />,- ]}+ <ActionInfoRow+ accessibilityLabel={t('settings.voiceDictionary.openAccessibility')}+ key="voice-dictionary"+ label={t('settings.voiceDictionary.label')}+ onPress={openVoiceDictionary}+ testID="settings.voiceDictionary.row"+ value={t('settings.voiceDictionary.entryCount', { count: dictionaryEntries.length })}+ /></SettingsGroup>{/* 显示模式:默认跟随系统,手动选择浅色 / 深色即持久化 override(恢复跟随系统 = 清除 override) */}@@ -1192,7 +905,7 @@ export default function SettingsScreen() {row.id === 'about.deviceName' ? (<ActionInfoRowaccessibilityLabel={t('settings.about.editAccessibility', { label: row.label })}- detail={selfDeviceNameMessage ?? row.detail}+ detail={row.detail}key={row.id}label={row.label}onPress={openSelfDeviceNameEditor}@@ -1206,59 +919,53 @@ export default function SettingsScreen() {</SettingsGroup>) : null}- {/* 调试 / 开发者:默认折叠 */}+ {/* 调试 / 开发者:默认折叠;折叠开关是卡片里的第一行,展开的行接在同一张卡片里。 */}{debugSection ? (- <SettingsGroup- onToggle={toggleDebug}- title={debugSection.title}- titleAccessory={groupChevron(debugExpanded, colors)}- >+ <SettingsGroup testID="settings.debugGroup">+ <SettingsDisclosureRow+ expanded={debugExpanded}+ key="debug-toggle"+ label={debugSection.title}+ onPress={toggleDebug}+ testID="settings.debugToggle"+ />{debugExpanded? [- <View+ <SettingsSwitchRow+ accessibilityLabel={t('settings.localLogs.record')}+ accessory={(+ <NativePullDownMenu+ actions={[+ { id: 'clear', title: t('settings.localLogs.clear'), destructive: true, disabled: !localLogsReady || localLogsBusy },+ ]}+ onAction={handleLocalLogOption}+ >+ <Pressable+ accessibilityRole="button"+ accessibilityLabel={t('settings.localLogs.options')}+ disabled={!localLogsReady || localLogsBusy}+ style={({ pressed }) => [styles.localLogOptions, pressed && styles.pressed]}+ onPress={usesNativePullDownMenu() ? undefined : () => Alert.alert(t('settings.localLogs.options'), undefined, [+ { text: t('settings.localLogs.clear'), style: 'destructive', onPress: () => handleLocalLogOption('clear') },+ { text: t('settings.localLogs.cancel'), style: 'cancel' },+ ])}+ >+ <Ellipsis color={colors.textTertiary} size={iconSize.lg} strokeWidth={iconStroke.regular} />+ </Pressable>+ </NativePullDownMenu>+ )}+ disabled={!localLogsReady || localLogsBusy}+ hint={t('settings.localLogs.hint')}key="local-logs-toggle"- style={styles.switchRow}+ label={t('settings.localLogs.title')}+ onValueChange={(value) =>+ void runLocalLogAction(() =>+ setDiagnosticsEnabled(value),+ )+ }testID="settings.localLogs"- >- <View style={styles.switchTexts}>- <Text style={styles.rowLabel}>- {t('settings.localLogs.title')}- </Text>- <Text style={styles.hint}>- {t('settings.localLogs.hint')}- </Text>- </View>- <NativeSwitch- accessibilityLabel={t('settings.localLogs.record')}- disabled={!localLogsReady || localLogsBusy}- value={localLogsEnabled}- seedColor={colors.inputCaret}- onValueChange={(value) =>- void runLocalLogAction(() =>- setDiagnosticsEnabled(value),- )- }- />- <NativePullDownMenu- actions={[- { id: 'clear', title: t('settings.localLogs.clear'), destructive: true, disabled: !localLogsReady || localLogsBusy },- ]}- onAction={handleLocalLogOption}- >- <Pressable- accessibilityRole="button"- accessibilityLabel={t('settings.localLogs.options')}- disabled={!localLogsReady || localLogsBusy}- style={styles.localLogOptions}- onPress={usesNativePullDownMenu() ? undefined : () => Alert.alert(t('settings.localLogs.options'), undefined, [- { text: t('settings.localLogs.clear'), style: 'destructive', onPress: () => handleLocalLogOption('clear') },- { text: t('settings.localLogs.cancel'), style: 'cancel' },- ])}- >- <Ellipsis color={colors.textTertiary} size={iconSize.lg} strokeWidth={iconStroke.regular} />- </Pressable>- </NativePullDownMenu>- </View>,+ value={localLogsEnabled}+ />,<ActionInfoRowkey="local-logs-export"accessibilityLabel={t('settings.localLogs.export')}@@ -1317,25 +1024,29 @@ export default function SettingsScreen() {<InfoRow key={row.id} detail={row.detail} label={row.label} testID={`settings.row.${row.id}`} value={row.value} />))),- <View key="beta-channel-toggle" style={styles.switchRow} testID="settings.betaChannelToggleRow">- <View style={styles.switchTexts}>- <Text style={styles.rowLabel}>{t('settings.betaChannel.title')}</Text>- <Text style={styles.hint}>{t('settings.betaChannel.description')}</Text>- </View>- <NativeSwitch- accessibilityLabel={t('settings.betaChannel.title')}- disabled={betaBusy || !betaReady}- onValueChange={() => void toggleBeta()}- seedColor={colors.inputCaret}- testID="settings.betaChannelToggle"- value={betaEnabled}- />- </View>,+ <SettingsSwitchRow+ accessibilityLabel={t('settings.betaChannel.title')}+ disabled={betaBusy || !betaReady}+ hint={t('settings.betaChannel.description')}+ key="beta-channel-toggle"+ label={t('settings.betaChannel.title')}+ onValueChange={() => void toggleBeta()}+ switchTestID="settings.betaChannelToggle"+ testID="settings.betaChannelToggleRow"+ value={betaEnabled}+ />,+ // 技术版本细节:当前运行的热更 bundle(从版本卡片移到这里)。+ <InfoRow+ key="ota-version"+ label={t('settings.updateInfo.otaVersion')}+ testID="settings.otaVersion"+ value={otaVersion}+ />,...updateInfoRows.map((row) => (<InfoRow key={row.id} label={row.label} testID={`settings.updateInfo.${row.id}`} value={row.value} />)),]- : []}+ : null}</SettingsGroup>) : null}@@ -1343,23 +1054,18 @@ export default function SettingsScreen() {使用统计开关与它们同组(合规要求关闭途径可被找到);App 备案号仅国内版显示。 */}<SettingsGroup title={t('settings.legal.sectionTitle')}>- <View key="analytics-toggle" style={styles.switchRow} testID="settings.analyticsToggleRow">- <View style={styles.switchTexts}>- <Text style={styles.rowLabel}>{t('settings.legal.analytics')}</Text>- <Text style={styles.hint}>{t('settings.legal.analyticsHint')}</Text>- {analyticsMessage ? (- <Text style={styles.hint} testID="settings.analyticsMessage">{analyticsMessage}</Text>- ) : null}- </View>- <NativeSwitch- accessibilityLabel={t('settings.legal.analytics')}- disabled={analyticsBusy || !analyticsReady}- onValueChange={() => void toggleAnalytics()}- seedColor={colors.inputCaret}- testID="settings.analyticsToggle"- value={analyticsEnabled}- />- </View>+ <SettingsSwitchRow+ accessibilityLabel={t('settings.legal.analytics')}+ disabled={analyticsBusy || !analyticsReady}+ hint={t('settings.legal.analyticsHint')}+ key="analytics-toggle"+ label={t('settings.legal.analytics')}+ messages={[analyticsMessage ? { text: analyticsMessage, testID: 'settings.analyticsMessage' } : null]}+ onValueChange={() => void toggleAnalytics()}+ switchTestID="settings.analyticsToggle"+ testID="settings.analyticsToggleRow"+ value={analyticsEnabled}+ />{analyticsCustomized ? (<ActionInfoRowaccessibilityLabel={t('settings.legal.analyticsReset')}@@ -1398,7 +1104,7 @@ export default function SettingsScreen() {) : null}</SettingsGroup>- {/* 账号操作:退出保持明确;注销账号仅保留低调的次要文字入口。 */}+ {/* 账号操作:退出保持明确(先确认);注销账号仅保留低调的次要文字入口。 */}<View style={styles.dangerArea} testID="settings.accountActions"><Text style={styles.dangerHint}>{t('settings.account.logoutHint')}@@ -1408,9 +1114,8 @@ export default function SettingsScreen() {{accessibilityLabel: loggingOut ? t('settings.account.loggingOutAccessibility') : t('settings.account.logout'),busy: loggingOut,- disabled: loggingOut,- label: loggingOut ? t('settings.account.loggingOut') : t('settings.account.logout'),- onPress: () => void logout(),+ label: t('settings.account.logout'),+ onPress: requestLogout,testID: 'settings.logoutButton',tone: 'danger',},@@ -1485,331 +1190,6 @@ export default function SettingsScreen() {);}-/** 可折叠分组标题右侧的展开/收起指示箭头。 */-function groupChevron(expanded: boolean, colors: ThemeColors): ReactNode {- return expanded- ? <ChevronDown color={colors.textTertiary} size={iconSize.lg} strokeWidth={iconStroke.regular} />- : <ChevronRight color={colors.textTertiary} size={iconSize.lg} strokeWidth={iconStroke.regular} />;-}--/**- * iOS 风格分组:组标题在外侧 gutter,组内一块统一卡片,行间用 inset 分隔线。- * 标题可点(onToggle)时承担折叠开关。rows 为空则不渲染卡片(折叠态)。- * footer 为卡片下方 gutter 里的弱说明文字(iOS 分组 footer 惯例)。- */-function SettingsGroup({- children,- footer,- onToggle,- title,- titleAccessory,-}: {- children: ReactNode;- footer?: string;- onToggle?: () => void;- title: string;- titleAccessory?: ReactNode;-}) {- const styles = useThemedStyles(makeStyles);- // Children.toArray 会丢弃 null/false 并给每个 child 赋稳定 key(沿用元素自身 key),- // 比 key={index} 更稳:后续插入/重排调试行时不会让无关行 remount。- const rows = Children.toArray(children);- return (- <View style={styles.group}>- {onToggle ? (- <Pressable- accessibilityRole="button"- onPress={onToggle}- style={({ pressed }) => [styles.groupTitleRow, pressed && styles.pressed]}- >- <Text style={styles.groupTitle}>{title}</Text>- {titleAccessory}- </Pressable>- ) : (- <View style={styles.groupTitleRow}>- <Text style={styles.groupTitle}>{title}</Text>- {titleAccessory}- </View>- )}- {rows.length > 0 ? (- <View style={styles.card}>- {rows.map((row, index) => (- <Fragment key={isValidElement(row) && row.key != null ? row.key : index}>- {index > 0 ? <View style={styles.divider} /> : null}- {row}- </Fragment>- ))}- </View>- ) : null}- {footer && rows.length > 0 ? (- <Text style={styles.groupFooter}>{footer}</Text>- ) : null}- </View>- );-}--/** 显示语言下拉入口:标签左、当前值右;选项在底部 sheet 中单选。 */-/** 设置项的单选入口行:iOS 由外层原生下拉菜单接管点击,其它平台打开选择面板。 */-function ChoicePickerRow({- expanded,- label,- onPress,- testID,- value,-}: {- expanded: boolean;- label: string;- onPress(): void;- testID?: string;- value: string;-}) {- const styles = useThemedStyles(makeStyles);- const { colors } = useTheme();- return (- <Pressable- accessibilityLabel={`${label}: ${value}`}- accessibilityRole="button"- accessibilityState={{ expanded }}- onPress={onPress}- style={({ pressed }) => [styles.row, pressed && styles.pressed]}- testID={testID}- >- <View style={styles.rowLine}>- <Text style={styles.rowLabel}>{label}</Text>- <Text style={styles.rowValue} numberOfLines={1}>{value}</Text>- <ChevronDown color={colors.textTertiary} size={iconSize.lg} strokeWidth={iconStroke.regular} />- </View>- </Pressable>- );-}--/** 单行信息:标签左、值右;可选 detail 另起一行(较弱)。 */-function InfoRow({- detail,- label,- testID,- value,-}: {- detail?: string;- label: string;- testID?: string;- value: string;-}) {- const styles = useThemedStyles(makeStyles);- return (- <View style={styles.row} testID={testID}>- <View style={styles.rowLine}>- <Text style={styles.rowLabel}>{label}</Text>- <Text style={styles.rowValue} numberOfLines={1}>{value}</Text>- </View>- {detail ? <Text style={styles.rowDetail} numberOfLines={2}>{detail}</Text> : null}- </View>- );-}--/** 可点击信息行:用于轻量编辑或打开外部信息。 */-function ActionInfoRow({- accessibilityLabel,- accessibilityRole = 'button',- detail,- disabled = false,- label,- onPress,- testID,- value,-}: {- accessibilityLabel: string;- accessibilityRole?: 'button' | 'link';- detail?: string;- disabled?: boolean;- label: string;- onPress(): void;- testID?: string;- value: string;-}) {- const styles = useThemedStyles(makeStyles);- const { colors } = useTheme();- return (- <Pressable- accessibilityLabel={accessibilityLabel}- accessibilityRole={accessibilityRole}- accessibilityState={{ disabled }}- disabled={disabled}- onPress={onPress}- style={({ pressed }) => [styles.row, (pressed || disabled) && styles.pressed]}- testID={testID}- >- <View style={styles.rowLine}>- <Text style={styles.rowLabel}>{label}</Text>- <Text style={styles.rowValue} numberOfLines={1}>{value}</Text>- <ChevronRight color={colors.textTertiary} size={iconSize.lg} strokeWidth={iconStroke.regular} />- </View>- {detail ? <Text style={styles.rowDetail} numberOfLines={2}>{detail}</Text> : null}- </Pressable>- );-}--/**- * 语音词典查看页(只读)。- *- * 词典对用户是**一份**:同账号下所有开启同步的电脑收敛到同一份内容,「这条词来自- * 哪台电脑」是实现细节,不该出现在界面上 —— 同一台机器换名或重装就会多出一个分组,- * 列表立刻没法看。所以这里把所有电脑的快照合并成单一列表。- *- * 正本在电脑上,手机只拉快照用于润色,因此没有任何编辑入口:增删改一律回电脑做,- * 避免手机维护一份会分叉的副本。- */-function VoiceDictionaryScreen({- entries,- onBack,- onRefresh,- refreshing,- status,-}: {- entries: readonly MobileVoiceDictionaryEntryView[];- onBack(): void;- onRefresh(): void;- refreshing: boolean;- status: 'ready' | 'no-desktops' | 'all-offline';-}) {- const styles = useThemedStyles(makeStyles);- const { t } = useTranslation();-- const footer = status === 'no-desktops'- ? t('settings.voiceDictionary.noDesktops')- : status === 'all-offline'- ? t('settings.voiceDictionary.offlineHint')- : t('settings.voiceDictionary.readOnlyHint');-- return (- <SafeAreaView edges={simpleScreenSafeAreaEdges()} style={styles.safeArea} testID="settings.voiceDictionary.screen">- <SimpleStackHeader- backTestID="settings.voiceDictionary.backButton"- onBack={onBack}- title={t('settings.voiceDictionary.screenTitle')}- />- {/*- 词典上限是 1000 条,用 ScrollView 会把每一行都实例化出来 —— 低端机上首屏卡顿- 且常驻内存。这里换成虚拟化列表,只挂载可见行;卡片视觉靠 header/item/footer- 三段样式拼出来(FlatList 没法在外面包一层带圆角的 View 还保持自身滚动)。- */}- <FlatList- ListFooterComponent={- <>- <View style={styles.listCardBottom} />- <Text style={styles.groupFooter}>{footer}</Text>- </>- }- ListHeaderComponent={- <>- <View style={styles.groupTitleRow}>- <Text style={styles.groupTitle}>{t('settings.voiceDictionary.sectionTitle')}</Text>- </View>- <View style={styles.listCardTop}>- <Pressable- accessibilityLabel={t('settings.voiceDictionary.refreshAccessibility')}- accessibilityRole="button"- onPress={onRefresh}- style={({ pressed }) => [styles.row, pressed && styles.pressed]}- testID="settings.voiceDictionary.refresh"- >- <View style={styles.rowLine}>- <Text style={styles.rowLabel}>- {t('settings.voiceDictionary.entryCount', { count: entries.length })}- </Text>- <Text style={styles.rowValue} numberOfLines={1}>- {refreshing- ? t('settings.voiceDictionary.refreshing')- : t('settings.voiceDictionary.refresh')}- </Text>- </View>- </Pressable>- </View>- </>- }- contentContainerStyle={styles.listContent}- data={entries}- keyExtractor={(entry) => entry.key}- renderItem={({ item }) => (- <View style={styles.listCardMiddle}>- <View style={styles.divider} />- <View style={styles.row} testID={`settings.voiceDictionary.entry.${item.key}`}>- <View style={styles.rowLine}>- <Text style={styles.rowLabel} numberOfLines={2}>{item.text}</Text>- </View>- {item.aliases.length > 0 ? (- <Text style={styles.rowDetail} numberOfLines={2}>- {t('settings.voiceDictionary.aliases', {- aliases: item.aliases.join(t('settings.voiceDictionary.aliasSeparator')),- })}- </Text>- ) : null}- </View>- </View>- )}- testID="settings.voiceDictionary.scroll"- />- </SafeAreaView>- );-}--function RenameSelfDeviceScreen({- draft,- message,- onChangeDraft,- onDone,- onResetDefault,-}: {- draft: string;- message: string | null;- onChangeDraft(value: string): void;- onDone(): void;- onResetDefault(): void;-}) {- const styles = useThemedStyles(makeStyles);- const { colors } = useTheme();- const { t } = useTranslation();- return (- <SafeAreaView edges={simpleScreenSafeAreaEdges()} style={styles.safeArea} testID="settings.renameSelfDevice.screen">- <SimpleStackHeader- backTestID="settings.renameSelfDevice.backButton"- onBack={onDone}- title={t('settings.deviceNameEditor.screenTitle')}- />- <View style={styles.nameEditorContent}>- <View style={styles.nameEditorInputRow}>- <TextInput- autoFocus- maxLength={64}- onChangeText={onChangeDraft}- onSubmitEditing={onDone}- placeholder={t('settings.deviceNameEditor.placeholder')}- placeholderTextColor={colors.textPlaceholder}- returnKeyType="done"- selectTextOnFocus- style={styles.nameEditorInput}- testID="settings.renameSelfDevice.input"- value={draft}- />- {draft.length > 0 ? (- <Pressable- accessibilityLabel={t('settings.deviceNameEditor.resetAccessibility')}- accessibilityRole="button"- hitSlop={8}- onPress={onResetDefault}- style={({ pressed }) => [styles.nameEditorClearButton, pressed && styles.pressed]}- testID="settings.renameSelfDevice.clear"- >- <X color={colors.surfaceElevated} size={iconSize.sm} strokeWidth={iconStroke.bold} />- </Pressable>- ) : null}- </View>- {message ? <Text style={styles.nameEditorMessage} numberOfLines={2}>{message}</Text> : null}- </View>- </SafeAreaView>- );-}-/** 可复制行(长 ID / URL):标签 + 值堆叠在左,复制按钮在右。 */function CopyRow({copied,@@ -1862,94 +1242,12 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({paddingHorizontal: spacing.xs,paddingVertical: spacing.sm,},- avatar: {- alignItems: 'center',- backgroundColor: colors.surfaceElevated,- borderColor: colors.border,- borderRadius: radius.pill,- borderWidth: StyleSheet.hairlineWidth,- height: 56,- justifyContent: 'center',- overflow: 'hidden',- width: 56,- },- avatarImage: { height: 56, width: 56 },- avatarText: { color: colors.textPrimary, fontSize: typeScale.title, lineHeight: lineHeight.title, fontWeight: fontWeight.semibold },- headerTexts: { flex: 1, gap: 3, minWidth: 0 },+ headerTexts: { flex: 1, gap: spacing.xs, minWidth: 0 },headerName: { color: colors.textPrimary, fontSize: typeScale.title, lineHeight: lineHeight.title, fontWeight: fontWeight.semibold },headerEmail: { color: colors.textSecondary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption },- headerStatusRow: { alignItems: 'center', flexDirection: 'row', gap: spacing.xs, marginTop: 1 },+ headerStatusRow: { alignItems: 'center', flexDirection: 'row', gap: spacing.xs },headerStatusText: { color: colors.textSecondary, flex: 1, fontSize: typeScale.footnote, lineHeight: lineHeight.caption, minWidth: 0 },- // —— 分组 ——- group: { gap: spacing.sm },- groupTitleRow: {- alignItems: 'center',- flexDirection: 'row',- gap: spacing.xs,- minHeight: 24,- paddingHorizontal: spacing.md,- },- groupTitle: { color: colors.textTertiary, flex: 1, fontSize: typeScale.footnote, lineHeight: lineHeight.caption, fontWeight: fontWeight.semibold },- groupFooter: {- color: colors.textSecondary,- fontSize: typeScale.footnote,- lineHeight: lineHeight.caption,- paddingHorizontal: spacing.md,- },- card: {- backgroundColor: colors.surfaceElevated,- borderColor: colors.border,- borderRadius: radius.container,- borderWidth: StyleSheet.hairlineWidth,- overflow: 'hidden',- },- divider: { backgroundColor: colors.border, height: StyleSheet.hairlineWidth, marginLeft: spacing.lg },- // —— 虚拟化列表拼出的卡片三段 ——- listContent: { paddingBottom: spacing.xxl, paddingHorizontal: spacing.lg, paddingTop: spacing.lg },- listCardTop: {- backgroundColor: colors.surfaceElevated,- borderColor: colors.border,- borderTopLeftRadius: radius.container,- borderTopRightRadius: radius.container,- borderWidth: StyleSheet.hairlineWidth,- marginTop: spacing.sm,- overflow: 'hidden',- },- listCardMiddle: {- backgroundColor: colors.surfaceElevated,- borderColor: colors.border,- borderLeftWidth: StyleSheet.hairlineWidth,- borderRightWidth: StyleSheet.hairlineWidth,- },- listCardBottom: {- backgroundColor: colors.surfaceElevated,- borderBottomLeftRadius: radius.container,- borderBottomRightRadius: radius.container,- borderColor: colors.border,- borderBottomWidth: StyleSheet.hairlineWidth,- borderLeftWidth: StyleSheet.hairlineWidth,- borderRightWidth: StyleSheet.hairlineWidth,- height: radius.container,- marginBottom: spacing.sm,- },- // —— 行 ——- row: { gap: 3, justifyContent: 'center', minHeight: 52, paddingHorizontal: spacing.lg, paddingVertical: spacing.md },- rowLine: { alignItems: 'center', flexDirection: 'row', gap: spacing.md },- // 设置行:标签是主信息(正文色 500),右侧取值退为二级色 400;说明文字用 13pt(2026-09-27 用户反馈偏淡)。- rowLabel: { color: colors.textPrimary, flexShrink: 0, fontSize: typeScale.body, fontWeight: fontWeight.medium, lineHeight: lineHeight.body },- rowValue: { color: colors.textSecondary, flex: 1, fontSize: typeScale.body, lineHeight: lineHeight.body, textAlign: 'right' },- rowDetail: { color: colors.textTertiary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption },localLogOptions: { minWidth: 44, minHeight: 44, alignItems: 'center', justifyContent: 'center' },- switchRow: {- alignItems: 'center',- flexDirection: 'row',- gap: spacing.md,- minHeight: 52,- paddingHorizontal: spacing.lg,- paddingVertical: spacing.md,- },- switchTexts: { flex: 1, gap: spacing.xs },- hint: { color: colors.textSecondary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption },// —— 版本行 ——versionRow: {alignItems: 'center',@@ -1959,15 +1257,15 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({paddingHorizontal: spacing.lg,paddingVertical: spacing.md,},- versionTexts: { flex: 1, gap: 2, minWidth: 0 },- versionValueRow: { alignItems: 'center', flexDirection: 'row', gap: spacing.sm },- versionValue: { color: colors.textSecondary, flexShrink: 1, fontSize: typeScale.body, fontWeight: fontWeight.regular, lineHeight: lineHeight.body },+ versionTexts: { flex: 1, gap: spacing.xs, minWidth: 0 },+ versionValueRow: { alignItems: 'center', flexDirection: 'row', flexWrap: 'wrap', gap: spacing.sm },+ versionLabel: { color: colors.textPrimary, flexShrink: 1, fontSize: typeScale.body, fontWeight: fontWeight.medium, lineHeight: lineHeight.body },+ versionDetail: { color: colors.textSecondary, fontSize: typeScale.footnote, fontWeight: fontWeight.regular, lineHeight: lineHeight.caption },betaChannelBadge: {backgroundColor: colors.betaChannelBadgeBackground,borderRadius: radius.pill,flexShrink: 0,paddingHorizontal: spacing.sm,- paddingVertical: 1,},betaChannelBadgeText: {color: colors.betaChannelBadgeForeground,@@ -1975,7 +1273,7 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({lineHeight: lineHeight.micro,fontWeight: fontWeight.semibold,},- versionButton: { flexShrink: 0, minWidth: 84 },+ versionButton: { flexShrink: 0 },// —— 可复制行 ——copyRow: {alignItems: 'center',@@ -1985,7 +1283,7 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({paddingHorizontal: spacing.lg,paddingVertical: spacing.md,},- copyText: { flex: 1, gap: 2, minWidth: 0 },+ copyText: { flex: 1, gap: spacing.xs, minWidth: 0 },copyLabel: { color: colors.textSecondary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption, fontWeight: fontWeight.regular },copyValue: { color: colors.textPrimary, fontSize: typeScale.bodySmall, lineHeight: lineHeight.bodySmall },copyButton: { flexShrink: 0, minWidth: 60 },@@ -2004,41 +1302,5 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({fontSize: typeScale.footnote,lineHeight: lineHeight.caption,},- nameEditorContent: {- gap: spacing.sm,- paddingHorizontal: spacing.lg,- paddingTop: spacing.xl,- },- nameEditorInputRow: {- alignItems: 'center',- backgroundColor: colors.surfaceElevated,- borderRadius: radius.pill,- flexDirection: 'row',- minHeight: 56,- paddingLeft: spacing.lg,- paddingRight: spacing.md,- },- nameEditorInput: {- color: colors.textPrimary,- flex: 1,- fontSize: typeScale.body,- lineHeight: lineHeight.body,- minWidth: 0,- paddingVertical: spacing.md,- },- nameEditorClearButton: {- alignItems: 'center',- backgroundColor: colors.textTertiary,- borderRadius: radius.pill,- height: 22,- justifyContent: 'center',- width: 22,- },- nameEditorMessage: {- color: colors.textTertiary,- fontSize: typeScale.footnote,- lineHeight: lineHeight.caption,- paddingHorizontal: spacing.md,- },- pressed: { opacity: 0.6 },+ pressed: mobileInteractionStyles.pressed,});diff --git a/apps/mobile/app/settings/device-name.tsx b/apps/mobile/app/settings/device-name.tsxnew file mode 100644index 0000000000..51a4e1429b--- /dev/null+++ b/apps/mobile/app/settings/device-name.tsx@@ -0,0 +1,254 @@+import Constants from 'expo-constants';+import { useNavigation, useRouter } from 'expo-router';+import { usePreventRemove } from 'expo-router/react-navigation';+import { useCallback, useEffect, useRef, useState } from 'react';+import { Alert, Platform, Pressable, StyleSheet, View } from 'react-native';+import { SafeAreaView } from 'react-native-safe-area-context';+import { X } from 'lucide-react-native';+import { useTranslation } from 'react-i18next';+import { useAuth } from '@/auth/AuthContext';+import { Text, TextInput } from '@/components/AppText';+import { MainWindowActionGroup } from '@/components/MobilePrimitives';+import { mobileInteractionStyles } from '@/components/mobileInteractionStyles';+import { DEVICE_LINK_API_BASE_URL } from '@/config/env';+import { buildMobileDeviceName } from '@/device-link/mobileDeviceIdentity';+import { formatRemoteError } from '@/device-link/remoteStatus';+import { SimpleStackHeader, simpleScreenSafeAreaEdges } from '@/platform/chrome';+import {+ publishSelfDeviceName,+ SETTINGS_DEVICE_TIMEOUT_MS,+ useSettingsDeviceDirectory,+} from '@/session/settingsDeviceDirectory';+import { useTheme, useThemedStyles, type ThemeColors } from '@/theme';+import { fontWeight, iconSize, iconStroke, lineHeight, radius, spacing, typeScale } from '@/theme/tokens';+import { goBackGuarded } from '@/utils/backGuard';++const MAX_SELF_DEVICE_NAME_LENGTH = 64;+type PendingWrite = 'rename' | 'reset' | null;+type EditorMessage = { kind: 'info' | 'error'; text: string } | null;++/**+ * 本机名称编辑页(设置的二级页,独立 stack 路由)。+ *+ * - 明确的「保存」:只有名称有改动且不为空时可点;保存成功后返回设置。+ * - 返回即放弃:有未保存改动时,点返回、iOS 边缘右滑、Android 返回键都先确认放弃,+ * 不再在离开时静默保存。+ * - 「恢复默认名称」把服务端的手动名称清掉(name: null),由服务端给回默认名。+ */+export default function RenameSelfDeviceScreen() {+ const auth = useAuth();+ const router = useRouter();+ const navigation = useNavigation();+ const styles = useThemedStyles(makeStyles);+ const { colors } = useTheme();+ const { t } = useTranslation();+ const { selfDeviceName } = useSettingsDeviceDirectory();+ const systemDeviceName = buildMobileDeviceName({+ constantsDeviceName: Constants.deviceName,+ platform: Platform.OS,+ });+ const currentName = (selfDeviceName ?? systemDeviceName).trim();+ const [draft, setDraft] = useState(currentName);+ const [pending, setPending] = useState<PendingWrite>(null);+ const [message, setMessage] = useState<EditorMessage>(null);+ const [leaveAfterSave, setLeaveAfterSave] = useState(false);+ const touchedRef = useRef(false);+ const mountedRef = useRef(true);+ useEffect(() => () => { mountedRef.current = false; }, []);++ // 服务端名称晚于页面到达时,用户还没动过输入框就跟上最新值。+ useEffect(() => {+ if (!touchedRef.current) setDraft(currentName);+ }, [currentName]);++ const trimmedDraft = draft.trim();+ const dirty = trimmedDraft !== currentName;+ const saving = pending !== null;+ const canSave = dirty && trimmedDraft.length > 0 && !saving;++ const changeDraft = useCallback((value: string) => {+ touchedRef.current = true;+ setMessage(null);+ setDraft(value);+ }, []);++ const writeName = useCallback(async (kind: 'rename' | 'reset') => {+ const deviceId = auth.deviceId;+ if (!deviceId) {+ setMessage({ kind: 'error', text: t('settings.deviceNameEditor.deviceInitializing') });+ return;+ }+ setPending(kind);+ setMessage(null);+ try {+ const res = await auth.apiFetch<{ deviceId: string; name: string }>(+ `/api/device-link/devices/${encodeURIComponent(deviceId)}`,+ {+ baseUrl: DEVICE_LINK_API_BASE_URL,+ body: kind === 'reset' ? { name: null } : { name: trimmedDraft },+ method: 'PATCH',+ timeoutMs: SETTINGS_DEVICE_TIMEOUT_MS,+ },+ );+ publishSelfDeviceName(deviceId, res.name);+ if (!mountedRef.current) return;+ touchedRef.current = false;+ setDraft(res.name);+ if (kind === 'rename') setLeaveAfterSave(true);+ else setMessage({ kind: 'info', text: t('settings.deviceNameEditor.restoredDefault') });+ } catch (err) {+ if (mountedRef.current) setMessage({ kind: 'error', text: formatRemoteError(err) });+ } finally {+ if (mountedRef.current) setPending(null);+ }+ }, [auth, t, trimmedDraft]);++ const save = useCallback(() => {+ if (!canSave) {+ if (trimmedDraft.length === 0) setMessage({ kind: 'error', text: t('settings.deviceNameEditor.emptyError') });+ return;+ }+ void writeName('rename');+ }, [canSave, t, trimmedDraft.length, writeName]);++ const back = useCallback(() => goBackGuarded(router, '/settings'), [router]);++ // 保存成功后:草稿已与新名称一致(不再 dirty),此时返回不会触发放弃确认。+ useEffect(() => {+ if (leaveAfterSave && !dirty) {+ setLeaveAfterSave(false);+ back();+ }+ }, [back, dirty, leaveAfterSave]);++ // 有未保存改动时拦截所有离开方式(顶栏返回、iOS 边缘右滑、Android 返回键)。+ usePreventRemove(dirty && !leaveAfterSave, ({ data }) => {+ Alert.alert(+ t('settings.deviceNameEditor.discardTitle'),+ t('settings.deviceNameEditor.discardBody'),+ [+ { text: t('settings.deviceNameEditor.keepEditing'), style: 'cancel' },+ {+ text: t('settings.deviceNameEditor.discardConfirm'),+ style: 'destructive',+ onPress: () => navigation.dispatch(data.action),+ },+ ],+ );+ });++ return (+ <SafeAreaView edges={simpleScreenSafeAreaEdges()} style={styles.safeArea} testID="settings.renameSelfDevice.screen">+ <SimpleStackHeader+ backTestID="settings.renameSelfDevice.backButton"+ onBack={back}+ title={t('settings.deviceNameEditor.screenTitle')}+ />+ <View style={styles.content}>+ <View style={styles.inputRow}>+ <TextInput+ autoFocus+ editable={!saving}+ maxLength={MAX_SELF_DEVICE_NAME_LENGTH}+ onChangeText={changeDraft}+ onSubmitEditing={save}+ placeholder={t('settings.deviceNameEditor.placeholder')}+ placeholderTextColor={colors.textPlaceholder}+ returnKeyType="done"+ selectTextOnFocus+ style={styles.input}+ testID="settings.renameSelfDevice.input"+ value={draft}+ />+ {draft.length > 0 && !saving ? (+ <Pressable+ accessibilityLabel={t('settings.deviceNameEditor.clearAccessibility')}+ accessibilityRole="button"+ hitSlop={spacing.md}+ onPress={() => changeDraft('')}+ style={({ pressed }) => [styles.clearButton, pressed && mobileInteractionStyles.pressed]}+ testID="settings.renameSelfDevice.clear"+ >+ <X color={colors.textSecondary} size={iconSize.sm} strokeWidth={iconStroke.bold} />+ </Pressable>+ ) : null}+ </View>+ {message ? (+ <Text+ accessibilityRole={message.kind === 'error' ? 'alert' : undefined}+ style={[styles.message, message.kind === 'error' && styles.errorMessage]}+ testID="settings.renameSelfDevice.message"+ >+ {message.text}+ </Text>+ ) : (+ <Text style={styles.message}>{t('settings.about.deviceNameDetail')}</Text>+ )}+ <MainWindowActionGroup+ primaryActions={[{+ accessibilityLabel: t('devices.common.save'),+ busy: pending === 'rename',+ disabled: !canSave,+ label: t('devices.common.save'),+ onPress: save,+ testID: 'settings.renameSelfDevice.save',+ tone: 'primary',+ }]}+ secondaryActions={[{+ accessibilityLabel: t('settings.deviceNameEditor.resetAccessibility'),+ busy: pending === 'reset',+ disabled: saving,+ label: t('settings.deviceNameEditor.resetAction'),+ onPress: () => void writeName('reset'),+ testID: 'settings.renameSelfDevice.reset',+ }]}+ testID="settings.renameSelfDevice.actions"+ />+ </View>+ </SafeAreaView>+ );+}++const makeStyles = (colors: ThemeColors) => StyleSheet.create({+ safeArea: { backgroundColor: colors.surface, flex: 1 },+ content: {+ gap: spacing.md,+ paddingHorizontal: spacing.lg,+ paddingTop: spacing.xl,+ },+ inputRow: {+ alignItems: 'center',+ backgroundColor: colors.surfaceElevated,+ borderColor: colors.border,+ borderRadius: radius.pill,+ borderWidth: StyleSheet.hairlineWidth,+ flexDirection: 'row',+ minHeight: 52,+ paddingLeft: spacing.lg,+ paddingRight: spacing.md,+ },+ // 单行输入框不设行高:iOS 上会让占位字与光标偏位。+ input: {+ color: colors.textPrimary,+ flex: 1,+ fontSize: typeScale.body,+ minWidth: 0,+ paddingVertical: spacing.md,+ },+ clearButton: {+ alignItems: 'center',+ backgroundColor: colors.surfaceChip,+ borderRadius: radius.pill,+ height: iconSize.xl,+ justifyContent: 'center',+ width: iconSize.xl,+ },+ message: {+ color: colors.textSecondary,+ fontSize: typeScale.footnote,+ fontWeight: fontWeight.regular,+ lineHeight: lineHeight.caption,+ paddingHorizontal: spacing.md,+ },+ errorMessage: { color: colors.errorText },+});diff --git a/apps/mobile/app/settings/voice-dictionary.tsx b/apps/mobile/app/settings/voice-dictionary.tsxnew file mode 100644index 0000000000..10811d58a5--- /dev/null+++ b/apps/mobile/app/settings/voice-dictionary.tsx@@ -0,0 +1,220 @@+import { useRouter } from 'expo-router';+import { useCallback, useEffect, useMemo, useState } from 'react';+import { FlatList, Pressable, StyleSheet, View } from 'react-native';+import { SafeAreaView } from 'react-native-safe-area-context';+import { useTranslation } from 'react-i18next';+import { DEVICE_LINK_VOICE_DICTIONARY_GET_CHANNEL } from '@cindy/maker-shared/device-link-contract';+import type { MobileVoiceDictionarySnapshotResult } from '@cindy/maker-shared/device-link-contract';+import { Text } from '@/components/AppText';+import { useDeviceLink } from '@/device-link/DeviceLinkContext';+import { SimpleStackHeader, simpleScrollInsetProps, simpleScrollScreenSafeAreaEdges } from '@/platform/chrome';+import {+ hydrateMobileVoiceDictionary,+ readCachedMobileVoiceDictionarySnapshot,+ refreshMobileVoiceDictionary,+ subscribeMobileVoiceDictionaryCache,+} from '@/session/mobileVoiceDictionaryCache';+import { buildMobileVoiceDictionaryEntryViews } from '@/session/mobileVoiceDictionaryView';+import { useSettingsDeviceDirectory } from '@/session/settingsDeviceDirectory';+import { useSettingsRowStyles } from '@/session/SettingsGroupRows';+import { useThemedStyles, type ThemeColors } from '@/theme';+import { radius, spacing } from '@/theme/tokens';+import { goBackGuarded } from '@/utils/backGuard';++/**+ * 语音词典查看页(只读,设置的二级页)。+ *+ * 独立 stack 路由:iOS 边缘右滑、Android 返回键都只退回设置,不会连设置一起关掉。+ *+ * 词典对用户是**一份**:同账号下所有开启同步的电脑收敛到同一份内容,「这条词来自+ * 哪台电脑」是实现细节,不该出现在界面上 —— 同一台机器换名或重装就会多出一个分组,+ * 列表立刻没法看。所以这里把所有电脑的快照合并成单一列表。+ *+ * 正本在电脑上,手机只拉快照用于润色,因此没有任何编辑入口:增删改一律回电脑做,+ * 避免手机维护一份会分叉的副本。+ */+export default function VoiceDictionaryScreen() {+ const router = useRouter();+ const rowStyles = useSettingsRowStyles();+ const styles = useThemedStyles(makeStyles);+ const { t } = useTranslation();+ const { invoke } = useDeviceLink();+ const { desktopDevices } = useSettingsDeviceDirectory();+ const [refreshing, setRefreshing] = useState(false);+ /** 缓存在模块里,组件用这个计数强制重渲染(每次刷新完成 +1)。 */+ const [dictionaryRevision, setDictionaryRevision] = useState(0);++ /**+ * 向所有在线电脑各拉一次词典快照。+ *+ * 它们本来就该收敛到同一份内容,拉多台只是为了容错(某台是旧版本、某台正好断线)。+ * 失败一律静默:电脑离线、没开「允许被控」、老版本不认识这个 channel 都是常态,+ * 页面继续显示上次缓存,不弹错。+ */+ const refreshVoiceDictionary = useCallback(() => {+ const online = desktopDevices.filter((host) => host.online);+ if (online.length === 0) return;+ setRefreshing(true);+ void Promise.all(+ online.map((host) => refreshMobileVoiceDictionary(+ host.deviceId,+ () => invoke<MobileVoiceDictionarySnapshotResult>(+ host.deviceId,+ DEVICE_LINK_VOICE_DICTIONARY_GET_CHANNEL,+ [],+ ),+ { force: true },+ )),+ ).finally(() => {+ setRefreshing(false);+ // 缓存写在模块里,组件靠这个计数触发重渲染。+ setDictionaryRevision((value) => value + 1);+ });+ }, [desktopDevices, invoke]);++ // 设备清单是异步 REST 请求:页面打开后清单才到达时也走同一条路径,+ // 先把盘上缓存读进内存(离线也有内容可看),再拉一次最新的。+ useEffect(() => {+ if (desktopDevices.length === 0) return;+ let cancelled = false;+ void Promise.all(desktopDevices.map((host) => hydrateMobileVoiceDictionary(host.deviceId)))+ .then(() => {+ if (!cancelled) setDictionaryRevision((value) => value + 1);+ })+ .catch(() => undefined);+ refreshVoiceDictionary();+ return () => {+ cancelled = true;+ };+ }, [desktopDevices, refreshVoiceDictionary]);++ useEffect(() => subscribeMobileVoiceDictionaryCache(() => {+ setDictionaryRevision((value) => value + 1);+ }), []);++ // dictionaryRevision 只作为依赖存在:缓存是模块级的,刷新完成后靠它触发重算。+ const entries = useMemo(+ () =>+ buildMobileVoiceDictionaryEntryViews(+ desktopDevices.map((host) => readCachedMobileVoiceDictionarySnapshot(host.deviceId)),+ ),+ [desktopDevices, dictionaryRevision],+ );++ const status = desktopDevices.length === 0+ ? 'no-desktops'+ : desktopDevices.some((host) => host.online)+ ? 'ready'+ : 'all-offline';+ const footer = status === 'no-desktops'+ ? t('settings.voiceDictionary.noDesktops')+ : status === 'all-offline'+ ? t('settings.voiceDictionary.offlineHint')+ : t('settings.voiceDictionary.readOnlyHint');++ return (+ <SafeAreaView edges={simpleScrollScreenSafeAreaEdges()} style={styles.safeArea} testID="settings.voiceDictionary.screen">+ <SimpleStackHeader+ scrollEdge+ backTestID="settings.voiceDictionary.backButton"+ onBack={() => goBackGuarded(router, '/settings')}+ title={t('settings.voiceDictionary.screenTitle')}+ />+ {/*+ 词典上限是 1000 条,用 ScrollView 会把每一行都实例化出来 —— 低端机上首屏卡顿+ 且常驻内存。这里换成虚拟化列表,只挂载可见行;卡片视觉靠 header/item/footer+ 三段样式拼出来(FlatList 没法在外面包一层带圆角的 View 还保持自身滚动)。+ */}+ <FlatList+ {...simpleScrollInsetProps}+ ListFooterComponent={+ <>+ <View style={styles.listCardBottom} />+ <Text style={rowStyles.groupFooter}>{footer}</Text>+ </>+ }+ ListHeaderComponent={+ <>+ <View style={rowStyles.groupTitleRow}>+ <Text accessibilityRole="header" style={rowStyles.groupTitle}>{t('settings.voiceDictionary.sectionTitle')}</Text>+ </View>+ <View style={styles.listCardTop}>+ <Pressable+ accessibilityLabel={t('settings.voiceDictionary.refreshAccessibility')}+ accessibilityRole="button"+ accessibilityState={{ busy: refreshing || undefined }}+ onPress={refreshVoiceDictionary}+ style={({ pressed }) => [rowStyles.row, pressed && rowStyles.pressed]}+ testID="settings.voiceDictionary.refresh"+ >+ <View style={rowStyles.rowLine}>+ <Text style={rowStyles.rowLabel}>+ {t('settings.voiceDictionary.entryCount', { count: entries.length })}+ </Text>+ <Text style={rowStyles.rowValue} numberOfLines={1}>+ {refreshing+ ? t('settings.voiceDictionary.refreshing')+ : t('settings.voiceDictionary.refresh')}+ </Text>+ </View>+ </Pressable>+ </View>+ </>+ }+ contentContainerStyle={styles.listContent}+ data={entries}+ keyExtractor={(entry) => entry.key}+ renderItem={({ item }) => (+ <View style={styles.listCardMiddle}>+ <View style={rowStyles.divider} />+ <View style={rowStyles.row} testID={`settings.voiceDictionary.entry.${item.key}`}>+ <View style={rowStyles.rowLine}>+ <Text style={rowStyles.rowLabel} numberOfLines={2}>{item.text}</Text>+ </View>+ {item.aliases.length > 0 ? (+ <Text style={rowStyles.rowDetail} numberOfLines={2}>+ {t('settings.voiceDictionary.aliases', {+ aliases: item.aliases.join(t('settings.voiceDictionary.aliasSeparator')),+ })}+ </Text>+ ) : null}+ </View>+ </View>+ )}+ testID="settings.voiceDictionary.scroll"+ />+ </SafeAreaView>+ );+}++const makeStyles = (colors: ThemeColors) => StyleSheet.create({+ safeArea: { backgroundColor: colors.surface, flex: 1 },+ // —— 虚拟化列表拼出的卡片三段 ——+ listContent: { paddingBottom: spacing.xxl, paddingHorizontal: spacing.lg, paddingTop: spacing.lg },+ listCardTop: {+ backgroundColor: colors.surfaceElevated,+ borderColor: colors.border,+ borderTopLeftRadius: radius.container,+ borderTopRightRadius: radius.container,+ borderWidth: StyleSheet.hairlineWidth,+ marginTop: spacing.sm,+ overflow: 'hidden',+ },+ listCardMiddle: {+ backgroundColor: colors.surfaceElevated,+ borderColor: colors.border,+ borderLeftWidth: StyleSheet.hairlineWidth,+ borderRightWidth: StyleSheet.hairlineWidth,+ },+ listCardBottom: {+ backgroundColor: colors.surfaceElevated,+ borderBottomLeftRadius: radius.container,+ borderBottomRightRadius: radius.container,+ borderColor: colors.border,+ borderBottomWidth: StyleSheet.hairlineWidth,+ borderLeftWidth: StyleSheet.hairlineWidth,+ borderRightWidth: StyleSheet.hairlineWidth,+ height: radius.container,+ marginBottom: spacing.sm,+ },+});diff --git a/apps/mobile/app/shared-session.tsx b/apps/mobile/app/shared-session.tsxindex b3bccb06ea..9947cea04e 100644--- a/apps/mobile/app/shared-session.tsx+++ b/apps/mobile/app/shared-session.tsx@@ -14,7 +14,7 @@ import { sharedTaskErrorKey } from '@/device-link/sharedTaskCompatibility';import { isSharedTaskGone } from '@/device-link/sharedTaskAccessWatch';import { markDeviceAccessRevoked } from '@/device-link/accessRevoked';import { Text, TextInput } from '@/components/AppText';-import { MainWindowRowButton } from '@/components/MobilePrimitives';+import { MainWindowEmptyState, MainWindowRowButton } from '@/components/MobilePrimitives';import { SharedTaskAction, SharedTaskScreen } from '@/session/SharedTaskScreen';import { useSharedTaskConfirmation } from '@/session/useSharedTaskConfirmation';import { SharedTaskEndedState } from '@/session/SharedTaskEndedState';@@ -241,7 +241,7 @@ export default function SharedSessionScreen() {const taskCard = <View style={styles.taskRow}><FileText size={iconSize.md} color={colors.textTertiary} /><View style={styles.grow}><Text style={styles.taskTitle}>{title}</Text><Text style={styles.metadata}>{task?.deviceLinkDeviceName ?? t('sharedTask.runsOnHostDevice')}</Text></View></View>;return <SharedTaskScreentitle={t(ended ? 'sharedTask.ended' : !guestId && tab === 'owned' ? 'sharedTask.ownedTitle' : hostContext || guestId ? 'sharedTask.title' : 'sharedTask.join')}- onClose={() => goBackGuarded(router, '/devices')}>+ onClose={() => goBackGuarded(router)}>{confirmation.dialog}{!isAuthenticated ? <Text style={styles.intro}>{t('sharedTask.login')}</Text> : ended ? <SharedTaskEndedState onRejoin={() => {setJoinedId(undefined); setEnded(false); setState(null); setNotice(''); setLoadError('');@@ -253,11 +253,10 @@ export default function SharedSessionScreen() {</View>}{!!notice && <Text accessibilityRole="alert" style={styles.noticeText}>{notice}</Text>}{!!loadError && <Text accessibilityRole="alert" style={styles.noticeText}>{loadError}</Text>}- {!guestId && tab === 'owned' ? owned.length === 0 ? <View style={styles.empty}>- <View style={styles.largeIcon}><Check size={iconSize.md} color={colors.textPrimary} /></View>- <Text style={styles.emptyTitle}>{t('sharedTask.ownedEmptyTitle')}</Text><Text style={styles.emptyCopy}>{t('sharedTask.ownedEmptyHint')}</Text>+ {!guestId && tab === 'owned' ? owned.length === 0 ? <MainWindowEmptyState centered style={styles.ownedEmpty}+ testID="sharedTask.ownedEmpty" title={t('sharedTask.ownedEmptyTitle')} copy={t('sharedTask.ownedEmptyHint')}>{hostContext && <SharedTaskAction action={{ label: t('sharedTask.shareCurrent'), onPress: () => setTab('current') }} />}- </View> : <>+ </MainWindowEmptyState> : <><Text style={styles.intro}>{t('sharedTask.ownedIntro', { count: owned.length })}</Text>{owned.map((item) => <View key={item.sharedTaskId} style={styles.taskRow}><Users size={iconSize.md} color={colors.textTertiary} /><View style={styles.grow}><Text style={styles.taskTitle}>{item.title}</Text><Text style={styles.metadata}>{deviceName(item.hostDeviceId)}{guestCounts[item.sharedTaskId] !== undefined ? ' · ' + t('sharedTask.guestCount', { count: guestCounts[item.sharedTaskId] }) : ''}</Text></View>{item.sessionId === sessionId && item.hostDeviceId === deviceId ? <SharedTaskAction compact action={{ label: t('sharedTask.manage'), onPress: () => setTab('current') }} /> : <SharedTaskAction compact action={{ label: t('sharedTask.enterTask'), disabled: busy, onPress: () => void run(current => openTask(item.sharedTaskId, current), false) }} />}@@ -310,9 +309,9 @@ export default function SharedSessionScreen() {</SharedTaskScreen>;}const makeStyles = (colors: ThemeColors) => StyleSheet.create({- intro: { color: colors.textTertiary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption, marginBottom: spacing.lg },+ intro: { color: colors.textSecondary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption, marginBottom: spacing.lg },small: { color: colors.textPrimary, fontSize: typeScale.caption, lineHeight: lineHeight.caption },- smallMuted: { color: colors.textTertiary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption },+ smallMuted: { color: colors.textSecondary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption },taskTitle: { color: colors.textPrimary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption, fontWeight: fontWeight.medium },metadata: { color: colors.textTertiary, fontSize: typeScale.micro, lineHeight: lineHeight.micro },caption: { color: colors.textTertiary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption, marginBottom: spacing.sm },@@ -334,9 +333,10 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({peopleTitle: { color: colors.textTertiary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption, marginTop: spacing.lg, marginBottom: spacing.xs },avatar: { width: 28, height: 28, borderRadius: radius.pill, borderWidth: StyleSheet.hairlineWidth, borderColor: colors.border, backgroundColor: colors.surfaceChip, alignItems: 'center', justifyContent: 'center' },empty: { alignItems: 'center', paddingVertical: spacing.xl, paddingHorizontal: spacing.xs },+ ownedEmpty: { padding: spacing.xl, gap: spacing.md },largeIcon: { width: 44, height: 44, borderRadius: radius.pill, borderWidth: StyleSheet.hairlineWidth, borderColor: colors.border, alignItems: 'center', justifyContent: 'center', marginBottom: spacing.lg },emptyTitle: { color: colors.textPrimary, fontSize: typeScale.bodySmall, lineHeight: lineHeight.bodySmall, fontWeight: fontWeight.medium, textAlign: 'center' },- emptyCopy: { color: colors.textTertiary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption, textAlign: 'center', maxWidth: 280, marginTop: spacing.sm, marginBottom: spacing.lg },+ emptyCopy: { color: colors.textSecondary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption, textAlign: 'center', maxWidth: 280, marginTop: spacing.sm, marginBottom: spacing.lg },rule: { height: StyleSheet.hairlineWidth, backgroundColor: colors.border, marginVertical: spacing.lg },footer: { flexDirection: 'row', gap: spacing.sm, marginTop: spacing.lg },});diff --git a/apps/mobile/docs/ios-native-components.md b/apps/mobile/docs/ios-native-components.mdnew file mode 100644index 0000000000..dbeaaeab72--- /dev/null+++ b/apps/mobile/docs/ios-native-components.md@@ -0,0 +1,41 @@+# 移动端 iOS 原生组件现状++2026-09-29,按导航实验分支的实际调用代码核对(已定案回到侧边栏抽屉导航)。这里的“系统原生控件”指 UIKit / SwiftUI+控件,不把“React Native 最终也渲染 UIView”当作整页已使用系统控件的证据。++## 已使用系统组件的部分++| 用户看到的位置 | 实际实现 | 边界与源码 |+| --- | --- | --- |+| 普通页面返回、任务顶栏及工具栏 | 原生导航栈、UINavigationBar、系统 toolbar item | 标题内容可嵌入 RN;首页 / 伙伴首页的顶栏布局仍是 RN。[入口](../src/platform/chrome/SimpleStackHeader.tsx)、[任务顶栏](../src/session/SessionHeaderNativeControls.ios.tsx) |+| 设备范围、任务显示等下拉菜单 | UIMenu | 菜单是系统的;触发按钮可由调用方提供。旧包缺原生模块时有自绘回退。[入口](../src/platform/chrome/NativePullDownMenu.tsx) |+| 普通确认弹窗 | UIAlertController,经 React Native Alert 调用 | 自定义多步骤编辑不能一概算系统弹窗。[入口](../src/platform/chrome/showActionMenu.ts) |+| 设置里的开关 | SwiftUI 系统开关,经 @expo/ui 使用 | 设置分组和说明布局仍是 RN,不代表整页 Settings 原生化。[实现](../src/platform/chrome/NativeSwitch.tsx) |+| 顶栏圆形按钮、浮动新建按钮 | SwiftUI Button,原生玻璃/禁用反馈 | 保留 Cindy 业务图标,图标可以放在 RNHostView 里。首页浮动新建按钮外包一层原生形变视图:触摸由它接管(不播放按钮自身按压),按下即拉长成输入框药丸。[按钮](../src/platform/chrome/NativeChromeButton.ios.tsx)、[形变](../modules/cindy-tab-bar/ios/CindyTabBarModule.swift) |+| 登录页继续、Apple / SSO 等按钮 | SwiftUI Button + Cindy 的标签、品牌图案和布局 | 登录整页、手机号框、协议勾选与法律文字链接仍有自定义实现。[实现](../src/components/LoginNativeButton.ios.tsx) |+| SSO 登录窗口 | ASWebAuthenticationSession | 登录网页由认证服务提供。[调用](../src/auth/AuthContext.tsx) |+| 任务内搜索 | SwiftUI TextField、Button、原生 sheet | 与首页的搜索框不是同一个实现。[实现](../src/session/SessionSearchNative.ios.tsx) |+| 模型选择、模型设置 | 原生 Form / Section / Picker / Toggle / TextField 与原生按钮 | 业务图标、部分状态/内容由 RN 嵌入。[选择](../src/session/UnifiedModelPickerView.ios.tsx)、[设置](../src/session/ModelOptionsSheetView.ios.tsx) |+| 设备管理列表 | SwiftUI List、ListItem、SwipeActions | 与任务列表的自定义侧滑实现不同。[实现](../src/device-link/DeviceManagementList.ios.tsx) |+| 系统照片、相机、文件选择、分享 | 系统选择器 / 分享面板,经 Expo 模块调用 | 附件面板内的“最近媒体”网格不等于系统相册。[附件入口](../src/session/useMobileLocalAttachments.ts) |++## 原生容器或原生编辑核心,内容仍有定制++| 位置 | 已原生的部分 | 仍然定制的部分 |+| --- | --- | --- |+| 任务详情面板 | 系统 BottomSheet、展开档位和拖拽关闭 | RN 内容、间距和业务信息布局;不能称整页系统 Form。[实现](../src/session/SessionDetailsNative.ios.tsx) |+| 附件、伙伴等面板 | 原生 sheet;部分页面用 Form / Section / 原生按钮 | 某些资源块通过 RNHostView 嵌入 RN 内容。[公共外壳](../src/session/ComposerSheet.ios.tsx)、[伙伴内容桥](../src/session/CompanionNativeContent.ios.tsx) |+| 消息输入器 | UITextView 编辑核心与选择/撤销,原生展开控制器 | Cindy 编写的原生引用/文档逻辑、业务工具栏;外框在可用系统上用原生 GlassView。[编辑器](../src/session/ComposerNativeInput.ios.tsx)、[外框](../src/session/ComposerFrame.ios.tsx) |+| 底部动作菜单 | 自定义原生 UIViewController / UITableView + 系统 UISheetPresentationController;旧包回退系统 ActionSheetIOS | 不是每一种动作菜单都直接使用系统 UIAlertController。[模块](../modules/xdt-ios-action-sheet/ios/XdtIosActionSheetModule.swift) |++## 仍主要由 React Native 定制的部分++- 首页任务列表、分组与任务行;任务行侧滑使用 Reanimated 自定义交互,不是原生 List 的 SwipeActions。+- 消息、Markdown、代码、卡片等业务内容排版(某些文本/媒体内部仍调用原生视图)。+- 首页搜索框的外观与布局,是 RN TextInput 组合,不是任务内的 SwiftUI 搜索工具。+- 设置页分组、账号卡片、说明行与部分选择面板。+- 首页主菜单抽屉(侧边栏);iOS 的 FullWindowOverlay 只是承载层,不使抽屉内容变成系统菜单。+- Android 保留现有平台实现;新建形变、药丸拉开与键盘逐帧跟随只在 iOS 生效。++以上是代码事实。真实界面还受系统版本、原生模块是否已装入、回退条件和入口影响。+模拟器目检与交互测试结果单独记录在 [导航实验记录](./navigation-demo.md)。diff --git a/apps/mobile/docs/mobile-design-guide.md b/apps/mobile/docs/mobile-design-guide.mdindex 80130385b0..8d38eec08a 100644--- a/apps/mobile/docs/mobile-design-guide.md+++ b/apps/mobile/docs/mobile-design-guide.md@@ -8,12 +8,12 @@## 1. 视觉哲学-承接桌面:**灰度为主、零阴影、pill 几何、字重克制**。在此之上叠加移动端约束:+承接桌面:**灰度为主、默认零阴影、pill 几何、字重克制**。在此之上叠加移动端约束:- **iOS 优先**,触控优先,跟随系统 light / dark 自动切换(`useColorScheme`)。- **灰度环境**:除品牌 teal(就绪态)、Heart Orange(运行/thinking 态)和已登记的 Beta 渠道红色状态徽标外,界面全是黑白之间的灰阶。不引入任何品牌蓝 / 绿 / 红等装饰色。- **圆角走四档阶梯**(与 `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 边框,不用 `shadow*` / `elevation`。+- **默认零阴影**:层次靠背景色差 + 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。- **手机只做减法**(详见 `mobile-current-execution-plan.md`):主层信息量不超过桌面主层;视觉轻、触控够(可见图标小,hitSlop 补足热区)。@@ -269,7 +269,7 @@ iOS 新增与改造界面遵循 [iOS 原生界面规范](../../../docs/design-ru**Don't**- ❌ 写死 hex / rgba / `'Courier'`(dark 下不变色 / 字体不统一)。-- ❌ `shadow*` / `elevation`(零阴影)。+- ❌ 未登记的阴影(首页主菜单抽屉例外见 §1)。- ❌ 中间圆角(0 / 3 / 4 / 8 / 28)。- ❌ UI chrome 字重 > 600(已登记豁免域除外:原生 Markdown strong、登录品牌画布)。- ❌ 在组件体内内联定义 `makeStyles`(破坏缓存)。@@ -293,7 +293,7 @@ iOS 新增与改造界面遵循 [iOS 原生界面规范](../../../docs/design-ru- [ ] `makeStyles` 在**模块级**定义。- [ ] 字号 / 行高 / 字重 / 圆角 / 图标尺寸全走 token,无裸数字(必要微调写注释)。- [ ] 等宽用 `monoFont`。-- [ ] 无 `shadow*` / `elevation`、无中间圆角、**UI chrome 字重 ≤ 600**(已登记豁免域除外:原生 Markdown strong `src/session/MessageRenderer.tsx`、登录品牌画布 `app/(auth)/login.tsx` / `src/components/LoginSkinControls.tsx` / `src/auth/loginSkinLayout.ts` —— 这两处保留 `bold '700'`,验收时不要按 ≤ 600 降档)。+- [ ] 无未登记的阴影(首页主菜单抽屉例外见 §1)、无中间圆角、**UI chrome 字重 ≤ 600**(已登记豁免域除外:原生 Markdown strong `src/session/MessageRenderer.tsx`、登录品牌画布 `app/(auth)/login.tsx` / `src/components/LoginSkinControls.tsx` / `src/auth/loginSkinLayout.ts` —— 这两处保留 `bold '700'`,验收时不要按 ≤ 600 降档)。- [ ] 复用了 `MobilePrimitives`,没有重复造按钮/卡片/空态。- [ ] 在模拟器 light + dark(Cmd+Shift+A)都目检过。diff --git a/apps/mobile/docs/navigation-demo.md b/apps/mobile/docs/navigation-demo.mdnew file mode 100644index 0000000000..abfc885f93--- /dev/null+++ b/apps/mobile/docs/navigation-demo.md@@ -0,0 +1,100 @@+# 移动端导航与新建形变实验++这是实验分支的交付说明,尚不是可分发的正式安装包。++## 开发隔离++- 目录:/Users/kiro/AI-Agent/Project/Cindy-mobile-nav-demo+- 分支:experiment/mobile-bottom-navigation+- 基线:c2dd5e0c5669420a785c1dfe2edd6bcc660afb9c+- 创建日期:2026-09-27。+- 独立 worktree 与 node_modules;未复制原工作区的未提交改动、凭证、用户数据或授权文件。+- 只在此 worktree 编辑。不切换原目录的分支,不停止原目录的 Metro,不向 main 推送。++## 试用构建隔离++从本目录运行只读检查:++ node scripts/mobile-navigation-demo.mjs inspect --region=cn+ node scripts/mobile-navigation-demo.mjs inspect --region=global++本地检查 JavaScript 打包(输出到系统临时目录,不安装、不上传):++ node scripts/mobile-navigation-demo.mjs export --region=cn --platform=ios++在指定的已启动 iOS 模拟器上构建、安装并打开独立试用版:++ DEVELOPER_DIR=/Users/kiro/Downloads/Xcode.app/Contents/Developer node scripts/mobile-navigation-demo.mjs simulator --region=cn --udid=<模拟器 UUID>++该入口复用仓内的有界 Pods 安装与原生指纹检查,生成自带 JS 的 Release 模拟器包,+保留模拟器正常的本地代码签名与钥匙串能力;不需要团队分发签名、不使用 Metro 开发服务。+构建只包含所选模拟器当前使用的架构(ONLY_ACTIVE_ARCH=YES)。+必须使用 Xcode 27.1+:入口检查工具链版本、产物 SDK 与 Scene manifest;只在 27.1+模拟器中运行一个 27.0 SDK 包不足以启用现有 Duo reserved-region 适配代码。+ExpoModulesJSI 的接口清理脚本只识别旧编译器的 __ObjC. 写法,27.1 改为 __ObjC::。+试用入口在此 worktree 的依赖副本里兼容两种写法,以原子替换断开 pnpm 硬链接,+不改动共享 store、其他 worktree 或依赖版本;依赖脚本结构变化时停止并要求重新核对。+只安装并重启独立试用应用,不卸载其他应用,不复制已有登录态。每次代码修改后重新运行+会增量构建并更新随包 JS。打开窗口仍使用仓库的 sim-open 入口。++入口只接受本实验分支和显式区域,不启动 Metro 开发服务、不争用 8081、不读其他目录的 .env。+首次导出时若缺少被静态引用的 endpoint.dev.json,仅从仓内公开 example 初始化此 worktree 的忽略文件。++| 区域 | iOS / Android 应用标识 | 应用自身链接 scheme |+| --- | --- | --- |+| Global | com.xd.cindy.navdemo | cindynavdemo |+| 中国大陆 | com.xd.cindycn.navdemo | cindycnnavdemo |++只设置 EXPO_PUBLIC_CINDY_NAV_DEMO 不足以识别为试用版:同时核验原生安装身份与 Expo 配置标记。+试用构建禁用 OTA,不使用现有 EAS / self-host 项目和发布配置。首轮通过整包更新试用版本。+普通构建未启用该变量时继续返回原配置。试用配置必然产生新原生指纹,需要独立出包;+不能把试用包的 bundle 投给正式装机。本分支不能未经拆分就合入主干或正式发布线。++## 定案(2026-09-29)++- 不采用底部标签栏;回到侧边栏抽屉导航(左上菜单:任务/伙伴切换、搜索、设备管理、加入共享任务、+ 设置、切换账号、退出登录)。底栏相关代码、开关与文案已全部删除。+- 保留首页悬浮新建按钮,按方案 A 坐在输入框静止底线上:右缘 = 输入框右内边距 16pt,+ 下缘 = 安全区 + 8pt,按钮与药丸同为 55pt(`composerGeometry.pillHeight`)。+- 已合并「移动端账号信息优化」:侧栏账号区大号姓名 + 默认字母头像 + 公司小图标、不显示 ID;+ 侧栏右侧圆角与柔和阴影(DESIGN.md 已登记局部例外),滑出/关闭/拖动共用同一进度。++## 当前交互(iOS)++- 新建:原生 `CindyComposerMorphSource` 接管按钮触摸,按下即横向拉长成等高药丸(不播系统按压),+ iOS 式利落弹簧(响应约 0.36s、刚度 305、阻尼比 0.67,单次过冲约 14pt 后停稳);抬手进入新建页,滑出松开弹回、不导航。页面挂载前由替身玻璃生长,+ 就绪后真实玻璃带速度接力;进入时不播推入动画,进入后恢复普通返回动画。只有首页开启形变。+- 输入框:新建、已有任务、伙伴聊天统一为 55pt 药丸,下沿同一条线;不自动聚焦。手动点药丸先向上+ 拉开成完整卡片(原生),约 0.05s 后原生聚焦,键盘随后升起;输入框逐帧跟随键盘+ (新建页 `ComposerDockKeyboardSpacer`,已有任务 `DockKeyboardLift` / `DockKeyboardViewportSpacer`)。+- 减弱动态效果:不播形变与拉开,直接到位。+- 伙伴对话:左上角为返回(回到伙伴列表);Duo 系统栏已有返回时保留侧栏按钮,不出现两个返回。+- 设置等整页滚动的二级页:顶栏透明、系统柔和边缘,内容滚到顶栏和底部指示条下面,无硬分界(设置、语音词典、账号注销、伙伴私聊、共享任务管理、资源列表);设备详情、自动化只去掉底部色带。++## 已知未完成++- 已有任务页键盘升起过程中,消息列表内容不随动,停稳后跳到底(自研历史列表滚动锚定)。+- 卡片收回药丸仍为直接切换;禁用的新建按钮点击无说明。+- 深色全量实走、Duo 各姿态、真机帧率未做。+- `devices.json` 同一对象里 `failed` 键重复(基线即如此,前者文案永不生效),未处理。+- 设备详情、自动化页列表上方有固定的搜索/概览条,列表顶端仍是硬切。++## 合入前待办(效果全部确认后统一处理)++2026-09-29 用户决定:试用阶段优先看效果,守护与登记类修正等所有效果确认后最后一次性处理;+在此之前本分支不提交、不提 PR(CI 会拦)。++- [ ] `designTokenDiscipline.test.ts` 失败:ALLOWLIST 里 `ComposerFrame.ios.tsx :: borderRadius: 30`+ 已过期(圆角移到 `composerGeometry.cornerRadius` 常量),同时让守护覆盖这类常量写法。+- [ ] 圆钮入场弹簧(刚度 305、阻尼比 0.67,单次过冲约 14pt)和药丸拉开弹簧登记到 DESIGN.md §14.4 动效例外。+- [ ] 形变与聚焦相关的散落时长(0.05 / 0.18 / 0.22 秒、320 / 400ms)改用 token 或登记原因。+- [ ] 原生模块 `modules/cindy-tab-bar` 已不含标签栏,只剩新建形变与药丸拉开:合入前改名(如 cindy-composer-morph,需 pod install),+ 并拆掉试用身份(`src/config/navigationDemo.ts`、`app.config.js`、`scripts/*navigation-demo*`、env 中的 IS_NAVIGATION_DEMO);+ 原生改动触发冷更,合并前须指定把关人确认。+- [ ] `envBundleTransform.test.ts`:`src/config/env.ts` 引入试用配置 `./navigationDemo` 后测试桩缺条目,补+ `if (id === './navigationDemo') return { IS_NAVIGATION_DEMO: false, NAVIGATION_DEMO_SCHEME: 'cindynavdemo' };`。++## 验证记录++完整试验过程(含已放弃的底栏方案)不再保留在仓库;最近一次验证:iPhone 浅色实走首页 / 侧栏 /+新建形变 / 药丸对齐 / 点开弹键盘;Mobile 类型检查 0 错误;全量测试除合入前待办 3 项外通过。diff --git a/apps/mobile/modules/cindy-tab-bar/expo-module.config.json b/apps/mobile/modules/cindy-tab-bar/expo-module.config.jsonnew file mode 100644index 0000000000..aea9d3286b--- /dev/null+++ b/apps/mobile/modules/cindy-tab-bar/expo-module.config.json@@ -0,0 +1,7 @@+{+ "platforms": ["apple"],+ "apple": {+ "podspecPath": "./ios/CindyTabBar.podspec",+ "modules": ["CindyTabBarModule"]+ }+}diff --git a/apps/mobile/modules/cindy-tab-bar/ios/CindyTabBar.podspec b/apps/mobile/modules/cindy-tab-bar/ios/CindyTabBar.podspecnew file mode 100644index 0000000000..fce323bc96--- /dev/null+++ b/apps/mobile/modules/cindy-tab-bar/ios/CindyTabBar.podspec@@ -0,0 +1,18 @@+require 'json'+package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))+Pod::Spec.new do |s|+ s.name = 'CindyTabBar'+ s.version = package['version']+ s.summary = 'iOS new-task button to composer pill morph and pill-to-card expansion.'+ s.description = s.summary+ s.license = { :type => 'Apache-2.0', :file => '../../../../../LICENSE' }+ s.author = 'Cindy'+ s.homepage = 'https://github.com/makecindy/cindy'+ s.platforms = { :ios => '16.4' }+ s.swift_version = '5.9'+ s.source = { git: 'https://github.com/makecindy/cindy.git' }+ s.static_framework = true+ s.dependency 'ExpoModulesCore'+ s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'SWIFT_COMPILATION_MODE' => 'wholemodule' }+ s.source_files = '**/*.{h,m,swift}'+enddiff --git a/apps/mobile/modules/cindy-tab-bar/ios/CindyTabBarModule.swift b/apps/mobile/modules/cindy-tab-bar/ios/CindyTabBarModule.swiftnew file mode 100644index 0000000000..5f7605f505--- /dev/null+++ b/apps/mobile/modules/cindy-tab-bar/ios/CindyTabBarModule.swift@@ -0,0 +1,481 @@+import ExpoModulesCore+import UIKit++/// Home new-task button → composer pill morph, and the pill → card expansion.+/// The native part only animates; navigation stays in JS.+public class CindyTabBarModule: Module {+ public func definition() -> ModuleDefinition {+ Name("CindyTabBar")+ View(CindyComposerMorphSource.self) {+ Events("onAction", "onGeometry")+ Prop("actionDisabled") { (view: CindyComposerMorphSource, disabled: Bool) in view.actionDisabled = disabled }+ }+ View(CindyComposerMorphTarget.self) {+ Events("onComplete")+ Prop("transitionId") { (view: CindyComposerMorphTarget, id: String) in view.transitionId = id; view.setNeedsLayout() }+ Prop("cornerRadius") { (view: CindyComposerMorphTarget, value: Double) in view.targetCornerRadius = value }+ Prop("expandToken") { (view: CindyComposerMorphTarget, token: String) in view.expandToken = token }+ }+ }+}++/// Wraps the floating new-task button. A shield above it takes the touch, so+/// the glass button's own press (grow and brighten) never plays: touch-down+/// starts stretching the circle, touch-up inside opens the page, and a slide-off+/// release springs the pill back. It also reports the button's window frame,+/// which the composer uses as its resting bottom edge and pill height.+final class CindyComposerMorphSource: ExpoView {+ let onAction = EventDispatcher()+ let onGeometry = EventDispatcher()+ var actionDisabled = false { didSet { shield.isHidden = actionDisabled } }+ private let shield = CindyActionShield()+ private var pressOrigin: [String: Any]?+ private var lastFrame = CGRect.null++ required init(appContext: AppContext? = nil) {+ super.init(appContext: appContext)+ shield.onPressBegan = { [weak self] in self?.pressBegan() }+ shield.onPressEnded = { [weak self] inside in self?.pressEnded(inside: inside) }+ addSubview(shield)+ }+ override func layoutSubviews() {+ super.layoutSubviews()+ shield.frame = bounds+ bringSubviewToFront(shield)+ reportGeometry()+ }+ override func didMoveToWindow() {+ super.didMoveToWindow()+ lastFrame = .null+ if window == nil {+ if pressOrigin != nil { CindyComposerMorph.current?.cancel() }+ pressOrigin = nil+ } else { setNeedsLayout() }+ }+ private func reportGeometry() {+ guard let window, !bounds.isEmpty else { return }+ let rect = convert(bounds, to: window)+ guard rect != lastFrame else { return }+ lastFrame = rect+ onGeometry(CindyComposerMorph.geometry(rect, in: window, id: "layout"))+ }+ private func pressBegan() {+ guard !actionDisabled, let window, CindyComposerMorph.current == nil else { return }+ pressOrigin = CindyComposerMorph.begin(source: self, window: window)+ if pressOrigin == nil { pressOrigin = [:] }+ }+ private func pressEnded(inside: Bool) {+ guard let origin = pressOrigin else { return }+ pressOrigin = nil+ guard inside, !actionDisabled, window != nil else { CindyComposerMorph.current?.cancel(); return }+ if origin.isEmpty { onAction([:]); return }+ CindyComposerMorph.current?.commit()+ onAction(["origin": origin])+ }+}++/// A short-lived in-memory handoff. The source screen is never saved to disk.+@MainActor private final class CindyComposerMorph {+ static var current: CindyComposerMorph?+ /// Last composer contour per window size. Lets the button start growing on+ /// the tap frame instead of waiting ~300ms for the new page to mount.+ private static var landing: (window: CGSize, rect: CGRect, radius: CGFloat, style: UIUserInterfaceStyle)?+ // iOS-style snappy spring with a visible single bounce: response ≈ 0.36s+ // (stiffness = (2π / response)²). Damping ratio 0.67 overshoots once by+ // ≈ 14pt on the phone's pill, just short of the 16pt screen inset, then+ // settles. The lead, the real glass and the slide-off return share it.+ private static let stiffness: CGFloat = 305+ private static let dampingRatio: CGFloat = 0.67+ private static let omega = stiffness.squareRoot()+ let id = UUID().uuidString+ weak var window: UIWindow?+ weak var glass: UIVisualEffectView?+ weak var content: UIView?+ private var originalCorners: Any?+ private var originalContentAlpha: CGFloat = 1+ private var originalContentClips = false+ private var originalContentRadius: CGFloat = 0+ private(set) var morphSize = CGSize.zero+ let sourceRect: CGRect+ let overlay: UIView+ let backdrop: UIView+ let sourceImage: UIView+ private var lead: UIVisualEffectView?+ private var leadRadius: CGFloat = 0+ private var leadStartedAt: CFTimeInterval = 0+ var timeout: DispatchWorkItem?+ var animator: UIViewPropertyAnimator?+ var leadAnimator: UIViewPropertyAnimator?+ var reveal: UIViewPropertyAnimator?+ var controls: UIViewPropertyAnimator?+ var dissolve: UIViewPropertyAnimator?+ var backgroundObserver: NSObjectProtocol?++ static func geometry(_ rect: CGRect, in window: UIWindow, id: String) -> [String: Any] {+ ["id": id, "x": rect.minX, "y": rect.minY, "width": rect.width, "height": rect.height,+ "windowWidth": window.bounds.width, "windowHeight": window.bounds.height]+ }+ static func begin(source: UIView, window: UIWindow) -> [String: Any]? {+ current?.finish()+ let rect = source.convert(source.bounds, to: window)+ guard window.bounds.contains(rect), !rect.isEmpty,+ let backdrop = window.snapshotView(afterScreenUpdates: false),+ let sourceImage = source.snapshotView(afterScreenUpdates: false) else { return nil }+ let transition = CindyComposerMorph(window: window, rect: rect, backdrop: backdrop, sourceImage: sourceImage)+ current = transition+ if #available(iOS 26.0, *), !UIAccessibility.isReduceMotionEnabled {+ if let landing, landing.window == window.bounds.size, abs(landing.rect.maxY - rect.maxY) < 2 {+ transition.startLead(to: landing.rect, radius: landing.radius, style: landing.style)+ } else {+ // First open: the compact composer pill is as tall as the button and+ // spans the JS composerGeometry insets, so the circle only stretches+ // sideways. The real glass retargets smoothly if it differs.+ let guess = CGRect(x: 16, y: rect.minY, width: window.bounds.width - 32, height: rect.height)+ transition.startLead(to: guess, radius: rect.height / 2, style: source.traitCollection.userInterfaceStyle)+ }+ }+ return geometry(rect, in: window, id: transition.id)+ }+ init(window: UIWindow, rect: CGRect, backdrop: UIView, sourceImage: UIView) {+ self.window = window; sourceRect = rect; self.backdrop = backdrop; self.sourceImage = sourceImage+ overlay = UIView(frame: window.bounds)+ overlay.accessibilityElementsHidden = true+ // Swallow repeated taps only during the short handoff; route guards remain authoritative.+ overlay.isUserInteractionEnabled = true+ backdrop.frame = overlay.bounds+ overlay.addSubview(backdrop)+ sourceImage.frame = rect+ overlay.addSubview(sourceImage)+ window.addSubview(overlay)+ backgroundObserver = NotificationCenter.default.addObserver(forName: UIApplication.willResignActiveNotification,+ object: nil, queue: .main) { [weak self] _ in MainActor.assumeIsolated { self?.finish() } }+ }+ private static func spring(velocity: CGFloat) -> UISpringTimingParameters {+ UISpringTimingParameters(mass: 1, stiffness: stiffness, damping: 2 * dampingRatio * omega,+ initialVelocity: CGVector(dx: velocity, dy: velocity))+ }+ /// Spring progress and velocity (per second, in progress units) after `t`.+ private static func springState(_ t: CFTimeInterval) -> (progress: CGFloat, velocity: CGFloat) {+ let damped = omega * (1 - dampingRatio * dampingRatio).squareRoot()+ let decay = CGFloat(exp(-Double(dampingRatio * omega) * t)), phase = damped * CGFloat(t)+ let progress = 1 - decay * (cos(phase) + dampingRatio * omega / damped * sin(phase))+ return (progress, decay * omega * omega / damped * sin(phase))+ }+ /// The new page is on its way: bound the wait for it to mount. Not armed+ /// while a finger is still down, so a long press cannot time the morph out.+ func commit() {+ guard timeout == nil else { return }+ let timeout = DispatchWorkItem { [weak self] in self?.finish() }+ self.timeout = timeout+ DispatchQueue.main.asyncAfter(deadline: .now() + 1.6, execute: timeout)+ }+ /// Slide-off release: the stand-in springs back into the button, then the+ /// overlay goes away. Nothing was navigated.+ func cancel() {+ guard let lead, let leadAnimator else { finish(); return }+ leadAnimator.stopAnimation(true)+ self.leadAnimator = nil+ let back = UIViewPropertyAnimator(duration: 0.4, timingParameters: Self.spring(velocity: 0))+ back.addAnimations {+ lead.frame = self.sourceRect+ if #available(iOS 26.0, *) { lead.cornerConfiguration = .corners(radius: .fixed(min(self.sourceRect.width, self.sourceRect.height) / 2)) }+ self.sourceImage.alpha = 1+ }+ back.addCompletion { [weak self] _ in self?.finish() }+ animator = back+ back.startAnimation()+ }+ /// Grows a stand-in glass over the old screen while the new page mounts.+ @available(iOS 26.0, *)+ private func startLead(to rect: CGRect, radius: CGFloat, style: UIUserInterfaceStyle) {+ let lead = UIVisualEffectView(effect: UIGlassEffect(style: .regular))+ lead.overrideUserInterfaceStyle = style+ lead.isUserInteractionEnabled = false+ lead.frame = sourceRect+ lead.cornerConfiguration = .corners(radius: .fixed(min(sourceRect.width, sourceRect.height) / 2))+ overlay.insertSubview(lead, belowSubview: sourceImage)+ self.lead = lead; leadRadius = radius+ let animator = UIViewPropertyAnimator(duration: 0.5, timingParameters: Self.spring(velocity: 0))+ animator.addAnimations {+ lead.frame = rect+ lead.cornerConfiguration = .corners(radius: .fixed(radius))+ }+ leadAnimator = animator+ leadStartedAt = CACurrentMediaTime()+ animator.startAnimation()+ UIViewPropertyAnimator(duration: 0.16, curve: .easeOut) { self.sourceImage.alpha = 0 }.startAnimation()+ }+ func run(target: UIView, rect: CGRect, cornerRadius: CGFloat, completion: @escaping () -> Void) {+ guard let window, target.window === window, overlay.bounds.size == window.bounds.size,+ abs(rect.maxY - sourceRect.maxY) < 2 else { finish(); completion(); return }+ guard #available(iOS 26.0, *), !UIAccessibility.isReduceMotionEnabled,+ let glass = target.superview as? UIVisualEffectView, let host = glass.superview,+ glass.effect is UIGlassEffect else { finish(); completion(); return }+ // The composer glass follows the app theme, which can differ from the system one.+ let style = glass.overrideUserInterfaceStyle == .unspecified ? glass.traitCollection.userInterfaceStyle : glass.overrideUserInterfaceStyle+ // A radius above half the height renders as a capsule; interpolate the+ // effective value so the contour never reads as a different shape.+ let cornerRadius = min(cornerRadius, rect.height / 2)+ Self.landing = (window.bounds.size, rect, cornerRadius, style)+ // Grow the real, already-rendered glass. Frame and corner radius animate+ // in the render server, so the contour stays truly round instead of being+ // squashed by a scale transform, and nothing is swapped at the end.+ self.glass = glass+ content = target+ morphSize = host.bounds.size+ originalCorners = glass.cornerConfiguration+ originalContentAlpha = target.alpha+ originalContentClips = target.clipsToBounds+ originalContentRadius = target.layer.cornerRadius+ // Continue from wherever the lead glass is, with its current velocity.+ var from = sourceRect+ var fromRadius = min(sourceRect.width, sourceRect.height) / 2+ var velocity: CGFloat = 0+ if let lead, let leadAnimator {+ let state = Self.springState(CACurrentMediaTime() - leadStartedAt)+ leadAnimator.stopAnimation(true)+ self.leadAnimator = nil+ from = lead.frame+ fromRadius += (leadRadius - fromRadius) * state.progress+ // Relative to the remaining distance (negative after the overshoot); the+ // same spring then continues the lead's exact trajectory to the landing.+ velocity = abs(1 - state.progress) > 0.01 ? state.velocity / (1 - state.progress) : 0+ }+ let start = host.convert(from, from: window)+ let end = host.bounds+ UIView.performWithoutAnimation {+ glass.frame = start+ glass.cornerConfiguration = .corners(radius: .fixed(fromRadius))+ // Keep the controls at their final place and clip them to the growing+ // contour, so they are revealed by the glass instead of floating outside.+ target.bounds.origin = CGPoint(x: start.minX - end.minX, y: start.minY - end.minY)+ target.clipsToBounds = true+ target.layer.cornerCurve = .continuous+ target.layer.cornerRadius = fromRadius+ target.alpha = 0+ lead?.frame = from+ lead?.cornerConfiguration = .corners(radius: .fixed(fromRadius))+ glass.layoutIfNeeded()+ }+ let animator = UIViewPropertyAnimator(duration: 0.5, timingParameters: Self.spring(velocity: velocity))+ animator.addAnimations {+ glass.frame = end+ if let corners = self.originalCorners as? UICornerConfiguration { glass.cornerConfiguration = corners }+ target.bounds.origin = .zero+ target.layer.cornerRadius = cornerRadius+ // The lead tracks the real glass exactly until it is removed.+ self.lead?.frame = rect+ self.lead?.cornerConfiguration = .corners(radius: .fixed(cornerRadius))+ }+ animator.addCompletion { [weak self] position in+ self?.finish()+ if position == .end { completion() }+ }+ self.animator = animator+ // The old screen clears quickly while the lead dematerializes over the+ // real glass tracking it underneath, so the tint eases from the button's+ // to the composer's instead of switching on one frame.+ let reveal = UIViewPropertyAnimator(duration: 0.18, curve: .easeOut) {+ self.backdrop.alpha = 0+ self.sourceImage.alpha = 0+ }+ if let lead {+ let dissolve = UIViewPropertyAnimator(duration: 0.22, curve: .easeInOut) { lead.effect = nil }+ dissolve.addCompletion { [weak self] _ in lead.removeFromSuperview(); if self?.lead === lead { self?.lead = nil } }+ self.dissolve = dissolve+ dissolve.startAnimation(afterDelay: 0.06)+ }+ let controls = UIViewPropertyAnimator(duration: 0.24, curve: .easeOut) { target.alpha = self.originalContentAlpha }+ self.reveal = reveal+ self.controls = controls+ animator.startAnimation()+ reveal.startAnimation()+ controls.startAnimation(afterDelay: 0.1)+ }+ func finish() {+ timeout?.cancel(); timeout = nil+ for running in [animator, leadAnimator, reveal, controls, dissolve] where running?.state == .active { running?.stopAnimation(true) }+ animator = nil; leadAnimator = nil; reveal = nil; controls = nil; dissolve = nil+ UIView.performWithoutAnimation {+ if let glass, let host = glass.superview {+ glass.frame = host.bounds+ if #available(iOS 26.0, *), let corners = originalCorners as? UICornerConfiguration {+ glass.cornerConfiguration = corners+ }+ }+ if let content {+ content.bounds.origin = .zero+ content.clipsToBounds = originalContentClips+ content.layer.cornerRadius = originalContentRadius+ content.alpha = originalContentAlpha+ }+ }+ glass = nil; content = nil; lead = nil+ overlay.removeFromSuperview()+ if let backgroundObserver { NotificationCenter.default.removeObserver(backgroundObserver) }+ backgroundObserver = nil+ if Self.current === self { Self.current = nil }+ }+}++/// Pulls the compact pill open into the card: the glass grows upward from the+/// pill's contour with its bottom edge fixed, revealing the card's controls.+@MainActor private final class CindyComposerExpand {+ private static var running: [ObjectIdentifier: CindyComposerExpand] = [:]+ private weak var glass: UIVisualEffectView?+ private weak var content: UIView?+ private var corners: Any?+ private var contentClips = false+ private var contentRadius: CGFloat = 0+ private var animator: UIViewPropertyAnimator?++ @available(iOS 26.0, *)+ static func run(content: UIView, from: CGRect, cornerRadius: CGFloat) {+ guard !UIAccessibility.isReduceMotionEnabled, let glass = content.superview as? UIVisualEffectView,+ let host = glass.superview, let window = host.window, glass.effect is UIGlassEffect else { return }+ running[ObjectIdentifier(glass)]?.finish()+ let expand = CindyComposerExpand()+ expand.glass = glass; expand.content = content+ expand.corners = glass.cornerConfiguration+ expand.contentClips = content.clipsToBounds+ expand.contentRadius = content.layer.cornerRadius+ let start = host.convert(from, from: window), end = host.bounds+ let startRadius = min(start.width, start.height) / 2+ UIView.performWithoutAnimation {+ glass.frame = start+ glass.cornerConfiguration = .corners(radius: .fixed(startRadius))+ content.bounds.origin = CGPoint(x: start.minX - end.minX, y: start.minY - end.minY)+ content.clipsToBounds = true+ content.layer.cornerCurve = .continuous+ content.layer.cornerRadius = startRadius+ glass.layoutIfNeeded()+ }+ // Critically damped and brisk: open before the keyboard starts rising.+ let stiffness: CGFloat = 320+ let spring = UISpringTimingParameters(mass: 1, stiffness: stiffness, damping: 2 * stiffness.squareRoot(), initialVelocity: .zero)+ let animator = UIViewPropertyAnimator(duration: 0.35, timingParameters: spring)+ animator.addAnimations {+ glass.frame = end+ if let corners = expand.corners as? UICornerConfiguration { glass.cornerConfiguration = corners }+ content.bounds.origin = .zero+ content.layer.cornerRadius = min(cornerRadius, end.height / 2)+ }+ animator.addCompletion { _ in expand.finish() }+ expand.animator = animator+ running[ObjectIdentifier(glass)] = expand+ animator.startAnimation()+ // Focus early: the keyboard takes a moment to appear, so it starts rising+ // as the card finishes opening. Focusing the native text view directly+ // avoids waiting on a busy JS thread; RN still receives its focus event.+ DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) { [weak content] in+ guard let content, content.window != nil, let input = firstTextInput(in: content), !input.isFirstResponder else { return }+ input.becomeFirstResponder()+ }+ }+ private static func firstTextInput(in view: UIView) -> UIView? {+ if let text = view as? UITextView, text.isEditable { return text }+ if let field = view as? UITextField, field.isEnabled { return field }+ for child in view.subviews { if let found = firstTextInput(in: child) { return found } }+ return nil+ }+ func finish() {+ if animator?.state == .active { animator?.stopAnimation(true) }+ animator = nil+ UIView.performWithoutAnimation {+ if let glass, let host = glass.superview {+ glass.frame = host.bounds+ if #available(iOS 26.0, *), let corners = corners as? UICornerConfiguration { glass.cornerConfiguration = corners }+ }+ if let content {+ content.bounds.origin = .zero+ content.clipsToBounds = contentClips+ content.layer.cornerRadius = contentRadius+ }+ }+ if let glass { Self.running[ObjectIdentifier(glass)] = nil }+ }+ static func finish(glassOf content: UIView) {+ guard let glass = content.superview else { return }+ running[ObjectIdentifier(glass)]?.finish()+ }+}++final class CindyComposerMorphTarget: ExpoView {+ let onComplete = EventDispatcher()+ var transitionId = ""+ var targetCornerRadius: Double = 0+ /// Changes when JS opens the pill; the next taller layout is animated.+ var expandToken = "" {+ didSet {+ guard expandToken != oldValue, !expandToken.isEmpty else { return }+ expandFrom = lastRect+ expandArmedAt = CACurrentMediaTime()+ }+ }+ private var lastRect: CGRect?+ private var expandFrom: CGRect?+ private var expandArmedAt: CFTimeInterval = 0+ private var started = ""+ private func expandIfArmed() {+ guard let window else { lastRect = nil; return }+ let rect = convert(bounds, to: window)+ if let from = expandFrom, rect.size != from.size {+ expandFrom = nil+ // Only the pill→card change: taller, same bottom edge, no entry morph.+ if #available(iOS 26.0, *), CACurrentMediaTime() - expandArmedAt < 0.6, rect.height > from.height + 1,+ abs(rect.maxY - from.maxY) < 2, CindyComposerMorph.current == nil, let content = superview {+ CindyComposerExpand.run(content: content, from: from, cornerRadius: targetCornerRadius)+ }+ } else if rect.size != lastRect?.size, let content = superview {+ // Any other resize (typing, keyboard) keeps its ordinary layout.+ CindyComposerExpand.finish(glassOf: content)+ }+ lastRect = rect+ }+ override func layoutSubviews() {+ super.layoutSubviews()+ expandIfArmed()+ if started == transitionId, let window, let transition = CindyComposerMorph.current,+ transition.id == transitionId, (transition.overlay.bounds.size != window.bounds.size+ || (transition.glass != nil && transition.morphSize != bounds.size)) {+ transition.finish()+ onComplete([:])+ }+ guard !transitionId.isEmpty, started != transitionId, window != nil, !bounds.isEmpty else { return }+ let id = transitionId+ DispatchQueue.main.async { [weak self] in+ guard let self, self.started != id, self.transitionId == id, let window = self.window,+ let target = self.superview else { return }+ self.started = id+ let complete = { [weak self] in+ guard let self, self.window != nil else { return }+ self.onComplete([:])+ }+ guard let transition = CindyComposerMorph.current, transition.id == id else { complete(); return }+ transition.run(target: target, rect: self.convert(self.bounds, to: window), cornerRadius: self.targetCornerRadius, completion: complete)+ }+ }+ override func didMoveToWindow() {+ super.didMoveToWindow()+ if window == nil, CindyComposerMorph.current?.id == transitionId { CindyComposerMorph.current?.finish() }+ }+}++/// Invisible touch target over the new-task button. VoiceOver keeps using the+/// real button underneath (its JS onPress opens the page), so it is not an element.+private final class CindyActionShield: UIControl {+ var onPressBegan: (() -> Void)?+ var onPressEnded: ((Bool) -> Void)?+ override init(frame: CGRect) {+ super.init(frame: frame)+ isAccessibilityElement = false+ accessibilityElementsHidden = true+ addTarget(self, action: #selector(began), for: .touchDown)+ addTarget(self, action: #selector(endedInside), for: .touchUpInside)+ addTarget(self, action: #selector(endedOutside), for: [.touchUpOutside, .touchCancel])+ }+ required init?(coder: NSCoder) { fatalError("init(coder:) is not supported") }+ @objc private func began() { onPressBegan?() }+ @objc private func endedInside() { onPressEnded?(true) }+ @objc private func endedOutside() { onPressEnded?(false) }+}diff --git a/apps/mobile/modules/cindy-tab-bar/package.json b/apps/mobile/modules/cindy-tab-bar/package.jsonnew file mode 100644index 0000000000..e7d5243ba0--- /dev/null+++ b/apps/mobile/modules/cindy-tab-bar/package.json@@ -0,0 +1,6 @@+{+ "name": "cindy-tab-bar",+ "version": "0.1.0",+ "private": true,+ "license": "Apache-2.0"+}diff --git a/apps/mobile/scripts/navigation-demo-config.cjs b/apps/mobile/scripts/navigation-demo-config.cjsnew file mode 100644index 0000000000..3d02c48b44--- /dev/null+++ b/apps/mobile/scripts/navigation-demo-config.cjs@@ -0,0 +1,27 @@+// Branch-local trial identity. Never reuse a production installation or OTA feed.+function applyNavigationDemoConfig(config, env = process.env) {+ if (env.EXPO_PUBLIC_CINDY_NAV_DEMO !== '1') return config;+ const region = env.EXPO_PUBLIC_CINDY_AUTH_REGION;+ if (region !== 'global' && region !== 'cn') throw new Error('Navigation demo requires an explicit cn/global region');+ if (env.EXPO_PUBLIC_XDT_OTA_SELFHOST === '1' || env.EAS_PROJECT_ID || env.EAS_BUILD_PROFILE || env.CINDY_USE_LOCAL_REGION_CONFIG === '1') {+ throw new Error('Navigation demo cannot use existing self-host, EAS project or release profiles');+ }+ // Provider callbacks must be provisioned for this separate app before use. Do+ // not let a developer shell accidentally embed the production registrations.+ for (const key of ['EXPO_PUBLIC_CINDY_GOOGLE_IOS_URL_SCHEME', 'EXPO_PUBLIC_CINDY_WECHAT_APP_ID']) {+ if (env[key]?.trim()) throw new Error(`Navigation demo requires separate login provisioning: ${key}`);+ }+ const identity = region === 'cn' ? 'com.xd.cindycn.navdemo' : 'com.xd.cindy.navdemo';+ const scheme = region === 'cn' ? 'cindycnnavdemo' : 'cindynavdemo';+ return {+ ...config,+ name: region === 'cn' ? 'Cindy 导航试用 CN' : 'Cindy Navigation Demo',+ slug: region === 'cn' ? 'cindy-navigation-demo-cn' : 'cindy-navigation-demo',+ scheme,+ ios: { ...config.ios, bundleIdentifier: identity, associatedDomains: [] },+ android: { ...config.android, package: identity, intentFilters: [] },+ updates: { enabled: false, checkAutomatically: 'NEVER' },+ extra: { ...config.extra, navigationDemo: true },+ };+}+module.exports = { applyNavigationDemoConfig };diff --git a/apps/mobile/src/__tests__/CompanionAutomationSheet.test.tsx b/apps/mobile/src/__tests__/CompanionAutomationSheet.test.tsxindex 34d7af4069..548316cdaf 100644--- a/apps/mobile/src/__tests__/CompanionAutomationSheet.test.tsx+++ b/apps/mobile/src/__tests__/CompanionAutomationSheet.test.tsx@@ -34,6 +34,7 @@ vi.mock('@/device-link/remoteResources', () => ({ getRemoteResource: (...args: avi.mock('@/device-link/remoteStatus', () => ({ formatRemoteError: (error: Error) => error.message }));vi.mock('@/theme', () => ({ iconSize: { action: 20, lg: 24, xs: 12 }, spacing: { xs: 4, sm: 8, md: 12 }, useTheme: () => ({ mode: 'light', colors: {} }), useThemedStyles: () => ({}) }));vi.mock('../session/CompanionChoice', () => ({ CompanionChoice: () => null }));+vi.mock('@/platform/chrome/NativeSwitch', () => ({ NativeSwitch: ({ value, onValueChange, disabled }: any) => <input type="checkbox" checked={value} disabled={disabled} onChange={e => onValueChange(e.currentTarget.checked)} /> }));vi.mock('../session/CompanionSheet', () => ({ CompanionSheet: ({ children, footer }: any) => {if (h.platform === 'ios') throw new Error('legacy automation sheet mounted');return <div>{children}{footer}</div>;@@ -43,7 +44,7 @@ vi.mock('../session/ComposerSheet', async () => import('../session/ComposerSheetvi.mock('../session/ComposerNativeSection', () => ({ ComposerNativeSection: ({ title, children }: any) => <section aria-label={title}>{children}</section> }));vi.mock('@expo/ui', () => ({ Host: ({ children }: any) => <div>{children}</div> }));vi.mock('@expo/ui/swift-ui/modifiers', () => ({- ...Object.fromEntries(['accessibilityLabel', 'buttonStyle', 'contentShape', 'disabled', 'font', 'foregroundStyle', 'frame', 'keyboardType', 'lineLimit', 'pickerStyle', 'tag', 'textInputAutocapitalization', 'textSelection', 'padding', 'presentationDetents', 'interactiveDismissDisabled', 'presentationDragIndicator', 'scrollContentBackground'].map(name => [name, (value: any) => ({ name, value })])),+ ...Object.fromEntries(['accessibilityLabel', 'buttonStyle', 'contentShape', 'disabled', 'font', 'foregroundStyle', 'frame', 'keyboardType', 'lineLimit', 'pickerStyle', 'tag', 'textInputAutocapitalization', 'textSelection', 'tint', 'padding', 'presentationDetents', 'interactiveDismissDisabled', 'presentationDragIndicator', 'scrollContentBackground'].map(name => [name, (value: any) => ({ name, value })])),shapes: { rectangle: () => ({}) },}));vi.mock('@expo/ui/swift-ui', () => {diff --git a/apps/mobile/src/__tests__/CompanionHeaderNavigation.test.tsx b/apps/mobile/src/__tests__/CompanionHeaderNavigation.test.tsxindex c3aca34bab..35b62827d1 100644--- a/apps/mobile/src/__tests__/CompanionHeaderNavigation.test.tsx+++ b/apps/mobile/src/__tests__/CompanionHeaderNavigation.test.tsx@@ -9,8 +9,8 @@ import { useHostManagedSession } from '@/session/hostManagedSession';import type { RemoteResource } from '@cindy/device-link';const h = vi.hoisted(() => ({- focused: true, drawer: {} as any, accounts: {} as any, profile: {} as any,- dismiss: vi.fn(), push: vi.fn(), chooseMode: vi.fn(),+ focused: true, drawer: {} as any, accounts: {} as any, profile: {} as any, systemBack: true,+ dismiss: vi.fn(), push: vi.fn(), chooseMode: vi.fn(), replace: vi.fn(),auth: { accountGeneration: 1, user: null, logout: vi.fn(), beginAddAccount: vi.fn() },}));vi.mock('react-native', () => ({@@ -20,7 +20,7 @@ vi.mock('react-native', () => ({StyleSheet: { create: (s: unknown) => s },}));vi.mock('react-i18next', () => ({ useTranslation: () => ({ t: (s: string) => s, i18n: { language: 'en' } }) }));-vi.mock('expo-router', () => ({ useSegments: () => ['sessions', '[sessionId]'] }));+vi.mock('expo-router', () => ({ useSegments: () => ['sessions', '[sessionId]'], useRouter: () => ({ replace: h.replace }) }));vi.mock('expo-router/react-navigation', () => ({useIsFocused: () => h.focused, NavigationContext: createContext(null), NavigationRouteContext: createContext(null),}));@@ -38,6 +38,10 @@ vi.mock('@/theme', async () => {vi.mock('lucide-react-native', () => ({ ChevronDown: () => null, PanelLeft: () => null, Settings2: () => null }));vi.mock('@/session/HomeHeaderGlassButton', () => ({ HomeHeaderGlassButton: ({ onPress, testID, children, disabled }: any) =>createElement('button', { onClick: onPress, disabled, 'data-testid': testID }, children) }));+vi.mock('@/session/CompanionBackButton', () => ({ CompanionBackButton: ({ onPress }: any) =>+ createElement('button', { onClick: onPress, 'data-testid': 'companion.back' }) }));+// Page-level drawer cases run as Duo (system bar owns Back, header keeps the sidebar button).+vi.mock('@/platform/chrome/SystemNavigationBack', () => ({ useSystemNavigationBack: () => h.systemBack, SystemNavigationBack: () => null }));vi.mock('@/session/TeammatePicker', () => ({ TeammatePicker: () => null }));vi.mock('@/session/CompanionProfileSheet', () => ({ CompanionCreateSheet: () => null,CompanionProfileSheet: (props: unknown) => { h.profile = props; return null; } }));@@ -106,6 +110,7 @@ it('preserves search, mode switching, account switching and logout actions', asyawait act(async () => { h.drawer.onOpenAccounts(); h.drawer.onClosed(); }); expect(h.accounts.visible).toBe(true);h.auth.logout.mockResolvedValue(undefined);await act(async () => h.drawer.onLogout()); expect(h.auth.logout).toHaveBeenCalledOnce();+ expect(h.replace).toHaveBeenCalledWith('/login');});it('returns to the roster when the already-active companion mode is selected', async () => {@@ -169,6 +174,7 @@ const compiled = ts.transpileModule(`function PageHost({ bindings }) {const { auth, deviceId, sessionId, companionResource, companionEntry, shareSelectionActive, setSearchOpen } = bindings;const currentSession = null;const deviceName = 'PC', remoteUnavailableReason = null, sessionListDrawerOverlayMounted = false;+ const goBackToHome = bindings.goBackToHome;${statements.slice(stateStart, stateEnd).map(n => n.getText(source)).join('\n')}${relevantJsx(header)}return <div data-testid="page-route"><div data-testid="clipped-chrome">{headerNode}</div>${relevantJsx(overlay)}</div>;@@ -178,12 +184,30 @@ const PageHost = new Function('React', 'useState', 'useHostManagedSession', 'Comconst pageBindings = () => ({ auth: h.auth, deviceId: 'pc', sessionId: 'session-a', shareSelectionActive: false,companionEntry: { ready: true },companionResource: { ref: { kind: 'bot', collectionId: 'bots', id: 'bot-a' }, display: { title: 'Cindy' } } as RemoteResource | null,- setSearchOpen: vi.fn() });+ setSearchOpen: vi.fn(), goBackToHome: vi.fn() });const showPage = (bindings: ReturnType<typeof pageBindings>) => act(async () => {root.render(<RecentMessageHistoriesProvider><PageHost bindings={bindings} /></RecentMessageHistoriesProvider>);});const openPageDrawer = () => act(async () => host.querySelector<HTMLButtonElement>('[data-testid="companion.navigation"]')!.click());+it('shows Back instead of the sidebar button on a phone, and returns to the partner list', async () => {+ h.systemBack = false;+ try {+ const bindings = pageBindings();+ await showPage(bindings);+ expect(host.querySelector('[data-testid="companion.navigation"]')).toBeNull();+ await act(async () => host.querySelector<HTMLButtonElement>('[data-testid="companion.back"]')!.click());+ expect(h.dismiss).toHaveBeenCalled();+ expect(bindings.goBackToHome).toHaveBeenCalledTimes(1);+ } finally { h.systemBack = true; }+});++it('keeps the sidebar button where the system bar already shows Back (Duo)', async () => {+ await showPage(pageBindings());+ expect(host.querySelector('[data-testid="companion.back"]')).toBeNull();+ expect(host.querySelector('[data-testid="companion.navigation"]')).not.toBeNull();+});+it('shows the companion title while profile controls wait for entry validation', async () => {const bindings = pageBindings(); bindings.companionEntry.ready = false;await showPage(bindings);diff --git a/apps/mobile/src/__tests__/CompanionMessageCard.test.tsx b/apps/mobile/src/__tests__/CompanionMessageCard.test.tsxindex a10a47e24f..999a15071e 100644--- a/apps/mobile/src/__tests__/CompanionMessageCard.test.tsx+++ b/apps/mobile/src/__tests__/CompanionMessageCard.test.tsx@@ -38,6 +38,7 @@ vi.mock('react-native', () => ({),StyleSheet: { create: (v: any) => v, hairlineWidth: 1 },}));+vi.mock('@/utils/useGuardedPush', () => ({ useGuardedPush: () => h.push }));vi.mock('expo-router', () => ({useFocusEffect: (cb: () => void) => useEffect(cb, [cb]),useLocalSearchParams: () => ({ deviceId: 'home' }),diff --git a/apps/mobile/src/__tests__/CompanionModelChain.test.tsx b/apps/mobile/src/__tests__/CompanionModelChain.test.tsxindex 1068dbdcf5..44e1279889 100644--- a/apps/mobile/src/__tests__/CompanionModelChain.test.tsx+++ b/apps/mobile/src/__tests__/CompanionModelChain.test.tsx@@ -44,6 +44,7 @@ vi.mock("@/theme", () => ({useTheme: () => ({ colors: {} }),}));vi.mock("@/components/AppText", () => ({ Text: "span" }));+vi.mock("@/platform/chrome/NativeSwitch", () => ({ NativeSwitch: () => null }));vi.mock("@/device-link/useDeviceProviders", () => ({useDeviceProviders: (id: string) => {h.device(id);diff --git a/apps/mobile/src/__tests__/CompanionProfileSheet.test.tsx b/apps/mobile/src/__tests__/CompanionProfileSheet.test.tsxindex b5fc478895..002af96614 100644--- a/apps/mobile/src/__tests__/CompanionProfileSheet.test.tsx+++ b/apps/mobile/src/__tests__/CompanionProfileSheet.test.tsx@@ -14,7 +14,7 @@ vi.mock('@/device-link/remoteResources', () => ({ invokeRemoteResourceAction: (.vi.mock('@/components/AppText', () => ({ Text: 'span', TextInput: 'input' }));vi.mock('@/components/MobilePrimitives', () => ({ MainWindowActionButton: () => null }));vi.mock('@/components/RemoteCompanionAvatar', () => ({ RemoteCompanionAvatar: () => null }));-vi.mock('@/platform/chrome', () => ({ NativePullDownMenu: () => null, usesNativePullDownMenu: () => true }));+vi.mock('@/platform/chrome', () => ({ NativePullDownMenu: () => null, NativeSwitch: () => null, usesNativePullDownMenu: () => true }));vi.mock('@/session/CompanionSettingsRow', () => ({ CompanionSettingsRow: () => null }));vi.mock('@/session/CompanionSheet', () => ({ CompanionSheet: () => null }));vi.mock('@/session/CompanionProfileArtifacts', () => ({ CompanionProfileArtifacts: () => null }));diff --git a/apps/mobile/src/__tests__/SessionMenuContextEntry.test.tsx b/apps/mobile/src/__tests__/SessionMenuContextEntry.test.tsxindex 985632f4f6..0b97590b95 100644--- a/apps/mobile/src/__tests__/SessionMenuContextEntry.test.tsx+++ b/apps/mobile/src/__tests__/SessionMenuContextEntry.test.tsx@@ -38,6 +38,11 @@ vi.mock("react-native", async () => {timing: () => ({ start: (done?: () => void) => done?.() }),},StyleSheet: { create: (value: unknown) => value, hairlineWidth: 1 },+ Easing: { bezier: () => (t: number) => t },+ AccessibilityInfo: {+ isReduceMotionEnabled: () => Promise.resolve(false),+ addEventListener: () => ({ remove() {} }),+ },useWindowDimensions: () => ({ height: 800, width: 400 }),};});@@ -89,7 +94,7 @@ vi.mock("@/session/SheetModal", () => ({vi.mock("@/session/SheetSurface", () => ({SheetSurface: ({ children }: { children: ReactNode }) => children,}));-vi.mock("@/session/messageActions", () => ({ writeClipboardText: vi.fn() }));+vi.mock("@/session/messageActions", () => ({ writeClipboardText: vi.fn(), formatModelShortLabel: (id: string) => id }));it("reopening the primary menu after info does not initialize an engine, but entering info does", async () => {Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true });diff --git a/apps/mobile/src/__tests__/TeammateCreateButton.test.tsx b/apps/mobile/src/__tests__/TeammateCreateButton.test.tsxindex 31f0973da1..500df2707e 100644--- a/apps/mobile/src/__tests__/TeammateCreateButton.test.tsx+++ b/apps/mobile/src/__tests__/TeammateCreateButton.test.tsx@@ -8,7 +8,7 @@ vi.mock('react-i18next', () => ({ useTranslation: () => ({ t: (key: string) => kvi.mock('lucide-react-native', () => ({ Plus: () => null }));vi.mock('@/auth/AuthContext', () => ({ useAuth: () => ({ accountGeneration: h.account }) }));vi.mock('@/theme', () => ({ useTheme: () => ({ colors: {} }) }));-vi.mock('@/components/MobilePrimitives', () => ({ MainWindowActionButton: () => null }));+vi.mock('@/session/CompanionSettingsRow', () => ({ CompanionSettingsRow: (props: any) => createElement('button', { 'data-testid': props.testID, onClick: props.onPress }, props.label) }));vi.mock('@/platform/chrome/NativePullDownMenu', () => ({ usesNativePullDownMenu: () => true, NativePullDownMenu: (props: any) => { h.menu = props; return props.children; } }));vi.mock('@/session/HomeHeaderGlassButton', () => ({ HomeHeaderGlassButton: (props: any) => { h.button = props; return null; } }));vi.mock('@/session/CompanionSheet', () => ({ CompanionSheet: () => null }));@@ -30,7 +30,8 @@ it('uses real menu hosts, prefers the remembered host, and dispatches receipts aawait act(async () => { h.sheet.onClosed(); h.sheet.onClosed(); }); expect(h.created).toHaveBeenCalledExactlyOnceWith(hosts[1], ref);});it('opens the sole capable host, never an empty device', async () => {- await render([]); await act(async () => h.button.onPress()); expect(h.sheet).toBeNull(); expect(h.alert).toHaveBeenCalled();+ await render([]); await act(async () => h.button.onPress()); expect(h.sheet).toBeNull();+ expect(h.alert).toHaveBeenCalledWith('devices.companionProfile.create', 'devices.companions.noCreateHosts');await render([hosts[0]]); await act(async () => h.button.onPress()); expect(h.sheet.deviceId).toBe('mac');});it('fences late native menu and create dismissal callbacks after account replacement', async () => {diff --git a/apps/mobile/src/__tests__/TeammateHomeScreen.test.tsx b/apps/mobile/src/__tests__/TeammateHomeScreen.test.tsxindex ebeae12c16..48c676e647 100644--- a/apps/mobile/src/__tests__/TeammateHomeScreen.test.tsx+++ b/apps/mobile/src/__tests__/TeammateHomeScreen.test.tsx@@ -5,7 +5,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';import type { HomeMode, LastTeammateIdentity } from '@/session/homeViewPreferenceStore';import type { HostedRemoteCollectionItem } from '@/device-link/remoteResources';const h = vi.hoisted(() => ({- realNavigation: false, stored: null as string | null, tasks: {} as any, dismissTo: vi.fn(),+ realNavigation: false, stored: null as string | null, tasks: {} as any, dismissTo: vi.fn(), replace: vi.fn(),focused: true, drawer: {} as any, list: {} as any, accounts: {} as any, push: vi.fn(),auth: { user: { id: 'owner' }, accountGeneration: 1, logout: vi.fn(), beginAddAccount: vi.fn() },nav: { hydrated: true, lastTeammate: null as LastTeammateIdentity | null, mode: 'teammates' as HomeMode,@@ -18,7 +18,7 @@ vi.mock('react-native', async () => {return { View: ({ children }: any) => el('div', {}, children), ActivityIndicator: () => null,Keyboard: { dismiss() {} }, Alert: { alert: vi.fn() }, StyleSheet: { create: (value: unknown) => value } };});-vi.mock('expo-router', () => ({ Stack: { Screen: () => null }, useIsFocused: () => h.focused, useNavigation: () => ({ getState: () => ({ routes: [] }) }), useRouter: () => ({ dismissTo: h.dismissTo }) }));+vi.mock('expo-router', () => ({ Stack: { Screen: () => null }, useIsFocused: () => h.focused, useNavigation: () => ({ getState: () => ({ routes: [] }) }), useRouter: () => ({ dismissTo: h.dismissTo, replace: h.replace }) }));vi.mock('react-native-safe-area-context', () => ({ SafeAreaView: 'div' }));vi.mock('react-i18next', () => ({ useTranslation: () => ({ t: (key: string) => key, i18n: { language: 'en' } }) }));vi.mock('lucide-react-native', () => ({ Menu: () => null }));@@ -102,6 +102,7 @@ describe('teammate home entry', () => {await act(async () => { h.drawer.onOpenAccounts(); h.drawer.onClosed(); }); expect(h.accounts.visible).toBe(true);await act(async () => { h.drawer.onOpenSearch(); h.drawer.onClosed(); }); expect(h.list.autoFocusSearch).toBe(true);h.auth.logout.mockResolvedValue(undefined); await act(async () => h.drawer.onLogout()); expect(h.auth.logout).toHaveBeenCalledOnce();+ expect(h.replace).toHaveBeenCalledWith('/login');});});diff --git a/apps/mobile/src/__tests__/TeammateList.test.tsx b/apps/mobile/src/__tests__/TeammateList.test.tsxindex 3778dd747b..33070ef22b 100644--- a/apps/mobile/src/__tests__/TeammateList.test.tsx+++ b/apps/mobile/src/__tests__/TeammateList.test.tsx@@ -4,17 +4,19 @@ import { createRoot, type Root } from 'react-dom/client';import { afterEach, beforeEach, expect, it, vi } from 'vitest';vi.mock('react-native', () => ({View: ({ children, testID, style }: any) => el('div', { 'data-testid': testID, style: Object.assign({}, ...[style].flat().filter(Boolean)) }, children),- Pressable: ({ children, testID, accessibilityLabel, disabled, onPress }: any) => el('button', { 'data-testid': testID, 'aria-label': accessibilityLabel, disabled, onClick: onPress }, children),+ Pressable: ({ children, testID, accessibilityLabel, accessibilityState, disabled, onPress }: any) => el('button', { 'data-testid': testID, 'aria-label': accessibilityLabel, 'aria-selected': accessibilityState?.selected, disabled, onClick: onPress }, children),ActivityIndicator: () => null, RefreshControl: () => null,StyleSheet: { create: (v: unknown) => v, hairlineWidth: 1 },FlatList: ({ ListHeaderComponent, ListEmptyComponent, data, renderItem }: any) => el('div', null, ListHeaderComponent, data.length ? data.map((item: any) => renderItem({ item })) : ListEmptyComponent),}));vi.mock('@/device-link/DeviceLinkContext', () => ({ useDeviceLink: () => ({ invoke: async () => ({ blocks: [] }) }) }));vi.mock('@/session/remoteSessionStore', () => ({ remoteSessionStore: {} }));-vi.mock('@/components/AppText', () => ({ Text: ({ children }: any) => el('span', null, children), TextInput: () => null }));-vi.mock('@/components/MobilePrimitives', () => ({ MainWindowEmptyState: ({ title, copy }: any) => el('div', null, title, copy) }));+vi.mock('@/components/AppText', () => ({ Text: ({ children }: any) => el('span', null, children), TextInput: ({ testID, autoFocus }: any) => el('input', { 'data-testid': testID, 'data-autofocus': String(autoFocus) }) }));+vi.mock('@/components/MobilePrimitives', () => ({ MainWindowEmptyState: ({ title, copy }: any) => el('div', null, title, copy),+ RemoteListSyncingPlaceholder: ({ testID }: any) => el('div', { 'data-testid': testID }),+ StatusDot: ({ tone }: any) => el('i', { 'data-testid': 'status-dot', 'data-tone': tone }) }));vi.mock('@/components/RemoteCompanionAvatar', () => ({ RemoteCompanionAvatar: () => null }));-vi.mock('lucide-react-native', () => ({ RefreshCw: () => null, TriangleAlert: ({ testID, accessibilityLabel }: any) => el('i', { 'data-testid': testID, 'aria-label': accessibilityLabel }) }));+vi.mock('lucide-react-native', () => ({ RefreshCw: () => null, Search: () => null, X: () => null, TriangleAlert: ({ testID, accessibilityLabel }: any) => el('i', { 'data-testid': testID, 'aria-label': accessibilityLabel }) }));vi.mock('react-i18next', () => ({ useTranslation: () => ({ t: (key: string) => key, i18n: { language: 'en' } }) }));vi.mock('@/i18n', () => ({ i18n: { t: (key: string) => key } }));vi.mock('@/auth/AuthContext', () => ({ useAuth: () => ({ user: { id: 'owner' } }) }));@@ -30,6 +32,15 @@ const item = { key: 'host:bot', host: { deviceId: 'host', deviceName: 'Computerlet root: Root; let node: HTMLDivElement;beforeEach(() => { Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true }); node = document.createElement('div'); root = createRoot(node); });afterEach(async () => { await act(async () => root.unmount()); });+it('highlights the current identity only in the picker, not on the single-column home list', async () => {+ const current = { deviceId: 'host', collectionId: 'teammates', resourceKind: 'bot' as const, resourceId: 'bot' };+ const selected = () => node.querySelector('[data-testid="teammates.item.host.bot"]')?.getAttribute('aria-selected');+ const props = { items: [item], error: null, isOnline: () => true, loading: false, refreshing: false, onRefresh: vi.fn(), onSelect: vi.fn(), current };+ await act(async () => root.render(el(TeammateList, props)));+ expect(selected()).toBe('false');+ await act(async () => root.render(el(TeammateList, { ...props, embedded: true })));+ expect(selected()).toBe('true');+});async function render(error: string | null, online = true) {await act(async () => root.render(el(TeammateList, { items: [item], error, isOnline: () => online, loading: false, refreshing: false, onRefresh: vi.fn(), onSelect: vi.fn(), embedded: true })));}@@ -64,12 +75,12 @@ it('shows shared public generation instead of raw preview without changing onlinloading: false, refreshing: false, onRefresh: vi.fn(), onSelect: vi.fn(), embedded: true })));expect(node.textContent).toContain('devices.companions.working.replying');expect(node.textContent).not.toContain('Raw tool commentary');- expect((node.querySelector('[data-testid="teammate.connection"]') as HTMLElement).style.backgroundColor).toBe('green');+ expect(node.querySelector('[data-testid="teammate.connection"] [data-testid="status-dot"]')?.getAttribute('data-tone')).toBe('ready');await render(null, false);- expect((node.querySelector('[data-testid="teammate.connection"]') as HTMLElement).style.backgroundColor).toBe('red');+ expect(node.querySelector('[data-testid="teammate.connection"] [data-testid="status-dot"]')?.getAttribute('data-tone')).toBe('off');expect(node.textContent).not.toContain('devices.companions.working.replying');await render('Model error', true);- expect((node.querySelector('[data-testid="teammate.connection"]') as HTMLElement).style.backgroundColor).toBe('green');+ expect(node.querySelector('[data-testid="teammate.connection"] [data-testid="status-dot"]')?.getAttribute('data-tone')).toBe('ready');});it('keeps the connection green when the list cannot be used, and unknown neutral', async () => {@@ -77,11 +88,11 @@ it('keeps the connection green when the list cannot be used, and unknown neutralawait act(async () => root.render(el(TeammateList, { items: [item], error: 'API failed', isOnline: () => false,connectionState: () => connected, loading: false, refreshing: false, onRefresh: vi.fn(), onSelect: vi.fn(), embedded: true })));expect(node.textContent).not.toContain('devices.resources.hostOffline');- const dot = node.querySelector('[data-testid="teammate.connection"]') as HTMLElement;- expect(dot.style.backgroundColor).not.toBe('red');- if (connected) expect(dot.style.backgroundColor).toBe('green');+ const tone = node.querySelector('[data-testid="teammate.connection"] [data-testid="status-dot"]')?.getAttribute('data-tone');+ expect(tone).not.toBe('off');+ if (connected) expect(tone).toBe('ready');else {- expect(dot.style.backgroundColor).toBe('gray');+ expect(tone).toBe('muted');expect(node.textContent).toContain('devices.resources.connectionUnknown');}}diff --git a/apps/mobile/src/__tests__/collaboration.test.ts b/apps/mobile/src/__tests__/collaboration.test.tsindex 723a3bbbae..45d7f3663f 100644--- a/apps/mobile/src/__tests__/collaboration.test.ts+++ b/apps/mobile/src/__tests__/collaboration.test.ts@@ -48,7 +48,7 @@ describe('mobile collaboration session fallback', () => {expect(sessionCollaborationNotice(worker)).toContain('发送消息');expect(sessionCollaborationNotice(worker)).toContain('切换 Worker 焦点');expect(isCollaborationSession(lead)).toBe(true);- expect(sessionCollaborationReadOnlyReason(worker)).toContain('只读');+ expect(sessionCollaborationReadOnlyReason(worker)).toContain('只能查看');});it('lets Lead compose messages while keeping worker composer read-only', () => {@@ -58,8 +58,8 @@ describe('mobile collaboration session fallback', () => {// composer 只读:Lead 可发消息(null),worker / 其它角色只读(非空)。expect(sessionCollaborationComposerReadOnlyReason(lead)).toBeNull();- expect(sessionCollaborationComposerReadOnlyReason(worker)).toContain('只读');- expect(sessionCollaborationComposerReadOnlyReason(custom)).toContain('只读');+ expect(sessionCollaborationComposerReadOnlyReason(worker)).toContain('只能查看');+ expect(sessionCollaborationComposerReadOnlyReason(custom)).toContain('只能查看');expect(sessionCollaborationComposerReadOnlyReason(session({ orcaRole: null }))).toBeNull();// 但写编排只读对 Lead 仍生效(fork/rewind/队列/设置仍留电脑端)。@@ -70,8 +70,8 @@ describe('mobile collaboration session fallback', () => {const custom = session({ orcaRole: 'reviewer' });expect(sessionCollaborationLabel(custom)).toBe('协同 reviewer');- expect(sessionCollaborationNotice(custom)).toContain('协同编排操作请在电脑端完成');- expect(sessionCollaborationReadOnlyReason(custom)).toContain('任务修改请在电脑端完成');+ expect(sessionCollaborationNotice(custom)).toContain('协同编排请在电脑端操作');+ expect(sessionCollaborationReadOnlyReason(custom)).toContain('修改任务,请在电脑端操作');expect(sessionCollaborationLabel(session({ orcaRole: null }))).toBeNull();expect(isCollaborationSession(session({ orcaRole: null }))).toBe(false);expect(sessionCollaborationReadOnlyReason(session({ orcaRole: null }))).toBeNull();diff --git a/apps/mobile/src/__tests__/composerGeometry.test.ts b/apps/mobile/src/__tests__/composerGeometry.test.tsnew file mode 100644index 0000000000..5cff0195a0--- /dev/null+++ b/apps/mobile/src/__tests__/composerGeometry.test.ts@@ -0,0 +1,31 @@+import { describe, expect, it } from 'vitest';+import { composerBottomContentPadding, composerGeometry, composerPillHeight, composerRestingBottom } from '@/session/composerGeometry';++const source = { id: 'entry', x: 326, y: 776, width: 56, height: 56, windowWidth: 402, windowHeight: 874 };+describe('shared composer bottom edge', () => {+ it('uses the actual source button edge, including a different safe area', () => {+ expect(composerRestingBottom(source, 402, 874, 34)).toBe(42);+ expect(874 - composerRestingBottom(source, 402, 874, 0)).toBe(source.y + source.height);+ });+ it('does not reuse portrait coordinates after folding or rotating', () => {+ expect(composerRestingBottom(source, 874, 402, 21)).toBe(29);+ expect(composerRestingBottom({ ...source, y: 900 }, 402, 874, 34)).toBe(42);+ });+ it('accounts for keyboard lift and existing composer padding exactly once', () => {+ const keyboard = 320, safeArea = 34, innerPadding = 4, gap = 8;+ const layerBottom = keyboard - safeArea;+ const content = composerBottomContentPadding(keyboard + gap, layerBottom, innerPadding);+ expect(layerBottom + content + innerPadding).toBe(keyboard + gap);+ const resting = composerBottomContentPadding(42, 0, innerPadding);+ expect(resting + innerPadding).toBe(42);+ });+ it('sizes the compact pill to the button only for the same window', () => {+ expect(composerPillHeight(source, 402, 874)).toBe(56);+ // Without a usable button frame the pill keeps the shared button size.+ expect(composerPillHeight(source, 874, 402)).toBe(composerGeometry.pillHeight);+ expect(composerPillHeight(null, 402, 874)).toBe(composerGeometry.pillHeight);+ });+ it('never makes negative padding when a reserved region already lifts the composer', () => {+ expect(composerBottomContentPadding(42, 80, 4)).toBe(0);+ });+});diff --git a/apps/mobile/src/__tests__/composerVoiceStartupFeedback.test.ts b/apps/mobile/src/__tests__/composerVoiceStartupFeedback.test.tsindex a748717497..3107587906 100644--- a/apps/mobile/src/__tests__/composerVoiceStartupFeedback.test.ts+++ b/apps/mobile/src/__tests__/composerVoiceStartupFeedback.test.ts@@ -45,6 +45,8 @@ function readCallbacks(page: string) {const canUseComposer = true;const composerFocused = false, firstMessageInputFocused = false;const modelSheetOpen = false, permissionSheetOpen = false, composerVoiceHoldActive = false;+ // 收起胶囊点开的过渡期(useComposerPillOpen)不在本用例范围:语音按下前后都未点胶囊。+ const composerPillOpen = { opening: false };return ${cardActive};} };`,{ compilerOptions: { target: ts.ScriptTarget.ES2022 } },diff --git a/apps/mobile/src/__tests__/fixtures/theme-colors-snapshot.json b/apps/mobile/src/__tests__/fixtures/theme-colors-snapshot.jsonindex 1f4a68505e..729916f019 100644--- a/apps/mobile/src/__tests__/fixtures/theme-colors-snapshot.json+++ b/apps/mobile/src/__tests__/fixtures/theme-colors-snapshot.json@@ -3,6 +3,7 @@"light": {"surface": "#F9F9F6","surfaceElevated": "#FFFFFC",+ "homeDrawerShadow": "rgba(0, 0, 0, 0.16)","surfaceTranslucent": "rgba(249, 249, 246, 0.78)","surfaceTranslucentSidebar": "rgba(255, 255, 252, 0.90)","chatHeaderSurface": "rgba(249, 249, 246, 0.90)",@@ -122,6 +123,7 @@"dark": {"surface": "#121212","surfaceElevated": "#1E1E1E",+ "homeDrawerShadow": "rgba(0, 0, 0, 0.40)","surfaceTranslucent": "rgba(18, 18, 18, 0.78)","surfaceTranslucentSidebar": "rgba(10, 10, 10, 0.85)","chatHeaderSurface": "rgba(18, 18, 18, 0.80)",diff --git a/apps/mobile/src/__tests__/fullAccessConfirmation.test.ts b/apps/mobile/src/__tests__/fullAccessConfirmation.test.tsindex 90d02196b4..87d10a00b9 100644--- a/apps/mobile/src/__tests__/fullAccessConfirmation.test.ts+++ b/apps/mobile/src/__tests__/fullAccessConfirmation.test.ts@@ -19,16 +19,16 @@ function confirmingAlert() {describe("getFullAccessConfirmationCopy", () => {it("selects the supported system language and falls back to English", () => {expect(getFullAccessConfirmationCopy("ja").confirm).toBe(- "Full access を有効にする",+ "フルアクセスを有効にする",);expect(getFullAccessConfirmationCopy("ko-KR").cancel).toBe("현재 권한 유지",);expect(getFullAccessConfirmationCopy("zh-Hans-CN").title).toBe(- "开启 Full access?",+ "开启完全访问?",);expect(getFullAccessConfirmationCopy("zh-Hant-TW").title).toBe(- "開啟 Full access?",+ "開啟完全訪問?",);expect(getFullAccessConfirmationCopy("fr").title).toBe("Enable Full access?",diff --git a/apps/mobile/src/__tests__/homeChromeDrawer.test.tsx b/apps/mobile/src/__tests__/homeChromeDrawer.test.tsxnew file mode 100644index 0000000000..6ec9922deb--- /dev/null+++ b/apps/mobile/src/__tests__/homeChromeDrawer.test.tsx@@ -0,0 +1,159 @@+// @vitest-environment jsdom+import { act, type ReactNode } from 'react';+import { createRoot, type Root } from 'react-dom/client';+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';+import { HomeChromeDrawer } from '@/session/HomeChromeDrawer';++type GestureEvent = { translationX: number; velocityX: number };+const driver = vi.hoisted(() => ({+ reduceMotion: false as boolean | null,+ layout: undefined as (() => void) | undefined,+ gestures: {} as Record<string, (event: GestureEvent, success: boolean) => void>,+ values: [] as Array<{ value: number | boolean }>,+ animations: [] as Array<{ to: number; complete?: (finished: boolean) => void }>,+}));+vi.mock('react-i18next', () => ({ useTranslation: () => ({ t: (key: string) => key }) }));+vi.mock('react-native', async () => {+ const { createElement } = await import('react');+ const View = ({ children, testID, onLayout, onPress }: {+ children?: ReactNode; testID?: string; onLayout?: () => void; onPress?: () => void;+ }) => {+ if (testID === 'home.chromeMenu.panel') driver.layout = onLayout;+ return createElement('div', { 'data-testid': testID, onClick: onPress }, children);+ };+ return {+ View, Pressable: View,+ Image: ({ source }: { source: { uri: string } }) => createElement('img', { src: source.uri }),+ AccessibilityInfo: { setAccessibilityFocus: vi.fn() },+ BackHandler: { addEventListener: () => ({ remove() {} }) },+ findNodeHandle: () => null,+ Platform: { OS: 'ios' },+ StyleSheet: { create: (value: unknown) => value, absoluteFill: {}, hairlineWidth: 1 },+ useWindowDimensions: () => ({ width: 390, height: 844 }),+ };+});+vi.mock('react-native-reanimated', async () => {+ const { useRef } = await import('react');+ const { View } = await import('react-native');+ return {+ default: { View },+ useSharedValue: (value: number | boolean) => {+ const ref = useRef<{ value: number | boolean } | null>(null);+ if (!ref.current) { ref.current = { value }; driver.values.push(ref.current); }+ return ref.current;+ },+ useAnimatedStyle: () => ({}),+ Easing: { bezier: () => undefined },+ cancelAnimation: vi.fn(),+ runOnJS: (fn: unknown) => fn,+ runOnUI: (fn: unknown) => fn,+ withTiming: (to: number, _config: unknown, complete?: (finished: boolean) => void) => {+ driver.animations.push({ to, complete });+ return to;+ },+ };+});+vi.mock('@/platform/gestureHandler', async () => {+ const { View } = await import('react-native');+ return {+ GestureHandlerRootView: View,+ GestureDetector: ({ children }: { children: ReactNode }) => children,+ Gesture: { Pan: () => {+ const chain: Record<string, (...args: any[]) => unknown> = {};+ for (const name of ['enabled', 'activeOffsetX', 'failOffsetX', 'failOffsetY']) chain[name] = () => chain;+ for (const name of ['onStart', 'onUpdate', 'onEnd', 'onFinalize']) {+ chain[name] = callback => { driver.gestures[name] = callback; return chain; };+ }+ return chain;+ } },+ };+});+vi.mock('react-native-screens', () => ({ FullWindowOverlay: ({ children }: { children: ReactNode }) => children }));+vi.mock('react-native-safe-area-context', () => ({ useSafeAreaInsets: () => ({ left: 0, top: 0, bottom: 0 }) }));+vi.mock('lucide-react-native', () => Object.fromEntries(+ ['Building2', 'LogOut', 'Monitor', 'Search', 'Settings', 'UsersRound'].map(name => [name, () => null]),+));+vi.mock('@/components/AppText', async () => ({ Text: (await import('react-native')).View }));+vi.mock('@/theme', () => ({ useThemedStyles: () => ({}), useTheme: () => ({ colors: {} }) }));+vi.mock('@/hooks/useReduceMotion', () => ({ useReduceMotionEnabled: () => driver.reduceMotion }));+vi.mock('@/session/HomeModeSwitch', () => ({ HomeModeSwitch: () => null }));++describe('home navigation drawer', () => {+ let root: Root;+ let container: HTMLDivElement;+ const props = {+ open: true, onClose: vi.fn(), onClosed: vi.fn(), onOpenSearch: vi.fn(),+ onOpenAccounts: vi.fn(), onOpenDevices: vi.fn(), onOpenSettings: vi.fn(), onLogout: vi.fn(),+ user: { name: 'Kiro', email: '[email protected]', membershipKind: 'org' as const,+ orgName: 'Example Company', orgLogoUrl: 'https://example.com/org.png', avatar: 'https://example.com/person.png' },+ };+ beforeEach(() => {+ Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true });+ vi.clearAllMocks();+ driver.reduceMotion = false; driver.layout = undefined;+ driver.values = []; driver.animations = []; driver.gestures = {};+ container = document.createElement('div'); document.body.appendChild(container);+ root = createRoot(container);+ });+ afterEach(async () => { await act(async () => root.unmount()); container.remove(); });+ const layout = async () => { await act(async () => driver.layout?.()); };+ const gesture = (name: string, translationX = 0, velocityX = 0, success = true) =>+ driver.gestures[name]({ translationX, velocityX }, success);++ it('keeps the user first with a default letter avatar and only a small organization image', async () => {+ await act(async () => root.render(<HomeChromeDrawer {...props} />));+ const account = container.querySelector('[data-testid="home.chromeDrawer.account"]')!;+ expect(account.textContent).toBe('[email protected] Company');+ expect([...account.querySelectorAll('img')].map(image => image.src)).toEqual([props.user.orgLogoUrl]);+ await act(async () => root.render(<HomeChromeDrawer {...props} user={{ ...props.user, membershipKind: 'personal' }} />));+ expect(account.textContent).not.toContain('Example Company');+ expect(account.querySelector('img')).toBeNull();+ });++ it('waits for native layout before entrance and ignores stale close completion after reopening', async () => {+ await act(async () => root.render(<HomeChromeDrawer {...props} />));+ expect(driver.animations).toHaveLength(0);+ expect(driver.values[0].value).toBe(0);+ await layout();+ expect(driver.animations.at(-1)?.to).toBe(1);+ await act(async () => root.render(<HomeChromeDrawer {...props} open={false} />));+ const closing = driver.animations.at(-1)!;+ expect(closing.to).toBe(0);+ expect(props.onClosed).not.toHaveBeenCalled();+ await act(async () => root.render(<HomeChromeDrawer {...props} />));+ await act(async () => closing.complete?.(true));+ expect(container.querySelector('[data-testid="home.chromeDrawer"]')).not.toBeNull();+ expect(props.onClosed).not.toHaveBeenCalled();+ await act(async () => root.render(<HomeChromeDrawer {...props} open={false} />));+ await act(async () => driver.animations.at(-1)?.complete?.(true));+ expect(container.querySelector('[data-testid="home.chromeDrawer"]')).toBeNull();+ expect(props.onClosed).toHaveBeenCalledOnce();+ });++ it('tracks interrupted entrance from its current position and recovers cancelled drags', async () => {+ await act(async () => root.render(<HomeChromeDrawer {...props} />));+ await layout();+ driver.values[0].value = 0.75;+ gesture('onStart'); gesture('onUpdate', -32);+ expect(driver.values[0].value).toBeCloseTo(0.65);+ gesture('onFinalize', 0, 0, false);+ expect(driver.values[0].value).toBe(1);+ const count = driver.animations.length;+ gesture('onFinalize', 0, 0, false);+ expect(driver.animations).toHaveLength(count);+ gesture('onStart'); gesture('onUpdate', -160); gesture('onEnd', -160);+ expect(props.onClose).toHaveBeenCalledOnce();+ });++ it.each([true, null])('does not animate opening, snap-back or closing when reduce motion is %s', async reduceMotion => {+ driver.reduceMotion = reduceMotion;+ await act(async () => root.render(<HomeChromeDrawer {...props} />));+ await layout();+ gesture('onStart'); gesture('onUpdate', -16); gesture('onEnd', -16);+ expect(driver.values[0].value).toBe(1);+ await act(async () => root.render(<HomeChromeDrawer {...props} open={false} />));+ expect(driver.animations).toHaveLength(0);+ expect(props.onClosed).toHaveBeenCalledOnce();+ expect(container.querySelector('[data-testid="home.chromeDrawer"]')).toBeNull();+ });+});diff --git a/apps/mobile/src/__tests__/homeDesktopFirst.test.ts b/apps/mobile/src/__tests__/homeDesktopFirst.test.tsindex 235d49d1cf..d20d1e96bd 100644--- a/apps/mobile/src/__tests__/homeDesktopFirst.test.ts+++ b/apps/mobile/src/__tests__/homeDesktopFirst.test.ts@@ -294,10 +294,12 @@ describe('mobile home desktop-first surface', () => {expect(source).toContain('<HomeHeaderGlassButton');const floatingAction = readSource('src/session/HomeNewTaskButton.tsx');expect(source).toContain('<HomeNewTaskButton');- expect(floatingAction).toContain('prominent size={HOME_NEW_TASK_SIZE} artworkSize={iconSize.xxl}');+ expect(floatingAction).toContain('prominent={!glass} size={HOME_NEW_TASK_SIZE} artworkSize={iconSize.xxl}');// Preserve SquarePen artwork while adopting the shared native action size.expect(floatingAction).toContain('SquarePen');- expect(floatingAction).toContain('<SquarePen color={colors.ctaText} size={iconSize.xxl} strokeWidth={iconStroke.regular} />');+ // Untinted system glass with a primary icon; the solid filled circle is only the no-glass fallback.+ expect(floatingAction).toContain('<SquarePen color={glass ? colors.textPrimary : colors.ctaText} size={iconSize.xxl} strokeWidth={iconStroke.regular} />');+ expect(floatingAction).toContain('prominent={!glass}');expect(source).not.toContain('<Send');expect(source).not.toContain('function HomeNewChatGlyph');expect(source).not.toContain("import Svg, { Path } from 'react-native-svg';");@@ -307,8 +309,10 @@ describe('mobile home desktop-first surface', () => {expect(source).toContain('fontWeight: fontWeight.medium');expect(floatingAction).toContain('testID="home.newChatButton"');expect(floatingAction).toContain("position: 'absolute'");- expect(floatingAction).toContain('bottom: 45 + bottomInset');- expect(floatingAction).toContain('right: 20');+ // The button sits on the composer's resting line so the circle can stretch into the pill.+ expect(floatingAction).toContain('bottom: bottomInset + composerGeometry.restingGap');+ expect(floatingAction).toContain('right: composerGeometry.horizontalInset');+ expect(floatingAction).toContain('HOME_NEW_TASK_SIZE = composerGeometry.pillHeight');});it('opens desktop-parity search filters from the search sliders, not display settings', () => {diff --git a/apps/mobile/src/__tests__/inputProjection.test.ts b/apps/mobile/src/__tests__/inputProjection.test.tsindex a03be3cc6e..aeea655abc 100644--- a/apps/mobile/src/__tests__/inputProjection.test.ts+++ b/apps/mobile/src/__tests__/inputProjection.test.ts@@ -483,7 +483,7 @@ describe('inputProjection', () => {queueExpanded: false,queuePaused: false,})).toMatchObject({- detail: '4 条消息 · 按桌面端顺序发送',+ detail: '4 条消息 · 按电脑端顺序发送',hiddenCount: 1,hint: '可调整顺序、插话、编辑或删除普通队列消息。',title: '待发送队列',@@ -499,7 +499,7 @@ describe('inputProjection', () => {queuePaused: true,})).toMatchObject({detail: '2 条消息等待恢复',- hint: '点“继续”后会按当前顺序继续发送到桌面端。',+ hint: '点「继续」后会按当前顺序继续发送到电脑端。',title: '队列已暂停',});@@ -511,7 +511,7 @@ describe('inputProjection', () => {queueExpanded: false,queuePaused: false,})).toMatchObject({- detail: '等待桌面端确认停止',+ detail: '等待电脑端确认停止',title: '停止处理中',visibleCount: 0,});@@ -589,7 +589,7 @@ describe('inputProjection', () => {},queueLength: projection.pendingQueue.length,});- expect(locked.hint).toBe('这条消息正在编辑中,桌面端会暂停自动发送。');+ expect(locked.hint).toBe('这条消息正在编辑中,电脑端会暂停自动发送。');expect(locked.actions.edit.disabledReason).toBe('这条队列消息正在编辑中,完成后再操作。');});diff --git a/apps/mobile/src/__tests__/iosChromeActionMenu.test.ts b/apps/mobile/src/__tests__/iosChromeActionMenu.test.tsindex 93ccf694ef..df5f546c11 100644--- a/apps/mobile/src/__tests__/iosChromeActionMenu.test.ts+++ b/apps/mobile/src/__tests__/iosChromeActionMenu.test.ts@@ -168,8 +168,10 @@ describe("iOS chrome presenters stay on the system menu path", () => {expect(settings).toContain('titleTestID="settings.title"');expect(settings).toContain("<SimpleStackHeader");expect(settings).not.toContain("ScreenHeader");- expect(settings).toContain('backTestID="settings.voiceDictionary.backButton"');- expect(settings).toContain('backTestID="settings.renameSelfDevice.backButton"');+ expect(readTextLf(resolve(process.cwd(), "app/settings/voice-dictionary.tsx"), "utf8"))+ .toContain('backTestID="settings.voiceDictionary.backButton"');+ expect(readTextLf(resolve(process.cwd(), "app/settings/device-name.tsx"), "utf8"))+ .toContain('backTestID="settings.renameSelfDevice.backButton"');expect(accountDeletion).toContain("<SimpleStackHeader");expect(accountDeletion).toContain('backTestID="accountDeletion.backButton"',diff --git a/apps/mobile/src/__tests__/messageNormalize.test.ts b/apps/mobile/src/__tests__/messageNormalize.test.tsindex f7a2412c2c..2de1b906fa 100644--- a/apps/mobile/src/__tests__/messageNormalize.test.ts+++ b/apps/mobile/src/__tests__/messageNormalize.test.ts@@ -542,9 +542,9 @@ describe('normalizeRemoteMessages', () => {}),]);- expect(item.secondaryBody).toBe('Full tool output was released (original size 128 KB)');+ expect(item.secondaryBody).toBe('已精简完整工具输出(原始大小 128 KB)');expect(buildMobileMessageCopyText(item)).toContain(- 'Full tool output was released (original size 128 KB)',+ '已精简完整工具输出(原始大小 128 KB)',);expect(buildMobileMessageCopyText(item)).not.toContain('tool_result_compacted');});diff --git a/apps/mobile/src/__tests__/messagePayload.test.ts b/apps/mobile/src/__tests__/messagePayload.test.tsindex a9d6eca814..617f8ba5e1 100644--- a/apps/mobile/src/__tests__/messagePayload.test.ts+++ b/apps/mobile/src/__tests__/messagePayload.test.ts@@ -218,9 +218,9 @@ describe('messagePayload', () => {};expect(formatMediaActionNotice(media)).toBe([- '桌面端为这个媒体提供了后续操作。',+ '电脑端为这个媒体提供了后续操作。','可用操作:U1 / V2',- '手机版 V1 只安全展示这些操作,暂不远程触发。请回到电脑端点击。',+ '手机上暂时只能查看这些操作,请在电脑端操作。',].join('\n'));expect(buildMediaPayload(media, 'a.png').body).toContain('可用操作:U1 / V2');});diff --git a/apps/mobile/src/__tests__/mobileAuthServerLogin.test.ts b/apps/mobile/src/__tests__/mobileAuthServerLogin.test.tsindex 90e4d55d9d..f6b82bbf83 100644--- a/apps/mobile/src/__tests__/mobileAuthServerLogin.test.ts+++ b/apps/mobile/src/__tests__/mobileAuthServerLogin.test.ts@@ -768,10 +768,13 @@ describe('mobile auth-server login', () => {resolve(process.cwd(), 'src/session/AccountSwitcherSheet.tsx'),'utf8',);- expect(sheetSource).toContain('disabled={switchingKey !== null}');- expect(sheetSource).not.toContain(- 'disabled={auth.accountsLoading || switchingKey !== null}',+ // 「添加账号」改用共享 MainWindowActionButton(action 对象传 disabled):只在切换账号时禁用,+ // 不因后台同步 savedAccounts(accountsLoading)而阻塞。+ expect(sheetSource).toMatch(+ /testID: 'accountSwitcher\.addAccount'/,);+ expect(sheetSource).toContain('disabled: switchingKey !== null,');+ expect(sheetSource).not.toMatch(/disabled[=:]\s*\{?auth\.accountsLoading/);expect(sheetSource).toContain("t('devices.list.alert.actionFailed')");expect(sheetSource).toContain('formatRemoteError(error)');expect(sheetSource).not.toContain('.catch(() => undefined)\n .finally');diff --git a/apps/mobile/src/__tests__/mobileBackButton.test.ts b/apps/mobile/src/__tests__/mobileBackButton.test.tsindex 002d71f7f7..f9720f52f0 100644--- a/apps/mobile/src/__tests__/mobileBackButton.test.ts+++ b/apps/mobile/src/__tests__/mobileBackButton.test.ts@@ -22,8 +22,10 @@ describe('mobile top-level back buttons', () => {expect(backButtonStyle).not.toContain('borderColor');expect(backButtonStyle).not.toContain('borderWidth');expect(backButtonStyle).toContain('borderRadius: radius.pill');- expect(backButtonStyle).toContain('height: 44');- expect(backButtonStyle).toContain('width: 44');+ // 尺寸收拢为具名常量 BACK_BUTTON_SIZE,仍是 44×44。+ expect(primitives).toContain('const BACK_BUTTON_SIZE = 44;');+ expect(backButtonStyle).toContain('height: BACK_BUTTON_SIZE');+ expect(backButtonStyle).toContain('width: BACK_BUTTON_SIZE');expect(backButtonStyle).toContain('marginLeft: -spacing.sm');// chevron 与头部右侧 action 图标同档 20(用户定稿 2026-07-21,取代换肤期 md/medium)。expect(primitives).toContain('<ChevronLeft color={colors.textPrimary} size={iconSize.action} strokeWidth={iconStroke.regular} />');diff --git a/apps/mobile/src/__tests__/mobileRealtimeAsrProvider.test.ts b/apps/mobile/src/__tests__/mobileRealtimeAsrProvider.test.tsindex 0d1698e757..23dfbccd4a 100644--- a/apps/mobile/src/__tests__/mobileRealtimeAsrProvider.test.ts+++ b/apps/mobile/src/__tests__/mobileRealtimeAsrProvider.test.ts@@ -880,7 +880,7 @@ describe('mobileRealtimeAsrProvider', () => {reason: 'Received bad response code from server: 403.',});- await expect(started).rejects.toThrow('Cindy 语音会话已失效或没有权限(WebSocket 403)。请确认登录状态后重试。');+ await expect(started).rejects.toThrow('Cindy 语音服务的登录已失效或没有权限,请确认登录状态后重试(状态码 403)。');});it('redacts the synced voice key from Volcengine websocket errors', async () => {diff --git a/apps/mobile/src/__tests__/mobileSettings.test.ts b/apps/mobile/src/__tests__/mobileSettings.test.tsindex 9b340d8793..0ec769700b 100644--- a/apps/mobile/src/__tests__/mobileSettings.test.ts+++ b/apps/mobile/src/__tests__/mobileSettings.test.ts@@ -201,66 +201,59 @@ describe('mobile settings overview', () => {expect(relayStatusTone('stopped')).toBe('off');});- it('lets users rename this phone through the authoritative device-link device name', () => {- const source = readTextLf(resolve(process.cwd(), 'app/settings.tsx'), 'utf8');- const inFlightQueueIndex = source.indexOf('if (selfDeviceNameWriteInFlightRef.current) {');- const sameNameNoopIndex = source.indexOf('if (name === deviceName.trim()) {');+ it('lets users rename this phone on a real stack page with an explicit save (back discards)', () => {+ const settings = readTextLf(resolve(process.cwd(), 'app/settings.tsx'), 'utf8');+ const directory = readTextLf(resolve(process.cwd(), 'src/session/settingsDeviceDirectory.ts'), 'utf8');+ const editor = readTextLf(resolve(process.cwd(), 'app/settings/device-name.tsx'), 'utf8');++ // 设置页只负责入口:子页是独立路由,系统返回只退回设置。+ expect(settings).toContain('testID="settings.selfDeviceNameRow"');+ expect(settings).toContain("push('/settings/device-name')");+ expect(settings).not.toContain('function RenameSelfDeviceScreen');+ expect(settings).not.toContain('selfDeviceNameEditing');+ // 名称正本仍是 device-link 设备清单。+ expect(directory).toContain("auth.apiFetch<{ devices: DeviceView[] }>('/api/device-link/devices'");+ expect(directory).toContain('const self = res.devices.find((device) => device.deviceId === selfDeviceId);');+ expect(directory).toContain('export function publishSelfDeviceName');- expect(source).toContain('const [selfDeviceName, setSelfDeviceName]');- expect(source).toContain("auth.apiFetch<{ devices: DeviceView[] }>('/api/device-link/devices'");- expect(source).toContain('const self = res.devices.find((device) => device.deviceId === auth.deviceId);');- expect(source).toContain('testID="settings.selfDeviceNameRow"');- expect(source).toContain('function RenameSelfDeviceScreen');- expect(source).toContain('testID="settings.renameSelfDevice.screen"');- expect(source).toContain('backTestID="settings.renameSelfDevice.backButton"');- expect(source).toContain('testID="settings.renameSelfDevice.input"');- expect(source).toContain('testID="settings.renameSelfDevice.clear"');- expect(source).toContain("body: { name: null }");- expect(source).toContain('setSelfDeviceName(res.name);');- expect(source).toContain('updateSelfDeviceNameDraft(res.name);');- expect(source).not.toContain('updateSelfDeviceNameDraft(systemDeviceName);');- expect(source).not.toContain('setSelfDeviceName(systemDeviceName);');- expect(source).toContain("title={t('settings.deviceNameEditor.screenTitle')}");- expect(source).toContain('const selfDeviceNameWriteInFlightRef = useRef(false);');- expect(source).toContain('const selfDeviceNameQueuedWriteRef = useRef<SelfDeviceNameQueuedWrite | null>(null);');- expect(source).toContain("selfDeviceNameQueuedWriteRef.current = { kind: 'rename', name, options };");- expect(source).toContain("selfDeviceNameQueuedWriteRef.current = { kind: 'reset' };");- expect(source).toContain("selfDeviceNameQueuedWriteRef.current?.kind === 'reset'");- expect(source).toContain('selfDeviceNameRunQueuedWriteRef.current();');- expect(source).toContain('const timer = setTimeout(() => {');- expect(source).toContain('if (selfDeviceNameSaving) return;');- expect(source).toContain('void saveSelfDeviceNameDraft(name);');- expect(source).toContain('setSelfDeviceNameMessage(null);\n setSelfDeviceNameDraft(value);');- expect(source).not.toContain('if (!selfDeviceNameSaving) setSelfDeviceNameMessage(null);');- expect(source).toContain('if (name.length === 0) {');- expect(source).toContain('updateSelfDeviceNameDraft(deviceName);');- expect(source).toContain('setSelfDeviceNameEditing(false);');- expect(source).toContain('`/api/device-link/devices/${encodeURIComponent(auth.deviceId)}`');- expect(source).toContain("method: 'PATCH'");- expect(source).toContain('body: { name }');- expect(inFlightQueueIndex).toBeGreaterThan(-1);- expect(sameNameNoopIndex).toBeGreaterThan(-1);- expect(inFlightQueueIndex).toBeLessThan(sameNameNoopIndex);- expect(source).not.toContain('settings.renameSelfDevice.save');- expect(source).not.toContain('settings.renameSelfDevice.done');- expect(source).not.toContain('clearManualName');+ expect(editor).toContain('testID="settings.renameSelfDevice.screen"');+ expect(editor).toContain('backTestID="settings.renameSelfDevice.backButton"');+ expect(editor).toContain('testID="settings.renameSelfDevice.input"');+ expect(editor).toContain('testID="settings.renameSelfDevice.clear"');+ expect(editor).toContain("testID: 'settings.renameSelfDevice.save'");+ expect(editor).toContain("testID: 'settings.renameSelfDevice.reset'");+ expect(editor).toContain("title={t('settings.deviceNameEditor.screenTitle')}");+ expect(editor).toContain('`/api/device-link/devices/${encodeURIComponent(deviceId)}`');+ expect(editor).toContain("method: 'PATCH'");+ expect(editor).toContain("body: kind === 'reset' ? { name: null } : { name: trimmedDraft }");+ expect(editor).toContain('publishSelfDeviceName(deviceId, res.name);');+ // 保存按钮只在有改动且非空时可用;离开时不再静默保存,有改动先确认放弃。+ expect(editor).toContain('const canSave = dirty && trimmedDraft.length > 0 && !saving;');+ expect(editor).toContain('usePreventRemove(dirty && !leaveAfterSave');+ expect(editor).toContain("t('settings.deviceNameEditor.discardTitle')");+ expect(editor).not.toContain('setTimeout(() => {');+ expect(editor).not.toContain('acceptClosedDraft');+ expect(editor).not.toContain('clearManualName');});- it('hydrates the voice dictionary after the async desktop list arrives', () => {- const source = readTextLf(resolve(process.cwd(), 'app/settings.tsx'), 'utf8');+ it('hydrates the voice dictionary page after the async desktop list arrives', () => {+ const settings = readTextLf(resolve(process.cwd(), 'app/settings.tsx'), 'utf8');+ const source = readTextLf(resolve(process.cwd(), 'app/settings/voice-dictionary.tsx'), 'utf8');const dictionaryEffectIndex = source.indexOf(- 'if (!dictionaryScreenOpen || desktopDevices.length === 0) return;',+ 'if (desktopDevices.length === 0) return;',);- const dictionaryOpenIndex = source.indexOf('const openVoiceDictionary = useCallback(() => {');const hydrateIndex = source.indexOf('Promise.all(desktopDevices.map((host) => hydrateMobileVoiceDictionary(host.deviceId)))',dictionaryEffectIndex,);+ expect(settings).toContain("push('/settings/voice-dictionary')");+ expect(settings).not.toContain('function VoiceDictionaryScreen');+ expect(source).toContain('testID="settings.voiceDictionary.screen"');+ expect(source).toContain('backTestID="settings.voiceDictionary.backButton"');expect(dictionaryEffectIndex).toBeGreaterThan(-1);- expect(dictionaryOpenIndex).toBeGreaterThan(-1);expect(hydrateIndex).toBeGreaterThan(dictionaryEffectIndex);- expect(source).toContain('[desktopDevices, dictionaryScreenOpen, refreshVoiceDictionary]');+ expect(source).toContain('[desktopDevices, refreshVoiceDictionary]');expect(source).toContain('[desktopDevices, invoke]');expect(source).not.toContain('[desktopDevices, deviceLink]');expect(source).toContain('subscribeMobileVoiceDictionaryCache(() => {');@@ -319,15 +312,17 @@ describe('mobile settings overview', () => {expect(source).toContain("'settings.version.testFlightCheckingAccessibility'");expect(source).toContain("testID=\"settings.testFlightUpdateHint\"");expect(source).toContain("{t('settings.version.testFlightUpdateManaged')}");- expect(source).toContain("{t('settings.version.bundleVersion', { version: appVersion })}");+ // 版本卡片面向用户:「版本 x.y.z」+ 更新方式说明;热更版本等技术细节在调试分组。+ expect(source).toContain("{t('settings.version.appVersion', { version: appVersion })}");+ expect(source).toContain('testID="settings.updateMethod"');+ expect(source).toContain("tone: 'secondary',");expect(source).toContain('const showBetaBadge = betaReady && betaEnabled;');expect(source).toContain('testID="settings.betaChannelBadge"');expect(source).toContain("{t('settings.betaChannel.badge')}");expect(source).toContain('backgroundColor: colors.betaChannelBadgeBackground');expect(source).toContain('color: colors.betaChannelBadgeForeground');- expect(source).toContain(- "testID=\"settings.otaVersion\">{t('settings.version.otaVersion', { version: otaVersion })}",- );+ expect(source).toContain("label={t('settings.updateInfo.otaVersion')}");+ expect(source).toContain('testID="settings.otaVersion"');expect(source).toContain("testID=\"settings.desktopVersion\">{t('settings.version.pairedDesktopVersion', { version: DESKTOP_PACKAGE_VERSION })}",);diff --git a/apps/mobile/src/__tests__/navigationDemoConfig.test.ts b/apps/mobile/src/__tests__/navigationDemoConfig.test.tsnew file mode 100644index 0000000000..da0725ab13--- /dev/null+++ b/apps/mobile/src/__tests__/navigationDemoConfig.test.ts@@ -0,0 +1,30 @@+import { createRequire } from 'node:module';+import { describe, expect, it } from 'vitest';+const require = createRequire(import.meta.url);+const { applyNavigationDemoConfig } = require('../../scripts/navigation-demo-config.cjs');+const base = { name: 'Cindy', scheme: 'cindy', ios: { bundleIdentifier: 'com.xd.cindy' }, android: { package: 'com.xd.cindy' }, updates: { url: 'https://updates.example.test', enabled: true }, extra: {} };+describe('isolated navigation demo configuration', () => {+ it('leaves ordinary builds untouched, including object identity', () => {+ expect(applyNavigationDemoConfig(base, {})).toBe(base);+ });+ it.each(['cn', 'global'])('uses a separate install, callback and no OTA feed for %s', region => {+ const result = applyNavigationDemoConfig(base, { EXPO_PUBLIC_CINDY_NAV_DEMO: '1', EXPO_PUBLIC_CINDY_AUTH_REGION: region });+ const id = region === 'cn' ? 'com.xd.cindycn.navdemo' : 'com.xd.cindy.navdemo';+ expect(result.ios.bundleIdentifier).toBe(id); expect(result.android.package).toBe(id);+ expect(result.scheme).toBe(region === 'cn' ? 'cindycnnavdemo' : 'cindynavdemo');+ expect(result.updates).toEqual({ enabled: false, checkAutomatically: 'NEVER' });+ expect(result.extra.navigationDemo).toBe(true);+ expect(result.ios.associatedDomains).toEqual([]); expect(result.android.intentFilters).toEqual([]);+ expect(base.ios.bundleIdentifier).toBe('com.xd.cindy');+ });+ it.each([+ { EXPO_PUBLIC_XDT_OTA_SELFHOST: '1' }, { EAS_PROJECT_ID: 'production-project' },+ { EAS_BUILD_PROFILE: 'production' }, { CINDY_USE_LOCAL_REGION_CONFIG: '1' },+ { EXPO_PUBLIC_CINDY_WECHAT_APP_ID: 'wx-production' }, { EXPO_PUBLIC_CINDY_GOOGLE_IOS_URL_SCHEME: 'production-callback' },+ ])('rejects existing distribution/provider configuration %j', extra => {+ expect(() => applyNavigationDemoConfig(base, { EXPO_PUBLIC_CINDY_NAV_DEMO: '1', EXPO_PUBLIC_CINDY_AUTH_REGION: 'cn', ...extra })).toThrow();+ });+ it('requires an explicit supported region', () => {+ expect(() => applyNavigationDemoConfig(base, { EXPO_PUBLIC_CINDY_NAV_DEMO: '1' })).toThrow();+ });+});diff --git a/apps/mobile/src/__tests__/navigationDemoIdentity.test.ts b/apps/mobile/src/__tests__/navigationDemoIdentity.test.tsnew file mode 100644index 0000000000..359b839925--- /dev/null+++ b/apps/mobile/src/__tests__/navigationDemoIdentity.test.ts@@ -0,0 +1,44 @@+import { afterEach, describe, expect, it, vi } from 'vitest';+const fixture = vi.hoisted(() => ({ applicationId: 'com.xd.cindy', marked: true }));+vi.mock('expo-application', () => ({ nativeApplicationVersion: '0.1.0', get applicationId() { return fixture.applicationId; } }));+vi.mock('expo-constants', () => ({ default: { get expoConfig() { return { extra: { navigationDemo: fixture.marked } }; } } }));+vi.mock('@react-native-async-storage/async-storage', () => ({ default: { getItem: async () => null, setItem: async () => undefined } }));+afterEach(() => vi.unstubAllEnvs());+describe('navigation demo installation boundary', () => {+ it.each([+ ['com.xd.cindy', true, '1', false],+ ['com.xd.cindycn', true, '1', false],+ ['com.xd.cindy.navdemo', false, '1', false],+ ['com.xd.cindy.navdemo', true, '0', false],+ ['com.xd.cindy.navdemo', true, '1', true],+ ['com.xd.cindycn.navdemo', true, '1', true],+ ])('checks native ID %s, marker %s and opt-in %s', async (id, marked, flag, expected) => {+ vi.resetModules(); fixture.applicationId = id; fixture.marked = marked;+ vi.stubEnv('EXPO_PUBLIC_CINDY_NAV_DEMO', flag);+ const config = await import('@/config/navigationDemo');+ expect(config.IS_NAVIGATION_DEMO).toBe(expected);+ if (expected) expect(config.NAVIGATION_DEMO_SCHEME).toBe(id.includes('cindycn') ? 'cindycnnavdemo' : 'cindynavdemo');+ });+});++describe('navigation trial browser login redirect', () => {+ it.each([+ ['cn', 'ios', 'com.xd.cindycn.navdemo', 'cindycnnavdemo', 'cindycn://auth'],+ ['global', 'ios', 'com.xd.cindy.navdemo', 'cindynavdemo', 'cindy://auth'],+ ['cn', 'android', 'com.xd.cindycn.navdemo', 'cindycnnavdemo', 'cindycnnavdemo://auth'],+ ['global', 'android', 'com.xd.cindy.navdemo', 'cindynavdemo', 'cindynavdemo://auth'],+ ['cn', 'ios', 'com.xd.cindycn', 'cindycn', 'cindycn://auth'],+ ['global', 'ios', 'com.xd.cindy', 'cindy', 'cindy://auth'],+ ])('keeps %s %s install %s isolated while choosing the supported browser callback', async (region, platform, id, scheme, callback) => {+ vi.resetModules(); fixture.applicationId = id; fixture.marked = true;+ vi.stubEnv('EXPO_PUBLIC_CINDY_NAV_DEMO', '1');+ vi.stubEnv('EXPO_PUBLIC_CINDY_AUTH_REGION', region);+ vi.stubEnv('EXPO_OS', platform);+ const config = await import('@/config/env');+ expect(config.APP_SCHEME).toBe(scheme);+ expect(config.MOBILE_REDIRECT_URL).toBe(callback);+ const { matchesOAuthCallbackUrl } = await import('@/auth/oauthCallback');+ expect(matchesOAuthCallbackUrl(callback + '?code=test-only&state=test-only', config.MOBILE_REDIRECT_URL)).toBe(true);+ expect(matchesOAuthCallbackUrl(callback + '/other?code=test-only&state=test-only', config.MOBILE_REDIRECT_URL)).toBe(false);+ });+});diff --git a/apps/mobile/src/__tests__/newSession.test.ts b/apps/mobile/src/__tests__/newSession.test.tsindex 3112b0c6ee..3ff19aa64f 100644--- a/apps/mobile/src/__tests__/newSession.test.ts+++ b/apps/mobile/src/__tests__/newSession.test.ts@@ -1330,7 +1330,7 @@ describe('new session model', () => {agentLabel: 'Codex',canCreate: true,runtimeLabel: 'Codex · gpt-5.4 · medium · Fast',- scopeLabel: '电脑端分配对话目录',+ scopeLabel: '由电脑自动分配工作目录',workspaceLabel: '对话',});});diff --git a/apps/mobile/src/__tests__/newSessionVoiceInput.test.tsx b/apps/mobile/src/__tests__/newSessionVoiceInput.test.tsxindex f791becff7..e1074047c3 100644--- a/apps/mobile/src/__tests__/newSessionVoiceInput.test.tsx+++ b/apps/mobile/src/__tests__/newSessionVoiceInput.test.tsx@@ -18,6 +18,11 @@ vi.mock('react-native', () => ({Platform: { get OS() { return native.platform; } },StyleSheet: { hairlineWidth: 1 },View: ({ children }: { children: ReactNode }) => createElement('div', null, children),+ // MobileComposerInputRow 经 useReduceMotionEnabled 读系统「减弱动态效果」偏好。+ AccessibilityInfo: {+ isReduceMotionEnabled: () => Promise.resolve(false),+ addEventListener: () => ({ remove: () => {} }),+ },}));vi.mock('@/components/AppText', async () => {const { forwardRef } = await import('react');diff --git a/apps/mobile/src/__tests__/remoteCollectionRead.test.tsx b/apps/mobile/src/__tests__/remoteCollectionRead.test.tsxindex e244d1aa2b..64780de4dc 100644--- a/apps/mobile/src/__tests__/remoteCollectionRead.test.tsx+++ b/apps/mobile/src/__tests__/remoteCollectionRead.test.tsx@@ -29,12 +29,12 @@ vi.mock('@/session/useHomeMode', () => ({ useHomeMode: () => ({ selectTeammate:vi.mock('react-i18next', () => ({ useTranslation: () => h.translation }));vi.mock('@/i18n', () => ({ i18n: { t: (key: string) => key } }));vi.mock('react-native-safe-area-context', () => ({ SafeAreaView: 'div' }));-vi.mock('lucide-react-native', () => ({ ChevronRight: () => null, RefreshCw: () => null, TriangleAlert: () => null }));+vi.mock('lucide-react-native', () => ({ ChevronRight: () => null, RefreshCw: () => null, Search: () => null, TriangleAlert: () => null, X: () => null }));vi.mock('@/session/WorkingStatusText', () => ({ WorkingStatusText: ({ text }: any) => text }));vi.mock('@/components/AppText', () => ({ Text: 'span', TextInput: 'input' }));vi.mock('@/components/RemoteCompanionAvatar', () => ({ RemoteCompanionAvatar: () => null }));-vi.mock('@/components/MobilePrimitives', () => ({ MainWindowEmptyState: () => null, StatusDot: () => null }));-vi.mock('@/platform/chrome', () => ({ SimpleStackHeader: () => null, simpleScreenSafeAreaEdges: () => [] }));+vi.mock('@/components/MobilePrimitives', () => ({ MainWindowEmptyState: () => null, StatusDot: () => null, RemoteListSyncingPlaceholder: () => null }));+vi.mock('@/platform/chrome', () => ({ SimpleStackHeader: () => null, simpleScreenSafeAreaEdges: () => [], simpleScrollInsetProps: {}, simpleScrollScreenSafeAreaEdges: () => [] }));vi.mock('@/auth/AuthContext', () => ({ useAuth: () => ({ user: { id: 'owner' }, accountGeneration: 1 }) }));vi.mock('@/device-link/remoteStatus', () => ({ formatRemoteError: String }));vi.mock('@/device-link/DeviceLinkContext', () => ({ useDeviceLink: () => h.link }));diff --git a/apps/mobile/src/__tests__/remoteMediaResolveQueue.test.ts b/apps/mobile/src/__tests__/remoteMediaResolveQueue.test.tsindex 3705820935..f77f47b248 100644--- a/apps/mobile/src/__tests__/remoteMediaResolveQueue.test.ts+++ b/apps/mobile/src/__tests__/remoteMediaResolveQueue.test.ts@@ -83,7 +83,7 @@ describe('remoteMediaResolveQueue', () => {const queue = createRemoteMediaResolveQueue({ resolve });// 未命中:立即拒绝,不触发取件,也不写负缓存。- await expect(queue.request(imageRequest('a.png'), { cachedOnly: true })).rejects.toThrow('cachedOnly');+ await expect(queue.request(imageRequest('a.png'), { cachedOnly: true })).rejects.toThrow('这个媒体还没有缓存到手机上');expect(resolve).not.toHaveBeenCalled();// 负缓存未被污染:随后的正常请求照常起飞。@@ -393,7 +393,7 @@ describe('remoteMediaResolveQueue', () => {queue.releaseAll();// 排队项直接拒绝,resolve 不会为它被调用- await expect(p2).rejects.toThrow('远程媒体取件已取消');+ await expect(p2).rejects.toThrow('已取消取回远程媒体');pending[0]?.resolve(resolvedMedia('a.png'));await expect(p1).resolves.toMatchObject({ ossKey: 'key/a.png' });await flush();diff --git a/apps/mobile/src/__tests__/remoteTaskSuggestions.test.ts b/apps/mobile/src/__tests__/remoteTaskSuggestions.test.tsindex 397cfe3e61..bb4ec65728 100644--- a/apps/mobile/src/__tests__/remoteTaskSuggestions.test.ts+++ b/apps/mobile/src/__tests__/remoteTaskSuggestions.test.ts@@ -148,6 +148,9 @@ describe("recommendation route target", () => {const open = new Function("project", "suggestion", "explicitDeviceId", "guardedPush", `const home = { primaryDevice: { deviceId: 'fallback', label: 'Fallback' } };const selectedDeviceId = null;+ // 推荐入口不带 origin,不应触发 composer 形变入场。+ const origin = undefined;+ const rememberComposerEntry = () => { throw new Error('unexpected composer morph'); };const newSessionDeviceOptions = [{ deviceId: 'checked', name: 'Checked' }];const serializeNewSessionDeviceOptions = JSON.stringify;const setError = (error) => { throw new Error(error); }, t = (key) => key;diff --git a/apps/mobile/src/__tests__/sessionComposerDesktopFirst.test.ts b/apps/mobile/src/__tests__/sessionComposerDesktopFirst.test.tsindex ee54c00131..8cf9de7696 100644--- a/apps/mobile/src/__tests__/sessionComposerDesktopFirst.test.ts+++ b/apps/mobile/src/__tests__/sessionComposerDesktopFirst.test.ts@@ -177,7 +177,8 @@ describe('mobile session composer desktop-first surface', () => {expect(composerInputSource).toContain('trailing={composerCardActive ? null : controls.trailing}');expect(trailingActionsSource).toContain('<PaperPlaneIcon');expect(trailingActionsSource).toContain('color={composerSendDisabled ? colors.textSecondary : colors.ctaText}');- expect(source).toContain('const composerCardActive = (canUseComposer && composerFocused)');+ // 收起胶囊点开到真正聚焦之间的过渡期(composerPillOpen.opening)同样算激活态,仍受 canUseComposer 门控。+ expect(source).toContain('const composerCardActive = (canUseComposer && (composerFocused || composerPillOpen.opening))');expect(source).toContain('|| permissionSheetOpen');// 2026-07-29 用户裁决:权限入口是 composer 左侧图标钮 + 独立浮窗// (MobilePermissionPickerList 由本 screen 直挂 SheetSurface);@@ -390,7 +391,12 @@ describe('mobile session composer desktop-first surface', () => {expect(source).toContain('testID="session.bottomLayer"');expect(source).toContain('testID="session.bottomContent"');expect(source).toContain("paddingBottom: sessionOperationLayout.composerSlot === 'pending-interaction'");- expect(source).toContain('? 0\n : insets.bottom');+ // 底部 padding:待处理面板自己收 safe-area(0);dock 形态(键盘跟随 / 胶囊停靠)另行计算;+ // 非 dock 的普通 composer 仍由外层留一次 insets.bottom。+ const bottomPaddingStart = source.indexOf("paddingBottom: sessionOperationLayout.composerSlot === 'pending-interaction'");+ const bottomPadding = source.slice(bottomPaddingStart, source.indexOf('testID="session.bottomContent"', bottomPaddingStart));+ expect(bottomPadding).toMatch(/^paddingBottom: sessionOperationLayout\.composerSlot === 'pending-interaction'\s*\n\s*\? 0\s*\n/);+ expect(bottomPadding).toMatch(/: insets\.bottom,\s*\n\s*\},/);expect(source.match(/safeAreaBottomInset={insets\.bottom}/g)).toHaveLength(2);expect(source).toContain('pointerEvents="box-none"\n style={[');expect(source).toContain('nativeShellLayout.wideViewport && { maxWidth: nativeShellLayout.contentMaxWidth }');diff --git a/apps/mobile/src/__tests__/sessionComposerLayout.test.ts b/apps/mobile/src/__tests__/sessionComposerLayout.test.tsindex 181fea219f..b6980390cc 100644--- a/apps/mobile/src/__tests__/sessionComposerLayout.test.ts+++ b/apps/mobile/src/__tests__/sessionComposerLayout.test.ts@@ -281,7 +281,7 @@ describe('sessionComposerLayout', () => {label: '停止',visible: true,});- expect(runningWithDraft.guidanceText).toBe('点发送后会进入桌面端队列,按当前任务设置执行。');+ expect(runningWithDraft.guidanceText).toBe('点发送后会进入电脑端队列,按当前任务设置执行。');});it('marks busy operations without changing the primary layout shape', () => {@@ -327,7 +327,7 @@ describe('sessionComposerLayout', () => {label: '发送中',visible: true,});- expect(layout.guidanceText).toBe('消息正在写入桌面端队列,完成前请不要重复发送。');+ expect(layout.guidanceText).toBe('消息正在写入电脑端队列,完成前请不要重复发送。');expect(layout.statusText).toBe('正在发送到电脑端');});@@ -405,6 +405,6 @@ describe('sessionComposerLayout', () => {queueBusy: false,sending: false,voiceState: 'idle',- }).guidanceText).toBe('点发送后会进入桌面端队列,按当前任务设置执行。');+ }).guidanceText).toBe('点发送后会进入电脑端队列,按当前任务设置执行。');});});diff --git a/apps/mobile/src/__tests__/sharedSessionCompatibility.test.tsx b/apps/mobile/src/__tests__/sharedSessionCompatibility.test.tsxindex 7413bca86a..9cb6b67c47 100644--- a/apps/mobile/src/__tests__/sharedSessionCompatibility.test.tsx+++ b/apps/mobile/src/__tests__/sharedSessionCompatibility.test.tsx@@ -44,7 +44,7 @@ vi.mock('@/components/MobilePrimitives', () => ({MainWindowRowButton: () => null,MainWindowOptionButton: ({ label }: { label: string }) => createElement('button', null, label),}));-vi.mock('@/platform/chrome/SimpleStackHeader', () => ({ SimpleStackHeader: () => null, simpleScreenSafeAreaEdges: () => [] }));+vi.mock('@/platform/chrome/SimpleStackHeader', () => ({ SimpleStackHeader: () => null, simpleScreenSafeAreaEdges: () => [], simpleScrollInsetProps: {}, simpleScrollScreenSafeAreaEdges: () => [] }));vi.mock('@/theme', () => ({ useTheme: () => ({ colors: {} }), useThemedStyles: () => ({}) }));let host: HTMLDivElement;let root: Root;diff --git a/apps/mobile/src/__tests__/sharedTaskFlow.test.tsx b/apps/mobile/src/__tests__/sharedTaskFlow.test.tsxindex ffcf97865c..4d25109d77 100644--- a/apps/mobile/src/__tests__/sharedTaskFlow.test.tsx+++ b/apps/mobile/src/__tests__/sharedTaskFlow.test.tsx@@ -56,8 +56,9 @@ vi.mock('@/components/MobilePrimitives', () => ({MainWindowActionButton: ({ action }: { action: { label: string; disabled?: boolean; busy?: boolean; onPress(): void } }) => createElement('button', { disabled: action.disabled || action.busy, onClick: action.onPress }, action.label),MainWindowRowButton: ({ children, onPress, accessibilityLabel }: { children?: ReactNode; onPress(): void; accessibilityLabel?: string }) => createElement('button', { onClick: onPress, 'aria-label': accessibilityLabel }, children),MainWindowOptionButton: ({ label, onPress }: { label: string; onPress(): void }) => createElement('button', { onClick: onPress }, label),+ MainWindowEmptyState: ({ title, copy, children }: { title: string; copy: string; children?: ReactNode }) => createElement('section', null, title, copy, children),}));-vi.mock('@/platform/chrome/SimpleStackHeader', () => ({ SimpleStackHeader: ({ title, onBack }: { title: string; onBack(): void }) => createElement('header', null, title, createElement('button', { onClick: onBack }, 'back')), simpleScreenSafeAreaEdges: () => [] }));+vi.mock('@/platform/chrome/SimpleStackHeader', () => ({ SimpleStackHeader: ({ title, onBack }: { title: string; onBack(): void }) => createElement('header', null, title, createElement('button', { onClick: onBack }, 'back')), simpleScreenSafeAreaEdges: () => [], simpleScrollInsetProps: {}, simpleScrollScreenSafeAreaEdges: () => [] }));vi.mock('@/theme', () => ({ useTheme: () => ({ colors: {} }), useThemedStyles: () => ({}) }));let element: HTMLDivElement;let root: Root;diff --git a/apps/mobile/src/__tests__/taskTagsRecovery.test.tsx b/apps/mobile/src/__tests__/taskTagsRecovery.test.tsxindex c496f0abf9..0854793927 100644--- a/apps/mobile/src/__tests__/taskTagsRecovery.test.tsx+++ b/apps/mobile/src/__tests__/taskTagsRecovery.test.tsx@@ -28,6 +28,14 @@ vi.mock("react-native", () => ({),useWindowDimensions: () => ({ height: 800, width: 400 }),}));+vi.mock("@/components/MobilePrimitives", () => ({+ ScreenBackButton: ({ onPress, testID }: any) => (+ <button aria-label="shared.back" data-testid={testID} disabled={!onPress} onClick={onPress} />+ ),+}));+vi.mock("@/components/mobileInteractionStyles", () => ({+ mobileInteractionStyles: { pressed: { opacity: 0.72 } },+}));vi.mock("@/components/AppText", () => ({Text: ({ children }: any) => <span>{children}</span>,TextInput: (props: any) => {diff --git a/apps/mobile/src/auth/LoginCaptchaWebView.tsx b/apps/mobile/src/auth/LoginCaptchaWebView.tsxindex 9cd9ffbd6f..657e41cf2b 100644--- a/apps/mobile/src/auth/LoginCaptchaWebView.tsx+++ b/apps/mobile/src/auth/LoginCaptchaWebView.tsx@@ -91,9 +91,9 @@ export function LoginCaptchaWebView({borderColor: login.panelBorder,borderRadius: radius.container,borderWidth: 1,- paddingBottom: 12,- paddingHorizontal: 16,- paddingTop: 16,+ paddingBottom: spacing.md,+ paddingHorizontal: spacing.lg,+ paddingTop: spacing.lg,maxWidth: 340,width: '100%',}}@@ -102,8 +102,8 @@ export function LoginCaptchaWebView({style={{color: login.titleText,fontSize: typeScale.body,- fontWeight: fontWeight.bold,- lineHeight: lineHeight.bodyRelaxed,+ fontWeight: fontWeight.semibold,+ lineHeight: lineHeight.body,}}>{loginText('captchaTitle')}@@ -143,7 +143,7 @@ export function LoginCaptchaWebView({)}</View>) : (- <View style={{ alignSelf: 'stretch', height: 220, marginTop: 8 }}>+ <View style={{ alignSelf: 'stretch', height: 220, marginTop: spacing.sm }}><WebViewkey={generation}source={{ uri: themedUrl }}diff --git a/apps/mobile/src/components/LoginSkinControls.tsx b/apps/mobile/src/components/LoginSkinControls.tsxindex 7f579bd4f9..3b6fea63bf 100644--- a/apps/mobile/src/components/LoginSkinControls.tsx+++ b/apps/mobile/src/components/LoginSkinControls.tsx@@ -35,7 +35,7 @@ import { parseLegalSegments } from '@/auth/legalText';import { Text, TextInput } from '@/components/AppText';import { hasNativeLoginButtons, LoginNativeButton } from './LoginNativeButton';import { useTheme, useThemedStyles } from '@/theme';-import { fontWeight, loginSizes, radius, type ThemeColors } from '@/theme/tokens';+import { fontWeight, loginSizes, motionDuration, radius, type ThemeColors } from '@/theme/tokens';/*** LoginSkinControls —— 登录布局与跨平台入口。iOS 按钮交给 LoginNativeButton,@@ -748,7 +748,7 @@ function SpinBox({ box, children }: { box: number; children: ReactNode }) {useEffect(() => {const loop = Animated.loop(Animated.timing(spin, {- duration: 900,+ duration: motionDuration.spinnerCycle,easing: Easing.linear,toValue: 1,useNativeDriver: true,diff --git a/apps/mobile/src/components/MobilePrimitives.tsx b/apps/mobile/src/components/MobilePrimitives.tsxindex 655c77f108..d5b5c1b51f 100644--- a/apps/mobile/src/components/MobilePrimitives.tsx+++ b/apps/mobile/src/components/MobilePrimitives.tsx@@ -17,15 +17,34 @@ import {} from 'react-native';import { Text } from '@/components/AppText';import { QuietSyncIndicator } from '@/components/QuietSyncIndicator';+import { useReduceMotionEnabled } from '@/hooks/useReduceMotion';import { mobileInteractionStyles } from './mobileInteractionStyles';import { fontWeight, iconSize, iconStroke, useTheme, useThemedStyles, type ThemeColors } from '@/theme';import { lineHeight, radius, spacing, typeScale } from '@/theme/tokens';type PillTone = 'default' | 'primary' | 'attention';+type MainWindowActionTone = 'danger' | 'danger-solid' | 'primary' | 'secondary';type MainWindowActionDensity = 'compact' | 'default';+/** iOS HIG 最小点击目标(pt)。可见框小于它的控件用 hitSlop 把命中区补足,不改可见尺寸。 */+const MIN_TOUCH_TARGET = 44;+/** 可见最小高度 → 补足到 44pt 的上下 hitSlop。 */+function touchTargetSlop(visibleHeight: number) {+ const inset = Math.max(0, (MIN_TOUCH_TARGET - visibleHeight) / 2);+ return inset > 0 ? { bottom: inset, top: inset } : undefined;+}+const BACK_BUTTON_SIZE = 44;+const BACK_BUTTON_COMPACT_SIZE = 36;+const ACTION_BUTTON_COMPACT_HEIGHT = 38;+const ACTION_PILL_HEIGHT = 38;+const OPTION_BUTTON_HEIGHT = 36;+const OPTION_BUTTON_COMPACT_HEIGHT = 32;+/** StatusDot 脉冲半程(ms):常驻「忙碌」状态信号,非交互过渡;减弱动态效果下静止。 */+const STATUS_DOT_PULSE_HALF_CYCLE_MS = 680;+export interface MainWindowAction {+ accessibilityHint?: string;accessibilityLabel?: string;active?: boolean;busy?: boolean;@@ -70,6 +89,7 @@ export function MainWindowOptionButton({accessibilityRole={accessibilityRole}accessibilityState={{ ...accessibilityState, disabled: interactionDisabled, selected }}disabled={interactionDisabled}+ hitSlop={touchTargetSlop(compact ? OPTION_BUTTON_COMPACT_HEIGHT : OPTION_BUTTON_HEIGHT)}onPress={interactionDisabled ? undefined : onPress}style={({ pressed }) => [styles.mainOptionButton,@@ -86,6 +106,7 @@ export function MainWindowOptionButton({numberOfLines={1}style={[styles.mainOptionButtonText,+ compact && styles.mainOptionButtonTextCompact,selected && styles.mainOptionButtonTextSelected,]}>@@ -200,22 +221,24 @@ export function StatusDot({}) {const styles = useThemedStyles(makeStyles);const pulse = useRef(new Animated.Value(1)).current;+ const reduceMotion = useReduceMotionEnabled();+ const animatePulse = pulsing && reduceMotion === false;useEffect(() => {- if (!pulsing) {+ if (!animatePulse) {pulse.setValue(1);return undefined;}const loop = Animated.loop(Animated.sequence([Animated.timing(pulse, {- duration: 680,+ duration: STATUS_DOT_PULSE_HALF_CYCLE_MS,easing: Easing.inOut(Easing.ease),toValue: 0.42,useNativeDriver: true,}),Animated.timing(pulse, {- duration: 680,+ duration: STATUS_DOT_PULSE_HALF_CYCLE_MS,easing: Easing.inOut(Easing.ease),toValue: 1,useNativeDriver: true,@@ -226,7 +249,7 @@ export function StatusDot({return () => {loop.stop();};- }, [pulse, pulsing]);+ }, [animatePulse, pulse]);return (<Animated.View@@ -281,6 +304,7 @@ export function ActionPill({accessibilityRole="button"accessibilityState={{ disabled: interactionDisabled, selected: active || undefined }}disabled={interactionDisabled}+ hitSlop={touchTargetSlop(ACTION_PILL_HEIGHT)}onPress={interactionDisabled ? undefined : onPress}style={({ pressed }) => [styles.actionPill,@@ -405,7 +429,8 @@ export function ScreenBackButton({accessibilityRole="button"accessibilityState={{ disabled: interactionDisabled }}disabled={interactionDisabled}- hitSlop={hitSlop}+ // 调用方传入的 hitSlop 优先;compact 档(36pt)默认四周补足到 44pt。+ hitSlop={hitSlop ?? (compact ? (MIN_TOUCH_TARGET - BACK_BUTTON_COMPACT_SIZE) / 2 : undefined)}onPress={interactionDisabled ? undefined : onPress}style={({ pressed }) => [styles.backButton,@@ -606,6 +631,7 @@ export function MainWindowActionButton({return (<Pressableref={buttonRef}+ accessibilityHint={action.accessibilityHint}accessibilityLabel={action.accessibilityLabel ?? action.label}accessibilityRole="button"accessibilityState={{@@ -614,6 +640,7 @@ export function MainWindowActionButton({selected: action.active || undefined,}}disabled={disabled}+ hitSlop={compact ? touchTargetSlop(ACTION_BUTTON_COMPACT_HEIGHT) : undefined}onPress={disabled ? undefined : action.onPress}style={({ pressed }) => [styles.mainActionButton,@@ -720,14 +747,14 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({backButton: {alignItems: 'center',borderRadius: radius.pill,- height: 44,+ height: BACK_BUTTON_SIZE,justifyContent: 'center',marginLeft: -spacing.sm,- width: 44,+ width: BACK_BUTTON_SIZE,},backButtonCompact: {- height: 36,- width: 36,+ height: BACK_BUTTON_COMPACT_SIZE,+ width: BACK_BUTTON_COMPACT_SIZE,},headerText: {flex: 1,@@ -766,7 +793,7 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({borderRadius: radius.pill,borderWidth: StyleSheet.hairlineWidth,justifyContent: 'center',- minHeight: 38,+ minHeight: ACTION_PILL_HEIGHT,minWidth: 0,paddingHorizontal: spacing.md,},@@ -774,10 +801,11 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({backgroundColor: colors.surfaceChip,borderColor: colors.borderStrong,},+ // 紧凑按钮文字:§3 没有单列「紧凑按钮」角色,取最接近的已登记角色「面板操作项」15/20 500。actionPillText: {color: colors.textPrimary,- fontSize: typeScale.caption,- lineHeight: lineHeight.caption,+ fontSize: typeScale.bodySmall,+ lineHeight: lineHeight.bodySmall,fontWeight: fontWeight.medium,},infoPill: {@@ -824,11 +852,11 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({borderRadius: radius.pill,borderWidth: StyleSheet.hairlineWidth,justifyContent: 'center',- minHeight: 36,+ minHeight: OPTION_BUTTON_HEIGHT,paddingHorizontal: spacing.lg,},mainOptionButtonCompact: {- minHeight: 32,+ minHeight: OPTION_BUTTON_COMPACT_HEIGHT,paddingHorizontal: spacing.md,},mainOptionButtonSegmented: {@@ -839,12 +867,17 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({backgroundColor: colors.cta,borderColor: colors.cta,},+ // 选项文字按 §3「行标题、选项、按钮」16/22 500;紧凑档取「面板操作项」15/20 500。选中只换色。mainOptionButtonText: {color: colors.textSecondary,- fontSize: typeScale.caption,- lineHeight: lineHeight.caption,+ fontSize: typeScale.body,+ lineHeight: lineHeight.body,fontWeight: fontWeight.medium,},+ mainOptionButtonTextCompact: {+ fontSize: typeScale.bodySmall,+ lineHeight: lineHeight.bodySmall,+ },mainOptionButtonTextSelected: {color: colors.ctaText,},@@ -1006,7 +1039,7 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({paddingHorizontal: spacing.lg,},mainActionButtonCompact: {- minHeight: 38,+ minHeight: ACTION_BUTTON_COMPACT_HEIGHT,minWidth: 72,paddingHorizontal: spacing.md,},@@ -1029,9 +1062,10 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({lineHeight: lineHeight.body,fontWeight: fontWeight.medium,},+ // §3 无「紧凑按钮」角色,取最接近的「面板操作项」15/20(字重沿用按钮 500)。mainActionButtonTextCompact: {- fontSize: typeScale.caption,- lineHeight: lineHeight.caption,+ fontSize: typeScale.bodySmall,+ lineHeight: lineHeight.bodySmall,},mainActionButtonPrimaryText: {color: colors.ctaText,diff --git a/apps/mobile/src/components/MobileUserAvatar.tsx b/apps/mobile/src/components/MobileUserAvatar.tsxnew file mode 100644index 0000000000..36b9f9fd38--- /dev/null+++ b/apps/mobile/src/components/MobileUserAvatar.tsx@@ -0,0 +1,80 @@+import { Image, StyleSheet, View } from 'react-native';+import { Text } from '@/components/AppText';+import { useThemedStyles, type ThemeColors } from '@/theme';+import { fontWeight, lineHeight, radius, typeScale } from '@/theme/tokens';++/**+ * 账号头像(设置页头部、左侧抽屉、账号切换列表共用)。+ * - 有图:圆形裁切;+ * - 无图:取名称首字母(大写),同一套字重 600 + textPrimary,只随尺寸换字号档;+ * - 尺寸两档:`large`(56,设置页账号头部)与 `regular`(44,抽屉 / 列表行)。+ * 浮起面按规范带 1px 描边,不靠 surfaceElevated 的色差分层。+ */+export type MobileUserAvatarSize = 'large' | 'regular';++const AVATAR_DIMENSION: Record<MobileUserAvatarSize, number> = {+ large: 56,+ regular: 44,+};++export function mobileUserAvatarInitial(name: string | null | undefined): string {+ // Whole code point, so a name starting with an emoji or astral character stays intact.+ return (Array.from(name?.trim() ?? '')[0] ?? '?').toUpperCase();+}++export function MobileUserAvatar({+ imageUrl,+ name,+ size = 'regular',+ testID,+}: {+ imageUrl?: string | null;+ name: string | null | undefined;+ size?: MobileUserAvatarSize;+ testID?: string;+}) {+ const styles = useThemedStyles(makeStyles);+ const dimension = AVATAR_DIMENSION[size];+ return (+ <View+ accessibilityElementsHidden+ importantForAccessibility="no-hide-descendants"+ style={[styles.avatar, { height: dimension, width: dimension }]}+ testID={testID}+ >+ {imageUrl ? (+ <Image source={{ uri: imageUrl }} style={{ height: dimension, width: dimension }} />+ ) : (+ <Text style={size === 'large' ? styles.initialLarge : styles.initialRegular}>+ {mobileUserAvatarInitial(name)}+ </Text>+ )}+ </View>+ );+}++const makeStyles = (colors: ThemeColors) =>+ StyleSheet.create({+ avatar: {+ alignItems: 'center',+ backgroundColor: colors.surfaceElevated,+ borderColor: colors.border,+ borderRadius: radius.pill,+ borderWidth: StyleSheet.hairlineWidth,+ flexShrink: 0,+ justifyContent: 'center',+ overflow: 'hidden',+ },+ initialLarge: {+ color: colors.textPrimary,+ fontSize: typeScale.title,+ fontWeight: fontWeight.semibold,+ lineHeight: lineHeight.title,+ },+ initialRegular: {+ color: colors.textPrimary,+ fontSize: typeScale.subtitle,+ fontWeight: fontWeight.semibold,+ lineHeight: lineHeight.subtitle,+ },+ });diff --git a/apps/mobile/src/components/MobileVendorIcon.tsx b/apps/mobile/src/components/MobileVendorIcon.tsxindex cf0b734b72..bfc36b25d3 100644--- a/apps/mobile/src/components/MobileVendorIcon.tsx+++ b/apps/mobile/src/components/MobileVendorIcon.tsx@@ -1,9 +1,17 @@import { useEffect, useRef } from 'react';import { Animated, Easing } from 'react-native';+import { useReduceMotionEnabled } from '@/hooks/useReduceMotion';import { useTheme } from '@/theme';import { MobileAgentMark } from './MobileAgentMark';+/**+ * 运行中呼吸的半程时长(ms)。这是常驻循环的「运行中」状态信号,不是交互过渡,+ * 不套 motionDuration 交互档位;减弱动态效果下静止在全不透明。+ */+const RUNNING_BREATH_HALF_CYCLE_MS = 750;+const RUNNING_BREATH_MIN_OPACITY = 0.3;+interface MobileVendorIconProps {color?: string;running?: boolean;@@ -13,28 +21,30 @@ interface MobileVendorIconProps {export function MobileVendorIcon({ color: colorOverride, running = false, size = 12, vendor }: MobileVendorIconProps) {const { colors } = useTheme();- const opacity = useRef(new Animated.Value(running ? 0.3 : 1)).current;+ const reduceMotion = useReduceMotionEnabled();+ const animate = running && reduceMotion === false;+ const opacity = useRef(new Animated.Value(animate ? RUNNING_BREATH_MIN_OPACITY : 1)).current;const color = colorOverride ?? (running ? colors.statusAccent : colors.textTertiary);useEffect(() => {opacity.stopAnimation();- if (!running) {+ if (!animate) {opacity.setValue(1);return;}- opacity.setValue(0.3);+ opacity.setValue(RUNNING_BREATH_MIN_OPACITY);const loop = Animated.loop(Animated.sequence([Animated.timing(opacity, {- duration: 750,+ duration: RUNNING_BREATH_HALF_CYCLE_MS,easing: Easing.inOut(Easing.ease),toValue: 1,useNativeDriver: true,}),Animated.timing(opacity, {- duration: 750,+ duration: RUNNING_BREATH_HALF_CYCLE_MS,easing: Easing.inOut(Easing.ease),- toValue: 0.3,+ toValue: RUNNING_BREATH_MIN_OPACITY,useNativeDriver: true,}),]),@@ -43,7 +53,7 @@ export function MobileVendorIcon({ color: colorOverride, running = false, size =return () => {loop.stop();};- }, [opacity, running]);+ }, [animate, opacity]);return (<Animated.Viewdiff --git a/apps/mobile/src/components/mobileInteractionStyles.ts b/apps/mobile/src/components/mobileInteractionStyles.tsindex 77d1b9e069..db3c9f4564 100644--- a/apps/mobile/src/components/mobileInteractionStyles.ts+++ b/apps/mobile/src/components/mobileInteractionStyles.ts@@ -1,6 +1,10 @@-import { StyleSheet } from 'react-native';+import type { ViewStyle } from 'react-native';-/** Shared press feedback for primitives and custom compact action frames. */-export const mobileInteractionStyles = StyleSheet.create({+/**+ * Shared press feedback for primitives and custom compact action frames.+ * Plain style object (not StyleSheet.create) so importing it has no module-load+ * dependency on react-native — partial react-native test mocks stay valid.+ */+export const mobileInteractionStyles = {pressed: { opacity: 0.72 },-});+} as const satisfies Record<string, ViewStyle>;diff --git a/apps/mobile/src/config/env.ts b/apps/mobile/src/config/env.tsindex 8793a7755e..84c33e7059 100644--- a/apps/mobile/src/config/env.ts+++ b/apps/mobile/src/config/env.ts@@ -1,5 +1,6 @@import * as Application from 'expo-application';import Constants from 'expo-constants';+import { IS_NAVIGATION_DEMO, NAVIGATION_DEMO_SCHEME } from './navigationDemo';import {CLIENT_ENDPOINT_KEYS,@@ -57,10 +58,10 @@ export const AUTH_REGION: CindyAuthRegion = (() => {})();export const BUILD_AUTH_REGION: ClientEndpointRegion =AUTH_REGION === 'global' ? 'global' : 'cn';-export const APP_SCHEME = { cn: 'cindycn', global: 'cindy', dev: 'cindydev' }[+const REGIONAL_APP_SCHEME = { cn: 'cindycn', global: 'cindy', dev: 'cindydev' }[AUTH_REGION];-export const MOBILE_REDIRECT_URL = `${APP_SCHEME}://auth`;+export const APP_SCHEME = IS_NAVIGATION_DEMO ? NAVIGATION_DEMO_SCHEME : REGIONAL_APP_SCHEME;// __DEV__ 端点初值来源:metro 构建期按 AUTH_REGION 把仓内// config/endpoint.json 或 config/endpoint.global.json require 进 dev bundle@@ -335,6 +336,16 @@ function resolveAppPlatform(): AppPlatform {export const APP_PLATFORM: AppPlatform = resolveAppPlatform();+// iOS ASWebAuthenticationSession delivers its matching callback directly to the+// initiating session; the scheme need not be registered in Info.plist (see the+// AuthenticationServices SDK contract and expo-web-browser/ios/WebAuthSession.swift).+// Keep the trial's OS deep links/private installation independent, but authorize+// with the regional callback already accepted by auth-server. State/PKCE and+// exact callback validation remain in AuthContext. Android has no such capture+// contract: its trial callback still requires separate server registration.+export const MOBILE_REDIRECT_URL = (IS_NAVIGATION_DEMO && APP_PLATFORM === 'ios'+ ? REGIONAL_APP_SCHEME : APP_SCHEME) + '://auth';+/*** 纯函数:清单 review(送审版本号)与二进制版本号严格相等、且当前安装不是* TestFlight 时才进入审核模式;diff --git a/apps/mobile/src/config/navigationDemo.ts b/apps/mobile/src/config/navigationDemo.tsnew file mode 100644index 0000000000..bd28e84f62--- /dev/null+++ b/apps/mobile/src/config/navigationDemo.ts@@ -0,0 +1,10 @@+import * as Application from 'expo-application';+import Constants from 'expo-constants';++/** Both the JS opt-in and the installed native identity must belong to the trial. */+export const IS_NAVIGATION_DEMO = process.env.EXPO_PUBLIC_CINDY_NAV_DEMO === '1'+ && Constants.expoConfig?.extra?.navigationDemo === true+ && ['com.xd.cindy.navdemo', 'com.xd.cindycn.navdemo'].includes(Application.applicationId ?? '');++export const NAVIGATION_DEMO_SCHEME = IS_NAVIGATION_DEMO && Application.applicationId === 'com.xd.cindycn.navdemo'+ ? 'cindycnnavdemo' : 'cindynavdemo';diff --git a/apps/mobile/src/device-link/DeviceManagementDialogs.tsx b/apps/mobile/src/device-link/DeviceManagementDialogs.tsxindex 644ded2e7a..26138163d5 100644--- a/apps/mobile/src/device-link/DeviceManagementDialogs.tsx+++ b/apps/mobile/src/device-link/DeviceManagementDialogs.tsx@@ -1,5 +1,5 @@-import { useEffect, useRef } from 'react';-import { Alert, Platform } from 'react-native';+import { useEffect } from 'react';+import { Alert } from 'react-native';import { useTranslation } from 'react-i18next';import { RenameDeviceModal } from '@/session/RenameDeviceModal';import type { useDeviceManagement } from './useDeviceManagement';@@ -18,40 +18,7 @@ export function DeviceManagementDialogs({deleteSaving,closeDelete,confirmDelete,- renameTarget,- renameSaving,- renameError,} = manager;- const latest = useRef(manager);- latest.current = manager;- useEffect(() => {- if (Platform.OS !== 'ios' || !renameTarget || renameSaving) return;- Alert.prompt(- t('devices.list.renameDevice.title'),- renameError?.message,- [- {- text: t('devices.common.cancel'),- style: 'cancel',- onPress: () => latest.current.closeRename(),- },- {- text: t('devices.common.save'),- onPress: (value?: string) => {- const name = value?.trim() ?? '';- if (!name) {- latest.current.closeRename();- return;- }- latest.current.setRenameDraft(name);- void latest.current.confirmRename(name);- },- },- ],- 'plain-text',- latest.current.renameDraft,- );- }, [renameTarget, renameSaving, renameError, t]);useEffect(() => {if (!deleteTarget || deleteSaving) return;Alert.alert(@@ -84,7 +51,7 @@ export function DeviceManagementDialogs({onDeleted,t,]);- if (Platform.OS === 'ios') return null;+ // 重命名在 iOS / Android 统一走自绘对话框(与任务重命名同一形态),不再用 iOS Alert.prompt。return (<RenameDeviceModaldraft={manager.renameDraft}diff --git a/apps/mobile/src/device-link/DeviceManagementList.ios.tsx b/apps/mobile/src/device-link/DeviceManagementList.ios.tsxindex 98d0a9f3c9..e9c7177da8 100644--- a/apps/mobile/src/device-link/DeviceManagementList.ios.tsx+++ b/apps/mobile/src/device-link/DeviceManagementList.ios.tsx@@ -1,5 +1,6 @@+import { useMemo, useState } from 'react';import { Host, ListItem } from '@expo/ui';-import { Button, Circle, HStack, List, SwipeActions, Text } from '@expo/ui/swift-ui';+import { Button, Circle, HStack, List, Section, SwipeActions, Text } from '@expo/ui/swift-ui';import {disabled,font,@@ -8,111 +9,140 @@ import {labelStyle,listRowBackground,listStyle,+ refreshable,scrollContentBackground,tint,} from '@expo/ui/swift-ui/modifiers';import { useTranslation } from 'react-i18next';import { Monitor } from 'lucide-react-native';+import {+ buildDeviceManagementSections,+ DEVICE_MANAGEMENT_OFFLINE_PREVIEW_COUNT,+ deviceManagementStatusText,+ visibleOfflineDeviceRows,+} from '@/session/deviceManagementSections';import { useTheme } from '@/theme';-import { iconSize, iconStroke } from '@/theme/tokens';+import { iconSize, iconStroke, spacing } from '@/theme/tokens';import type { DeviceManagementListProps } from './DeviceManagementList.types';+/**+ * 设备管理列表(iOS):系统分组列表(insetGrouped),与设置页同样的分组卡片观感。+ * 在线 / 可控的设备在前;离线设备单独成组,默认只露出最近在线的几台。+ * 右滑重命名、左滑删除;下拉刷新走系统 refreshable。+ */export function DeviceManagementList({rows,busy,onOpen,onRename,onDelete,+ onRefresh,}: DeviceManagementListProps) {const { mode, colors } = useTheme();const { t } = useTranslation();- return (- <Host- style={{ flex: 1, backgroundColor: colors.surface }}- colorScheme={mode}- >- <List- modifiers={[listStyle('plain'), scrollContentBackground('hidden')]}- testID="deviceManagement.list"- >- {rows.map(({ device, statusLabel, statusDetail }) => (- <SwipeActions- key={device.deviceId}- modifiers={[listRowBackground(colors.surface)]}- >- <ListItem- onPress={() => onOpen(device)}- leading={- <Monitor- size={iconSize.md}- strokeWidth={iconStroke.regular}- color={colors.textSecondary}- />- }- supportingText={- <HStack spacing={4} alignment="center">- <Circle- modifiers={[- frame({ width: 6, height: 6 }),- foregroundStyle(device.online ? colors.statusReady : colors.textTertiary),- ]}- />- <Text- modifiers={[- font({ textStyle: 'caption' }),- foregroundStyle({- type: 'hierarchical',- style: 'secondary',- }),- ]}- >- {device.online- ? statusLabel- : `${statusLabel} · ${statusDetail}`}- </Text>- </HStack>- }- testID={`deviceManagement.open.${device.deviceId}`}- >+ const [offlineExpanded, setOfflineExpanded] = useState(false);+ const sections = useMemo(() => buildDeviceManagementSections(rows), [rows]);+ const offlineRows = visibleOfflineDeviceRows(sections.offline, offlineExpanded);+ const renderRow = (row: DeviceManagementListProps['rows'][number]) => {+ const { device } = row;+ return (+ <SwipeActions key={device.deviceId} modifiers={[listRowBackground(colors.surfaceElevated)]}>+ <ListItem+ onPress={() => onOpen(device)}+ leading={+ <Monitor+ size={iconSize.md}+ strokeWidth={iconStroke.regular}+ color={colors.textSecondary}+ />+ }+ supportingText={+ <HStack spacing={spacing.xs} alignment="center">+ {/* 状态点:可控用品牌 teal,其余(离线 / 未开远控 / 已撤销)用 borderStrong(次要图标点)。 */}+ <Circle+ modifiers={[+ frame({ width: 6, height: 6 }),+ foregroundStyle(row.canOpen ? colors.statusReady : colors.borderStrong),+ ]}+ /><Textmodifiers={[- font({- textStyle: 'body',- weight: device.online ? 'medium' : 'regular',- }),+ font({ textStyle: 'caption' }),foregroundStyle({type: 'hierarchical',- style: device.online ? 'primary' : 'secondary',+ style: 'secondary',}),]}>- {device.name}+ {deviceManagementStatusText(row)}</Text>- </ListItem>- <SwipeActions.Actions edge="leading" allowsFullSwipe={false}>- <Button- label={t('devices.list.menu.renameDevice')}- systemImage="pencil"- onPress={() => onRename(device)}- modifiers={[disabled(busy), labelStyle('iconOnly')]}- testID={`deviceManagement.rename.${device.deviceId}`}- />- </SwipeActions.Actions>- <SwipeActions.Actions edge="trailing" allowsFullSwipe={false}>+ </HStack>+ }+ testID={`deviceManagement.open.${device.deviceId}`}+ >+ <Text+ modifiers={[+ font({ textStyle: 'body', weight: 'medium' }),+ foregroundStyle({ type: 'hierarchical', style: 'primary' }),+ ]}+ >+ {device.name}+ </Text>+ </ListItem>+ <SwipeActions.Actions edge="leading" allowsFullSwipe={false}>+ <Button+ label={t('devices.list.menu.renameDevice')}+ systemImage="pencil"+ onPress={() => onRename(device)}+ modifiers={[disabled(busy), labelStyle('iconOnly')]}+ testID={`deviceManagement.rename.${device.deviceId}`}+ />+ </SwipeActions.Actions>+ <SwipeActions.Actions edge="trailing" allowsFullSwipe={false}>+ <Button+ label={t('devices.common.delete')}+ systemImage="trash"+ onPress={() => onDelete(device)}+ modifiers={[+ disabled(busy),+ tint(colors.destructive),+ labelStyle('iconOnly'),+ ]}+ testID={`deviceManagement.delete.${device.deviceId}`}+ />+ </SwipeActions.Actions>+ </SwipeActions>+ );+ };+ return (+ <Host+ style={{ flex: 1, backgroundColor: colors.surface }}+ colorScheme={mode}+ >+ <List+ modifiers={[listStyle('insetGrouped'), scrollContentBackground('hidden'), refreshable(onRefresh)]}+ testID="deviceManagement.list"+ >+ {sections.online.length > 0 ? (+ <Section title={t('devices.management.availableSection')}>+ {sections.online.map(renderRow)}+ </Section>+ ) : null}+ {sections.offline.length > 0 ? (+ <Section title={t('devices.management.offlineSection')}>+ {offlineRows.map(renderRow)}+ {sections.offline.length > DEVICE_MANAGEMENT_OFFLINE_PREVIEW_COUNT ? (<Button- label={t('devices.common.delete')}- systemImage="trash"- onPress={() => onDelete(device)}- modifiers={[- disabled(busy),- tint(colors.destructive),- labelStyle('iconOnly'),- ]}- testID={`deviceManagement.delete.${device.deviceId}`}+ label={offlineExpanded+ ? t('devices.management.showFewerOffline')+ : t('devices.management.showAllOffline', { count: sections.offline.length })}+ onPress={() => setOfflineExpanded((value) => !value)}+ modifiers={[tint(colors.textPrimary), listRowBackground(colors.surfaceElevated)]}+ testID="deviceManagement.toggleOffline"/>- </SwipeActions.Actions>- </SwipeActions>- ))}+ ) : null}+ </Section>+ ) : null}</List></Host>);diff --git a/apps/mobile/src/device-link/DeviceManagementList.tsx b/apps/mobile/src/device-link/DeviceManagementList.tsxindex e8c2173f3d..135a195c5e 100644--- a/apps/mobile/src/device-link/DeviceManagementList.tsx+++ b/apps/mobile/src/device-link/DeviceManagementList.tsx@@ -1,31 +1,94 @@-import { useRef } from 'react';-import { Pressable, ScrollView, StyleSheet, View } from 'react-native';+import { useCallback, useMemo, useRef, useState } from 'react';+import { Pressable, RefreshControl, ScrollView, StyleSheet, View } from 'react-native';import { useTranslation } from 'react-i18next';import { Monitor } from 'lucide-react-native';import { Text } from '@/components/AppText';+import { StatusDot } from '@/components/MobilePrimitives';+import { mobileInteractionStyles } from '@/components/mobileInteractionStyles';import {ClassicSwipeable,type ClassicSwipeableMethods,} from '@/platform/gestureHandler';-import { useTheme } from '@/theme';-import { fontWeight, iconSize, iconStroke, lineHeight, radius, spacing, typeScale } from '@/theme/tokens';+import {+ buildDeviceManagementSections,+ DEVICE_MANAGEMENT_OFFLINE_PREVIEW_COUNT,+ deviceManagementStatusText,+ visibleOfflineDeviceRows,+} from '@/session/deviceManagementSections';+import { SettingsGroup, useSettingsRowStyles } from '@/session/SettingsGroupRows';+import { useTheme, useThemedStyles, type ThemeColors } from '@/theme';+import { fontWeight, iconSize, iconStroke, lineHeight, spacing, typeScale } from '@/theme/tokens';import type { DeviceManagementListProps } from './DeviceManagementList.types';+/**+ * 设备管理列表(Android / 非 iOS):与设置页同一套分组卡片。+ * 在线 / 可控的设备在前;离线设备单独成组,默认只露出最近在线的几台。+ * 右滑重命名、左滑删除;下拉刷新。+ */export function DeviceManagementList(props: DeviceManagementListProps) {const openRow = useRef<ClassicSwipeableMethods | null>(null);+ const { t } = useTranslation();+ const { colors } = useTheme();+ const rowStyles = useSettingsRowStyles();+ const styles = useThemedStyles(makeStyles);+ const [offlineExpanded, setOfflineExpanded] = useState(false);+ const [refreshing, setRefreshing] = useState(false);+ const sections = useMemo(() => buildDeviceManagementSections(props.rows), [props.rows]);+ const offlineRows = visibleOfflineDeviceRows(sections.offline, offlineExpanded);+ const { onRefresh } = props;+ const refresh = useCallback(() => {+ setRefreshing(true);+ void onRefresh().finally(() => setRefreshing(false));+ }, [onRefresh]);+ const onWillOpen = (ref: ClassicSwipeableMethods | null) => {+ if (openRow.current !== ref) openRow.current?.close();+ openRow.current = ref;+ };+ const renderRow = (row: DeviceManagementListProps['rows'][number]) => (+ <DeviceRow key={row.device.deviceId} {...props} row={row} onWillOpen={onWillOpen} />+ );return (- <ScrollView onScrollBeginDrag={() => openRow.current?.close()}>- {props.rows.map((row) => (- <DeviceRow- key={row.device.deviceId}- {...props}- row={row}- onWillOpen={(ref) => {- if (openRow.current !== ref) openRow.current?.close();- openRow.current = ref;- }}+ <ScrollView+ contentContainerStyle={styles.content}+ onScrollBeginDrag={() => openRow.current?.close()}+ refreshControl={(+ <RefreshControl+ colors={[colors.textSecondary]}+ onRefresh={refresh}+ progressBackgroundColor={colors.surfaceElevated}+ refreshing={refreshing}+ tintColor={colors.textSecondary}/>- ))}+ )}+ style={styles.scroll}+ testID="deviceManagement.list"+ >+ {sections.online.length > 0 ? (+ <SettingsGroup title={t('devices.management.availableSection')}>+ {sections.online.map(renderRow)}+ </SettingsGroup>+ ) : null}+ {sections.offline.length > 0 ? (+ <SettingsGroup title={t('devices.management.offlineSection')}>+ {offlineRows.map(renderRow)}+ {sections.offline.length > DEVICE_MANAGEMENT_OFFLINE_PREVIEW_COUNT ? (+ <Pressable+ accessibilityRole="button"+ accessibilityState={{ expanded: offlineExpanded }}+ key="toggle-offline"+ onPress={() => setOfflineExpanded((value) => !value)}+ style={({ pressed }) => [rowStyles.row, pressed && rowStyles.pressed]}+ testID="deviceManagement.toggleOffline"+ >+ <Text style={styles.toggleLabel}>+ {offlineExpanded+ ? t('devices.management.showFewerOffline')+ : t('devices.management.showAllOffline', { count: sections.offline.length })}+ </Text>+ </Pressable>+ ) : null}+ </SettingsGroup>+ ) : null}</ScrollView>);}@@ -43,6 +106,7 @@ function DeviceRow({}) {const ref = useRef<ClassicSwipeableMethods | null>(null);const { colors } = useTheme();+ const styles = useThemedStyles(makeStyles);const { t } = useTranslation();const action = (remove: boolean) => (<Pressable@@ -52,9 +116,10 @@ function DeviceRow({ref.current?.close();(remove ? onDelete : onRename)(row.device);}}- style={[styles.action, { backgroundColor: colors.surfaceElevated }]}+ style={({ pressed }) => [styles.action, pressed && mobileInteractionStyles.pressed]}+ testID={`deviceManagement.${remove ? 'delete' : 'rename'}.${row.device.deviceId}`}>- <Text style={{ color: remove ? colors.destructive : colors.textPrimary }}>+ <Text style={[styles.actionLabel, remove && styles.actionLabelDestructive]}>{t(remove ? 'devices.common.delete' : 'devices.list.menu.renameDevice')}</Text></Pressable>@@ -69,13 +134,11 @@ function DeviceRow({onSwipeableWillOpen={() => onWillOpen(ref.current)}><Pressable+ accessibilityLabel={t('devices.management.openDevice', { name: row.device.name })}accessibilityRole="button"onPress={() => onOpen(row.device)}testID={`deviceManagement.open.${row.device.deviceId}`}- style={[- styles.row,- { backgroundColor: colors.surface, borderBottomColor: colors.border },- ]}+ style={({ pressed }) => [styles.row, pressed && mobileInteractionStyles.pressed]}><Monitorsize={iconSize.md}@@ -83,29 +146,12 @@ function DeviceRow({color={colors.textSecondary}/><View style={styles.labels}>- <Text- style={{- color: row.device.online- ? colors.textPrimary- : colors.textTertiary,- fontSize: typeScale.body,- lineHeight: lineHeight.body,- fontWeight: row.device.online- ? fontWeight.medium- : fontWeight.regular,- }}- >- {row.device.name}- </Text>+ <Text numberOfLines={1} style={styles.name}>{row.device.name}</Text><View style={styles.status}>- <View- style={[- styles.statusDot,- { backgroundColor: row.device.online ? colors.statusReady : colors.textTertiary },- ]}- />- <Text style={{ color: colors.textSecondary, flexShrink: 1 }}>- {row.statusLabel} · {row.statusDetail}+ {/* 状态点:可控用品牌 teal,其余(离线 / 未开远控 / 已撤销)用 muted(borderStrong)。 */}+ <StatusDot tone={row.canOpen ? 'ready' : 'muted'} />+ <Text numberOfLines={1} style={styles.statusText}>+ {deviceManagementStatusText(row)}</Text></View></View>@@ -113,23 +159,32 @@ function DeviceRow({</ClassicSwipeable>);}-const styles = StyleSheet.create({++const makeStyles = (colors: ThemeColors) => StyleSheet.create({+ scroll: { flex: 1 },+ content: { gap: spacing.xl, paddingBottom: spacing.xxl, paddingHorizontal: spacing.lg, paddingTop: spacing.lg },row: {- flexDirection: 'row',alignItems: 'center',- minHeight: 60,- padding: spacing.lg,+ backgroundColor: colors.surfaceElevated,+ flexDirection: 'row',gap: spacing.md,- borderBottomWidth: StyleSheet.hairlineWidth,+ minHeight: 60,+ paddingHorizontal: spacing.lg,+ paddingVertical: spacing.md,},- labels: { flex: 1, gap: spacing.xs },- status: { flexDirection: 'row', alignItems: 'center', gap: spacing.xs },- statusDot: { width: 6, height: 6, borderRadius: radius.pill, flexShrink: 0 },+ labels: { flex: 1, gap: spacing.xs, minWidth: 0 },+ name: { color: colors.textPrimary, fontSize: typeScale.body, fontWeight: fontWeight.medium, lineHeight: lineHeight.body },+ status: { alignItems: 'center', flexDirection: 'row', gap: spacing.sm },+ statusText: { color: colors.textTertiary, flexShrink: 1, fontSize: typeScale.caption, fontWeight: fontWeight.regular, lineHeight: lineHeight.caption },+ toggleLabel: { color: colors.textPrimary, fontSize: typeScale.body, fontWeight: fontWeight.medium, lineHeight: lineHeight.body },action: {- minWidth: 88,- minHeight: 44,alignItems: 'center',+ backgroundColor: colors.surfaceChip,justifyContent: 'center',+ minHeight: 44,+ minWidth: 88,padding: spacing.lg,},+ actionLabel: { color: colors.textPrimary, fontSize: typeScale.body, fontWeight: fontWeight.medium, lineHeight: lineHeight.body },+ actionLabelDestructive: { color: colors.destructive },});diff --git a/apps/mobile/src/device-link/DeviceManagementList.types.ts b/apps/mobile/src/device-link/DeviceManagementList.types.tsindex c4fb9ac89c..c9f061e764 100644--- a/apps/mobile/src/device-link/DeviceManagementList.types.ts+++ b/apps/mobile/src/device-link/DeviceManagementList.types.ts@@ -1,13 +1,12 @@import type { DeviceView } from '@cindy/device-link';+import type { DeviceListItem } from '@cindy/maker-shared/device-list';export interface DeviceManagementListProps {- rows: Array<{- device: DeviceView;- statusLabel: string;- statusDetail: string;- }>;+ rows: DeviceListItem<DeviceView>[];busy: boolean;onOpen(device: DeviceView): void;onRename(device: DeviceView): void;onDelete(device: DeviceView): void;+ /** 下拉刷新;Promise 在本次刷新结束(成功或失败)后 resolve。 */+ onRefresh(): Promise<void>;}diff --git a/apps/mobile/src/i18n/locales/en/composer.json b/apps/mobile/src/i18n/locales/en/composer.jsonindex 0103352456..ae52fe8ced 100644--- a/apps/mobile/src/i18n/locales/en/composer.json+++ b/apps/mobile/src/i18n/locales/en/composer.json@@ -17,7 +17,7 @@"uploadFailed": "{{name}} · Upload failed","collapsedBadge": "{{count}} attachments, tap to expand","imageNotAnnotatable": "This image can't be annotated or forwarded.",- "downloadOriginalFailed": "Could not download the original image (HTTP {{status}}).",+ "downloadOriginalFailed": "Couldn't download the original image. Try again later (HTTP {{status}}).","annotationSaveFailed": "Could not save annotation","tryAgain": "Try again.","sendToChat": "Send to Chat",@@ -25,10 +25,10 @@"fileNotFound": "File not found","pathNotReadable": "This path can't be read","readFailed": "Read failed",- "notFetchableMedia": "Not a fetchable desktop media",- "mediaResultInvalid": "Invalid remote media fetch result",+ "notFetchableMedia": "This media can't be fetched from your computer",+ "mediaResultInvalid": "Couldn't fetch the remote media. Try again","mediaUrlInvalid": "Invalid remote media download URL",- "mediaCacheMiss": "Remote media cache miss (cachedOnly)",+ "mediaCacheMiss": "This media isn't cached on your phone yet. Open it again once your computer is connected","mediaFetchCancelled": "Remote media fetch cancelled","fileMenu": {"openBrowser": "Open File Browser",@@ -49,7 +49,7 @@"integrityUnavailable": "This attachment upload body can't be integrity-checked.","sizeChanged": "Attachment size changed: expected {{expected}} bytes, got {{actual}} bytes.","invalidSize": "Invalid attachment size; can't compute the integrity digest.",- "invalidBase64": "The attachment chunk is not valid base64.",+ "invalidBase64": "Couldn't read the attachment data. Add it again and resend.","failedHttp": "Attachment upload failed: HTTP {{status}}{{code}}","failedNetwork": "Attachment upload failed: network transfer error, check your connection and try again. ({{detail}})","timeout": "Attachment upload timed out; check your connection and try again.",@@ -89,13 +89,13 @@"realtimeUnsupported": "Mobile realtime voice does not support {{detail}} ASR yet.","realtimeAuthUnsupported": "Mobile realtime voice does not support {{auth}} ASR authentication yet.","realtimeProtocolUnsupported": "Mobile realtime voice does not support the {{detail}} ASR protocol yet.",- "missingConnectionProvider": "Mobile voice input needs a {{appName}} voice session ticket (connectionProvider is missing).",+ "missingConnectionProvider": "Voice service is unavailable. Sign in to {{appName}} again and retry.","realtimeAsrFailed": "Realtime speech recognition failed.","volcengineAuthUnsupported": "Mobile Volcengine voice does not support {{auth}} authentication yet.","volcengineMissingResourceId": "The Volcengine ASR configuration is missing resourceId.",- "sessionExpiredOrForbidden": "The {{appName}} voice session has expired or lacks permission (WebSocket {{status}}). Confirm your sign-in status and try again.",+ "sessionExpiredOrForbidden": "Your {{appName}} voice sign-in has expired or lacks permission. Check your sign-in status and try again (status {{status}}).","incomplete": "Voice input didn't finish. Try again.",- "missingRefinerTargetProvider": "Mobile voice refinement needs a {{appName}} voice session (refinerTargetProvider is missing).",+ "missingRefinerTargetProvider": "Voice refinement is unavailable. Sign in to {{appName}} again and retry.","emptyTranscript": "Speech was detected but no text was recognized. Try again.","connectionInterrupted": "The voice connection was interrupted. Check your network and try again.","recognitionStalled": "Voice recognition stopped returning results. Try again.",diff --git a/apps/mobile/src/i18n/locales/en/devices.json b/apps/mobile/src/i18n/locales/en/devices.jsonindex 3e6ce99565..6037612cf7 100644--- a/apps/mobile/src/i18n/locales/en/devices.json+++ b/apps/mobile/src/i18n/locales/en/devices.json@@ -12,6 +12,10 @@"deleteFailed": "Could not delete the device.","deleteOnline": "This device is online. Take it offline before deleting it.","currentlyOnline": "Currently online",+ "availableSection": "Online",+ "offlineSection": "Offline",+ "showAllOffline": "Show All ({{count}})",+ "showFewerOffline": "Show Less","nameTooLong": "Device names must be {{limit}} characters or fewer.","fields": {"name": "Name",@@ -29,9 +33,7 @@"common": {"cancel": "Cancel","save": "Save",- "saving": "Saving","delete": "Delete",- "deleting": "Deleting","create": "New"},"resources": {@@ -47,7 +49,8 @@"openFailed": "Couldn’t open the session","resolving": "Opening the latest session…","retry": "Try again",- "hostCount": "{{count}} computers"+ "hostCount": "{{count}} computers",+ "stale": "These items may be outdated. Unable to refresh."},"presentation": {"deviceList": {@@ -177,10 +180,10 @@},"home": {"allDevices": "All",- "allComputers": "All computers",+ "allComputers": "All devices","waitingCount": "{{count}} pending","synced": "Synced",- "unknownComputer": "Unknown computer",+ "unknownComputer": "Unknown device","uncategorizedProject": "Uncategorized project","cindyMake": "Cindy Make","empty": {@@ -314,7 +317,7 @@"syncing": "Syncing","sync": "Sync again","pinnedConversations": "{{count}} pinned sessions",- "newRemoteConversation": "New remote session",+ "newRemoteConversation": "New session","renameDevice": "Rename {{label}}","project": "Project {{title}}","dialogue": "Chat",@@ -537,7 +540,7 @@},"runNow": "Run now","error": {- "projectMissingConfig": "This project automation is missing projectConfigId. Delete it on the desktop.",+ "projectMissingConfig": "This project automation is missing its project settings. Delete it on your computer.","deletePartial": "Automation deleted, but {{count}} generated sessions couldn't be updated. Check them on the desktop."},"subtitle": "{{active}} running · {{total}} tasks",@@ -606,6 +609,8 @@"useWorktree": "Use worktree","modelPlaceholderBound": "Follow session","modelPlaceholderPiDefault": "Leave blank for default model",+ "boundSessionIdPlaceholder": "Session ID",+ "effortDefault": "Default","fastMode": "Fast Mode","notifyDesktop": "Desktop Notifications","notifyFeishu": "Feishu Notifications",@@ -635,7 +640,6 @@"detailFallback": "Pausing stops this automation from triggering.","previewFallback": "No runs in progress","confirmA11y": "Confirm pausing automation",- "pausing": "Pausing","confirm": "Confirm Pause","cancelA11y": "Cancel pausing automation"},@@ -705,7 +709,6 @@"promptEmpty": "No task prompt saved","deleteA11y": "Delete automation","runNowA11y": "Run automation now",- "running": "Running","resumeA11y": "Resume automation","pauseA11y": "Pause automation","resume": "Resume",@@ -715,13 +718,10 @@},"run": {"openSessionA11y": "Open automation session",- "opening": "Opening","session": "Session","restartA11y": "Re-run automation",- "restarting": "Re-running","restart": "Re-run","markReadA11y": "Mark run record as read",- "marking": "Marking","markRead": "Read","deleteA11y": "Delete run record"},@@ -779,7 +779,7 @@"unknownTime": "Unknown time","status": {"running": "Running",- "success": "Succeeded",+ "success": "Completed","failed": "Failed","aborted": "Aborted","interrupted": "Interrupted",@@ -812,6 +812,7 @@}},"companions": {+ "noCreateHosts": "No compatible computer is available. Open Cindy on a computer and sign in with the same account to create a teammate.","messageSent": "Message sent to background task","sentTo": "Sent a message to {{name}}","receivedFrom": "Message from {{name}}",@@ -841,13 +842,13 @@"unread": "New reply","status": {"queued": "Getting started",- "running": "Working on it",+ "running": "Running","waiting": "Waiting for input",- "completed": "Done",+ "completed": "Completed","failed": "Failed","cancelled": "Stopped","timed-out": "Timed out",- "unknown": "Task status unavailable"+ "unknown": "Unknown status"},"title": "Teammates","tasks": "Sessions",diff --git a/apps/mobile/src/i18n/locales/en/files.json b/apps/mobile/src/i18n/locales/en/files.jsonindex 326e5eb56c..0e70c929f0 100644--- a/apps/mobile/src/i18n/locales/en/files.json+++ b/apps/mobile/src/i18n/locales/en/files.json@@ -131,6 +131,7 @@"browserCancelAddress": "Cancel editing","browserReturnToFile": "Return to file","browserCopyAddress": "Copy address",+ "browserCopiedAddress": "Address copied","browserInvalidAddress": "Enter a valid http or https address.","browserWebsiteFailed": "Unable to open this webpage. Try reloading."},@@ -140,6 +141,6 @@"exportTimeout": "Export timed out. Try again."},"gallery": {- "cacheMiss": "Remote media cache miss (cachedOnly)"+ "cacheMiss": "This media isn't cached on your phone yet. Open it again once your computer is connected"}}diff --git a/apps/mobile/src/i18n/locales/en/interaction.json b/apps/mobile/src/i18n/locales/en/interaction.jsonindex 2413f86c31..9e11f0c62e 100644--- a/apps/mobile/src/i18n/locales/en/interaction.json+++ b/apps/mobile/src/i18n/locales/en/interaction.json@@ -20,7 +20,13 @@"allowOnceAccessibility": "Allow permission request once","allowOnceConfirm": "Confirm allow once","highRisk": "High risk",- "autoReviewUnavailable": "Automatic review could not finish. Confirm whether to allow this action."+ "autoReviewUnavailable": "Automatic review could not finish. Confirm whether to allow this action.",+ "fullAccessConfirm": {+ "title": "Enable Full access?",+ "description": "Full access disables the workspace sandbox and skips routine approvals. {{appName}} can modify files outside the workspace and run network commands without asking; built-in high-risk operations will still require confirmation.",+ "confirm": "Enable Full access",+ "cancel": "Keep current permissions"+ }},"planMode": {"label": "Plan mode",diff --git a/apps/mobile/src/i18n/locales/en/message.json b/apps/mobile/src/i18n/locales/en/message.jsonindex 93845c78db..92d01de1f4 100644--- a/apps/mobile/src/i18n/locales/en/message.json+++ b/apps/mobile/src/i18n/locales/en/message.json@@ -67,6 +67,9 @@"subagentTyped": "Subagent · {{type}}","subagent": "Subagent","workedDuration": "Worked {{duration}}",+ "durationSeconds": "{{seconds}}s",+ "durationMinutes": "{{minutes}}m",+ "durationMinutesSeconds": "{{minutes}}m {{seconds}}s","subagentSummary": "Subagent summary","agentSwitchLabel": "Switched from {{from}} to {{to}}","agentSwitchViewHandoff": "{{label}}, view handoff",@@ -90,7 +93,6 @@"retryFetch": "Retry Fetch","openMedia": "Open Media","readCurrentRemoteFile": "Read current remote file",- "reading": "Reading","retryFilePreview": "Retry File Preview","readCurrentFile": "Read Current File","currentFilePreview": "Current file preview",@@ -123,17 +125,17 @@"mediaSize": "Size: {{size}}","mediaExpiresAt": "Expires at: {{time}}","mediaErrorLine": "Error: {{message}}",- "mediaDeviceLinkHint": "The mobile app will request the remote device to upload the media via device-link before opening it.",+ "mediaDeviceLinkHint": "Before opening, your phone asks the remote device to upload this media.","controlDelete": "Delete message",- "controlRewind": "Rewind to here",- "controlFork": "Fork session",+ "controlRewind": "Back to here",+ "controlFork": "Start new session from here","markdownDocAriaLabel": "Message body","toolOutputTitle": "{{label}} output","toolInputTitle": "{{label}} input","viewToolInput": "View full input","loadingToolInput": "Loading full input","retryToolInput": "Couldn't load input. Retry",- "toolResultCompacted": "Full tool output was released (original size {{size}})",+ "toolResultCompacted": "Full tool output was trimmed (original size {{size}})","mermaidEmpty": "Empty Mermaid diagram.","diffEditCount": "{{n}} edits"},@@ -312,7 +314,7 @@"inlineMediaData": "Inline {{kind}} data","mediaActionsAvailable": "The desktop app offers follow-up actions for this media.","availableActions": "Available actions: {{actions}}",- "mediaActionsDesktopOnly": "Mobile V1 only displays these actions and does not trigger them remotely yet. Return to the desktop app to select one.",+ "mediaActionsDesktopOnly": "For now, these actions can only be viewed on your phone. Use them on your computer.","moreEdits": "…{{count}} more edits"},"quote": {diff --git a/apps/mobile/src/i18n/locales/en/remoteDesktop.json b/apps/mobile/src/i18n/locales/en/remoteDesktop.jsonindex 22c84244ad..9b9802ca18 100644--- a/apps/mobile/src/i18n/locales/en/remoteDesktop.json+++ b/apps/mobile/src/i18n/locales/en/remoteDesktop.json@@ -159,7 +159,7 @@"lockOnExit": "Lock Computer on Exit","lockOnExitHint": "Locks when you leave remote desktop. Reconnecting or switching apps does not lock the computer.","lockOnExitFailed": "Could not confirm that the computer locked. Check the computer before leaving it unattended.",- "hostMute": "Mute controlled computer",- "hostMuteHint": "Mute the controlled computer while connected",- "hostMuteFailed": "Unable to change controlled computer mute state"+ "hostMute": "Mute remote computer",+ "hostMuteHint": "Mute the remote computer while connected",+ "hostMuteFailed": "Couldn't change the remote computer's mute setting"}diff --git a/apps/mobile/src/i18n/locales/en/session.json b/apps/mobile/src/i18n/locales/en/session.jsonindex 21425a73ac..baccbd6bd2 100644--- a/apps/mobile/src/i18n/locales/en/session.json+++ b/apps/mobile/src/i18n/locales/en/session.json@@ -29,18 +29,18 @@"openMicPermission": "Open microphone settings","maxAttachments": "You can add up to {{max}} attachments.","voiceStopRecording": "Stop Recording",- "capabilitiesUnsupported": "Unsupported remote capability format"+ "capabilitiesUnsupported": "Couldn't load commands and resources from your computer. Update Cindy on your computer and try again."},"presentation": {"collaboration": {"labelLead": "Collaboration Lead","labelWorker": "Collaboration Worker","labelRole": "Collaboration {{role}}",- "noticeLead": "This is an Orca Lead session from your computer. You can keep chatting on your phone; create workers, change focus, fork or rewind, edit the queue, and change session settings on your computer.",- "noticeWorker": "This is an Orca Worker session from your computer. The first mobile version is read-only and does not support sending messages, changing worker focus, archiving a worker, or stopping collaboration.",- "noticeOther": "This is a collaboration session from your computer. The first mobile version is read-only; manage collaboration on your computer.",- "readOnlyReason": "Collaboration is read-only on the first mobile version. Handle confirmations, queue edits, and session changes on your computer.",- "composerReadOnlyReason": "This collaboration subtask is read-only on mobile. Send messages from your computer."+ "noticeLead": "This is an Orca Lead session from your computer. You can keep chatting on your phone; create workers, change focus, go back to a message, start a new session from a message, edit the queue, and change session settings on your computer.",+ "noticeWorker": "This is an Orca Worker session from your computer. For now, you can only view it on your phone. Send messages, change worker focus, archive a worker, or stop collaboration on your computer.",+ "noticeOther": "This is a collaboration session from your computer. For now, you can only view it on your phone; manage collaboration on your computer.",+ "readOnlyReason": "For now, collaboration sessions can only be viewed on your phone. Handle confirmations, queue edits, and session changes on your computer.",+ "composerReadOnlyReason": "For now, this collaboration subtask can only be viewed on your phone. Send messages from your computer."},"composer": {"voice": {@@ -212,7 +212,7 @@"shareUnsupported": "This app version doesn't support sharing yet; update to the latest version and try again.","downloadFailed": "Download failed","voiceNoRemoteDevice": "No remote device available; can't start voice input.",- "voiceSenderNotReady": "The message sender isn't ready.",+ "voiceSenderNotReady": "Messages can't be sent right now. Go back and reopen the session.","voiceStopAndSend": "End voice input and send","sendMessage": "Send remote message","voiceStartInput": "Start voice input",@@ -333,7 +333,7 @@"selectDir": "Select directory {{name}}","select": "Select","noModelSelected": "No model selected",- "assignedDialogueDir": "Directory assigned by the computer",+ "assignedDialogueDir": "Working directory assigned by the computer","extraDirsSuffix": "+{{num}} extra dirs","noProjectPath": "No project path selected","dialogueWorkspace": "Chat workspace",@@ -364,7 +364,7 @@"worktreeNotGitRepo": "Current directory is not a git repository","worktreeAlreadyInWorktree": "Already inside a worktree, nesting is not allowed","worktreeDetectFailed": "Could not check this directory — reselect it later and try again",- "worktreeUnsupported": "This desktop cannot safely create worktrees. Turn worktree off to continue, or update the desktop app.",+ "worktreeUnsupported": "Cindy on your computer can't safely create worktrees. Turn worktree off to continue, or update Cindy on your computer.","worktreeCreateFailed": "Failed to create worktree: {{message}}","worktreeRecoveryStateFailed": "Could not save the worktree recovery state. Try again.","worktreeCleanupPending": "The previous worktree is still awaiting cleanup. Reconnect the device and try again."@@ -456,7 +456,6 @@"contextLabel": "Context","accountLimits": "Account limits","quotaExhaustedResettable": "Your quota is used up. Resetting uses 1 reset immediately and can't be undone.",- "resetting": "Resetting…","resetCodexUsage": "Reset Codex usage","quotaExhaustedNoCredit": "Your quota is used up, but you have no reset credits available.","openDir": "Open Directory",@@ -474,7 +473,8 @@"noSubDirs": "This directory has no subdirectories to open.","dirLimitNotice": "Showing the first 30 directories only; open a more specific directory to keep choosing.","confirmRename": "Confirm rename",- "confirm": "Confirm",+ "renameSubmit": "Rename",+ "confirm": "Rename","cancelRename": "Cancel rename","backToMenu": "Back to session menu"},@@ -500,8 +500,8 @@"toolUseLoopDetectedConsecutiveWithCount": "The model repeated the same tool call {{count}} times, so Cindy stopped this turn to prevent an infinite loop. Send a new message to continue.","toolUseLoopDetectedPingPongWithCount": "The model kept cycling between tool calls, so Cindy stopped this turn after detecting {{count}} calls in the loop. Send a new message to continue.","toolUseLoopDetectedRotationWithCount": "The model kept rotating through tool calls, so Cindy stopped this turn after detecting {{count}} calls in the loop. Send a new message to continue.",- "codexThreadLost": "The Codex auth mode changed, so this session can't continue — start a new session to apply it.",- "encryptedContentInvalid": "Switching providers made the encryption unavailable, so this session works only under the original provider. Handle it on the computer (you can Fork to drop the encrypted protocol content and continue in a new session)."+ "codexThreadLost": "The Codex auth mode changed, so this session can't continue. Start a new session.",+ "encryptedContentInvalid": "Switching providers made the encryption unavailable, so this session works only under the original provider. Handle it on the computer (use “Start new session from here” to drop the encrypted protocol content and continue in a new session)."},"row": {"moreOptions": "More options",@@ -518,6 +518,8 @@"authGateHint": "{{agent}} has no connected model provider on this computer, so sending will fail. Set it up in {{appName}} on the computer under Settings → Model Providers."},"outbox": {+ "deleteConfirmTitle": "Delete this message?",+ "deleteConfirmBody": "This message wasn't sent. Deleting it can't be undone.","legacyPlanRecovery": "This computer cannot restore saved messages in Plan mode. Turn off Plan mode or update Cindy on the computer, then retry.","creationRecoveryRequired": "Retry creating this task before deleting its first message. That message keeps the recovery details for your later messages.","confirmationRequired": "This computer cannot confirm whether the message was received. Check its history or update Cindy before retrying.",@@ -529,15 +531,15 @@"remoteError": {"REMOTE_DAEMON_CLOSED": "The remote connection dropped, possibly during an update. This turn has ended. Send the message again.","REMOTE_LOCAL_ATTACHMENT_UNSUPPORTED": "Local file/image attachments aren't accessible in remote sessions. Paste the content directly instead.",- "AUTO_REVIEW_UNAVAILABLE": "Auto-review could not reach a decision, so actions that need review now need your confirmation. Switch this task to Full access if you would rather not be interrupted. That mode is higher risk.",- "AUTO_REVIEW_UNAVAILABLE_WECHAT": "Auto-review could not reach a decision, so actions that need review now need your confirmation. Personal WeChat cannot use Full access. Confirm this action directly.",- "AUTO_REVIEW_CONFIRM_UNDELIVERED": "Automatic review was unavailable, and the confirmation request was not completed. This is not a user rejection.",+ "AUTO_REVIEW_UNAVAILABLE": "Auto approve could not reach a decision, so actions that need approval now need your confirmation. Switch this session to Full access if you would rather not be interrupted. That mode is higher risk.",+ "AUTO_REVIEW_UNAVAILABLE_WECHAT": "Auto approve could not reach a decision, so actions that need approval now need your confirmation. Personal WeChat cannot use Full access. Confirm this action directly.",+ "AUTO_REVIEW_CONFIRM_UNDELIVERED": "Auto approve was unavailable, and the confirmation request was not completed. This is not a user rejection.","REMOTE_COMPAT_MODE_UNSUPPORTED": "Remote tasks cannot use this computer’s compatibility route. Switch to Cindy AI, or continue in a local task.",- "REMOTE_GATEWAY_ENDPOINT_UNAVAILABLE": "Cindy AI credentials are not ready yet (issued automatically after sign-in). Please retry shortly; if this persists, check the Cindy AI status in Settings → Model Providers.",+ "REMOTE_GATEWAY_ENDPOINT_UNAVAILABLE": "Cindy AI credentials are not ready yet (issued automatically after sign-in). Try again shortly. If this persists, check the Cindy AI status in Settings → Model Providers.","REMOTE_LOCAL_ONLY_PROVIDER": "This model provider is a local-only service (e.g. Ollama) that a remote SSH task cannot reach. Switch to the Cindy AI gateway, or pick a provider reachable from the remote host.","DEVICE_LINK_CONTROL_DISABLED": "Control for this device is off; the message was not sent.","DEVICE_LINK_MEDIA_TRANSFER_FAILED": "Attachment transfer failed; the message was not sent. Please try again.",- "MCP_APPROVAL_AUTO_BLOCKED": "Automatic approval review blocked this tool call. No manual rejection was received.",+ "MCP_APPROVAL_AUTO_BLOCKED": "Auto approve blocked this tool call. No manual rejection was received.","MCP_APPROVAL_CONFIRMATION_TIMEOUT": "The permission request timed out without a confirmed decision. A timeout does not show whether you clicked a button.","MCP_APPROVAL_CONFIRMATION_UNAVAILABLE": "Permission confirmation could not be completed. No manual rejection was received.","REMOTE_HOST_PROXY_FORWARD_UNAVAILABLE": "This model needs this computer to forward requests, and the remote connection cannot do that yet. Switch to Cindy AI, or use this model in a local task.",diff --git a/apps/mobile/src/i18n/locales/en/settings.json b/apps/mobile/src/i18n/locales/en/settings.jsonindex 24d5185ea9..fb90521497 100644--- a/apps/mobile/src/i18n/locales/en/settings.json+++ b/apps/mobile/src/i18n/locales/en/settings.json@@ -19,8 +19,8 @@"cancel": "Cancel","exportHint": "Share detailed local logs for troubleshooting. No conversation content or credentials.","options": "Log options",- "uploadCopied": "Uploaded. Code {{code}} copied.",- "uploadSucceeded": "Uploaded. Code {{code}}."+ "uploadCopied": "Logs uploaded. Code {{code}} copied",+ "uploadSucceeded": "Logs uploaded. Code {{code}}"},"title": "Settings","appearance": {@@ -47,15 +47,14 @@},"version": {"sectionTitle": "Version",- "currentLabel": "Current Version",- "bundleVersion": "App package {{version}}",- "otaVersion": "OTA version {{version}}",+ "appVersion": "Version {{version}}",+ "updateMethodInApp": "Updates: installed in the app, applied after a restart",+ "updateMethodPackage": "Updates: download and install the new version",+ "updateMethodUnavailable": "Development build; in-app updates aren’t available","pairedDesktopVersion": "Matching desktop release {{version}}",- "devNoOta": "Development build; OTA updates unavailable","checkAction": "Check for Updates","testFlightCheckAction": "Check for Content Updates","checking": "Checking",- "updating": "Updating","checkingAccessibility": "Checking for updates","testFlightCheckingAccessibility": "Checking for content updates","testFlightUpdateManaged": "TestFlight manages test build updates",@@ -144,7 +143,8 @@"runtime": "Runtime","otaMarker": "OTA Marker","emergencyLaunch": "Emergency Launch",- "emergencyLaunchYes": "Yes (OTA cannot apply in this run)"+ "emergencyLaunchYes": "Yes (OTA cannot apply in this run)",+ "otaVersion": "OTA version"},"legal": {"sectionTitle": "Legal",@@ -161,6 +161,8 @@"analyticsResetAction": "Reset"},"account": {+ "logoutConfirmTitle": "Sign out?",+ "logoutConfirmRunning": "Some sessions are still running. They keep running on your computer, but this phone stops receiving and controlling them, and every account and local mirror saved on this phone is cleared.","logoutHint": "Signing out clears every account saved on this phone and its local remote mirror. Sessions on your computer are not affected.","logout": "Sign Out","loggingOut": "Signing out",@@ -193,9 +195,12 @@"resetAccessibility": "Restore the default phone name","emptyError": "Device name cannot be empty.","deviceInitializing": "The device is still initializing. Try again later.",- "saving": "Saving…",- "saved": "Saved.",- "restoringDefault": "Restoring the default name…",- "restoredDefault": "Restored the default name."+ "restoredDefault": "Restored the default name.",+ "resetAction": "Restore Default Name",+ "clearAccessibility": "Clear name",+ "discardTitle": "Discard Changes?",+ "discardBody": "Your changes to the device name haven’t been saved.",+ "discardConfirm": "Discard Changes",+ "keepEditing": "Keep Editing"}}diff --git a/apps/mobile/src/i18n/locales/en/sharedTask.json b/apps/mobile/src/i18n/locales/en/sharedTask.jsonindex 17ad5fae5f..a7a7320eb2 100644--- a/apps/mobile/src/i18n/locales/en/sharedTask.json+++ b/apps/mobile/src/i18n/locales/en/sharedTask.json@@ -42,7 +42,7 @@"joined": "Joined Shared Task","joinedBody": "You can view earlier messages, tool results and attachments, and message the same Agent.","enterTask": "Enter Task",- "inviteBoxTitle": "Send the invitation to your teammates",+ "inviteBoxTitle": "Send the invitation to people you want to work with","roleGuest": "Guest","removeShort": "Remove","removeNamedTitle": "Remove {{name}}?",diff --git a/apps/mobile/src/i18n/locales/ja/composer.json b/apps/mobile/src/i18n/locales/ja/composer.jsonindex aa4dae295e..b1a8dec93f 100644--- a/apps/mobile/src/i18n/locales/ja/composer.json+++ b/apps/mobile/src/i18n/locales/ja/composer.json@@ -25,10 +25,10 @@"fileNotFound": "ファイルが見つかりません","pathNotReadable": "このパスは読み取りが許可されていません","readFailed": "読み取りに失敗しました",- "notFetchableMedia": "取得できるデスクトップメディアではありません",- "mediaResultInvalid": "リモートメディアの取得結果が無効です",+ "notFetchableMedia": "このメディアはパソコンから取得できません",+ "mediaResultInvalid": "リモートメディアを取得できませんでした。もう一度お試しください","mediaUrlInvalid": "リモートメディアのダウンロードURLが無効です",- "mediaCacheMiss": "リモートメディアのキャッシュにありません(cachedOnly)",+ "mediaCacheMiss": "このメディアはまだスマートフォンにキャッシュされていません。パソコンに接続できるときにもう一度開いてください","mediaFetchCancelled": "リモートメディアの取得をキャンセルしました","fileMenu": {"openBrowser": "ファイルブラウザーを開く",@@ -49,7 +49,7 @@"integrityUnavailable": "この添付ファイルのアップロード本文は整合性チェックができません。","sizeChanged": "添付ファイルのサイズが変更されました。予期: {{expected}} バイト、実際: {{actual}} バイト。","invalidSize": "添付ファイルのサイズが無効なため、整合性ダイジェストを計算できません。",- "invalidBase64": "添付ファイルのチャンクが有効なbase64ではありません。",+ "invalidBase64": "添付ファイルのデータを読み取れませんでした。もう一度追加してから送信してください。","failedHttp": "添付ファイルのアップロードに失敗しました: HTTP {{status}}{{code}}","failedNetwork": "添付ファイルのアップロードに失敗しました。ネットワーク転送エラーです。接続を確認してからやり直してください。({{detail}})","timeout": "添付ファイルのアップロードがタイムアウトしました。接続を確認してからやり直してください。",@@ -89,13 +89,13 @@"realtimeUnsupported": "モバイル版のリアルタイム音声は {{detail}} ASR にまだ対応していません。","realtimeAuthUnsupported": "モバイル版のリアルタイム音声は {{auth}} ASR 認証にまだ対応していません。","realtimeProtocolUnsupported": "モバイル版のリアルタイム音声は {{detail}} ASR プロトコルにまだ対応していません。",- "missingConnectionProvider": "モバイル音声入力には {{appName}} の音声セッションチケットが必要です(connectionProvider がありません)。",+ "missingConnectionProvider": "音声サービスを利用できません。{{appName}} にもう一度ログインしてから再試行してください。","realtimeAsrFailed": "リアルタイム音声認識に失敗しました。","volcengineAuthUnsupported": "モバイル版の Volcengine 音声は {{auth}} 認証にまだ対応していません。","volcengineMissingResourceId": "Volcengine ASR の設定に resourceId がありません。",- "sessionExpiredOrForbidden": "{{appName}} の音声セッションが失効したか権限がありません(WebSocket {{status}})。ログイン状態を確認してからやり直してください。",+ "sessionExpiredOrForbidden": "{{appName}} の音声サービスのログインが失効したか、権限がありません。ログイン状態を確認してからやり直してください(ステータス {{status}})。","incomplete": "音声入力が完了しませんでした。もう一度お試しください。",- "missingRefinerTargetProvider": "モバイル版の音声推敲には {{appName}} の音声セッションが必要です(refinerTargetProvider がありません)。",+ "missingRefinerTargetProvider": "音声の推敲を利用できません。{{appName}} にもう一度ログインしてから再試行してください。","emptyTranscript": "音声を検出しましたが、テキストを認識できませんでした。もう一度お試しください。","connectionInterrupted": "音声接続が中断されました。ネットワークを確認してからやり直してください。","recognitionStalled": "音声認識の結果が返ってこなくなりました。もう一度お試しください。",diff --git a/apps/mobile/src/i18n/locales/ja/devices.json b/apps/mobile/src/i18n/locales/ja/devices.jsonindex 97eed25ad8..f64b3f02f2 100644--- a/apps/mobile/src/i18n/locales/ja/devices.json+++ b/apps/mobile/src/i18n/locales/ja/devices.json@@ -12,6 +12,10 @@"deleteFailed": "デバイスを削除できませんでした。","deleteOnline": "デバイスがオンラインです。オフラインにしてから削除してください。","currentlyOnline": "現在オンライン",+ "availableSection": "オンラインのデバイス",+ "offlineSection": "オフラインのデバイス",+ "showAllOffline": "すべて表示({{count}} 台)",+ "showFewerOffline": "表示を減らす","nameTooLong": "デバイス名は {{limit}} 文字以内で入力してください。","fields": {"name": "名前",@@ -29,9 +33,7 @@"common": {"cancel": "キャンセル","save": "保存",- "saving": "保存中","delete": "削除",- "deleting": "削除中","create": "新規"},"resources": {@@ -47,7 +49,8 @@"openFailed": "セッションを開けませんでした","resolving": "最新のセッションを開いています…","retry": "もう一度試す",- "hostCount": "{{count}} 台のコンピュータ"+ "hostCount": "{{count}} 台のコンピュータ",+ "stale": "内容が古い可能性があります。更新できません。"},"presentation": {"deviceList": {@@ -177,10 +180,10 @@},"home": {"allDevices": "すべて",- "allComputers": "すべてのコンピューター",+ "allComputers": "すべてのデバイス","waitingCount": "保留中 {{count}} 件","synced": "同期済み",- "unknownComputer": "不明なコンピューター",+ "unknownComputer": "不明なデバイス","uncategorizedProject": "未分類のプロジェクト","cindyMake": "Cindy Make","empty": {@@ -314,7 +317,7 @@"syncing": "再同期中","sync": "再同期","pinnedConversations": "ピン留めしたセッション {{count}} 件",- "newRemoteConversation": "新しいリモートセッション",+ "newRemoteConversation": "新しいセッション","renameDevice": "{{label}} の名前を変更","project": "プロジェクト {{title}}","dialogue": "チャット",@@ -537,7 +540,7 @@},"runNow": "今すぐ実行","error": {- "projectMissingConfig": "プロジェクト自動化に projectConfigId がありません。デスクトップで削除してください。",+ "projectMissingConfig": "このプロジェクト自動化にはプロジェクト設定がありません。パソコンで削除してください。","deletePartial": "自動化を削除しましたが、{{count}} 件の生成されたセッションの状態を更新できませんでした。デスクトップでこれらのセッションを確認してください。"},"subtitle": "実行中 {{active}} 件 · タスク {{total}} 件",@@ -606,6 +609,8 @@"useWorktree": "worktree を使用","modelPlaceholderBound": "セッションに従う","modelPlaceholderPiDefault": "空欄でデフォルトモデル",+ "boundSessionIdPlaceholder": "セッション ID",+ "effortDefault": "デフォルト","fastMode": "Fast モード","notifyDesktop": "デスクトップ通知","notifyFeishu": "Feishu 通知",@@ -635,7 +640,6 @@"detailFallback": "一時停止すると、この自動化のトリガーが止まります。","previewFallback": "実行中の run はありません","confirmA11y": "自動化の一時停止を確定",- "pausing": "一時停止中","confirm": "一時停止を確定","cancelA11y": "自動化の一時停止をキャンセル"},@@ -705,7 +709,6 @@"promptEmpty": "タスクのプロンプトが保存されていません","deleteA11y": "自動化を削除","runNowA11y": "自動化を今すぐ実行",- "running": "実行中","resumeA11y": "自動化を再開","pauseA11y": "自動化を一時停止","resume": "再開",@@ -715,13 +718,10 @@},"run": {"openSessionA11y": "自動化セッションを開く",- "opening": "開いています","session": "セッション","restartA11y": "自動化を再実行",- "restarting": "再実行中","restart": "再実行","markReadA11y": "実行記録を既読にする",- "marking": "マーク中","markRead": "既読","deleteA11y": "実行記録を削除"},@@ -779,7 +779,7 @@"unknownTime": "時刻不明","status": {"running": "実行中",- "success": "成功",+ "success": "完了","failed": "失敗","aborted": "中止済み","interrupted": "中断",@@ -812,6 +812,7 @@}},"companions": {+ "noCreateHosts": "対応するコンピュータを利用できません。パソコンで Cindy を開き、同じアカウントでログインするとチームメイトを新規作成できます。","messageSent": "バックグラウンドタスクにメッセージを送信しました","sentTo": "{{name}} にメッセージを送信","receivedFrom": "{{name}} からのメッセージ",@@ -836,18 +837,18 @@"messages": "メッセージ","readOnly": "閲覧のみ","directEmpty": "表示できるメッセージはまだありません。",- "directLimitReached": "今回の会話は上限に達し、双方がそれぞれのメインタスクに戻りました",- "directUnavailable": "この仲間同士の会話は利用できません。",+ "directLimitReached": "今回の会話は上限に達し、双方がそれぞれのメインセッションに戻りました",+ "directUnavailable": "このチームメイト同士の会話は利用できません。","unread": "新しい返信","status": {"queued": "開始しています",- "running": "作業中",+ "running": "実行中","waiting": "対応待ち","completed": "完了","failed": "失敗","cancelled": "停止済み","timed-out": "タイムアウト",- "unknown": "タスクの状況を確認できません"+ "unknown": "状態不明"},"title": "チームメイト","tasks": "セッション",@@ -1014,7 +1015,7 @@"memorySaveFailed": "保存できませんでした。編集内容は保持されています。","memoryMissing": "この記憶はもう存在しません。","memoryDeleteFailed": "削除できませんでした",- "create": "新しいチームメイト",+ "create": "チームメイトを新規作成","createFailed": "作成結果を確認できていません。再試行して確認してください。","title": "チームメイト","profile": "プロフィールと性格",diff --git a/apps/mobile/src/i18n/locales/ja/files.json b/apps/mobile/src/i18n/locales/ja/files.jsonindex c7946e6beb..40dce165f6 100644--- a/apps/mobile/src/i18n/locales/ja/files.json+++ b/apps/mobile/src/i18n/locales/ja/files.json@@ -131,6 +131,7 @@"browserCancelAddress": "編集をキャンセル","browserReturnToFile": "ファイルに戻る","browserCopyAddress": "アドレスをコピー",+ "browserCopiedAddress": "アドレスをコピーしました","browserInvalidAddress": "有効な http または https アドレスを入力してください。","browserWebsiteFailed": "ウェブページを開けません。再読み込みしてください。"},@@ -140,6 +141,6 @@"exportTimeout": "書き出しがタイムアウトしました。もう一度お試しください。"},"gallery": {- "cacheMiss": "リモートメディアのキャッシュミス(cachedOnly)"+ "cacheMiss": "このメディアはまだスマートフォンにキャッシュされていません。パソコンに接続できるときにもう一度開いてください"}}diff --git a/apps/mobile/src/i18n/locales/ja/interaction.json b/apps/mobile/src/i18n/locales/ja/interaction.jsonindex 9f943a465c..2ff888582b 100644--- a/apps/mobile/src/i18n/locales/ja/interaction.json+++ b/apps/mobile/src/i18n/locales/ja/interaction.json@@ -20,7 +20,13 @@"allowOnceAccessibility": "権限リクエストを1回だけ許可","allowOnceConfirm": "1回だけ許可を確認","highRisk": "高リスク",- "autoReviewUnavailable": "自動レビューを完了できませんでした。この操作を許可するか確認してください。"+ "autoReviewUnavailable": "自動レビューを完了できませんでした。この操作を許可するか確認してください。",+ "fullAccessConfirm": {+ "title": "フルアクセスを有効にしますか?",+ "description": "フルアクセスはワークスペースのサンドボックスを無効にし、通常の承認を省略します。{{appName}} はワークスペース外のファイル変更やネットワークコマンドを確認なしで実行できます。組み込みの高リスク操作では引き続き確認が必要です。",+ "confirm": "フルアクセスを有効にする",+ "cancel": "現在の権限を維持"+ }},"planMode": {"label": "プランモード",diff --git a/apps/mobile/src/i18n/locales/ja/message.json b/apps/mobile/src/i18n/locales/ja/message.jsonindex c2a5b24528..fccd5bb9f0 100644--- a/apps/mobile/src/i18n/locales/ja/message.json+++ b/apps/mobile/src/i18n/locales/ja/message.json@@ -67,6 +67,9 @@"subagentTyped": "サブエージェント · {{type}}","subagent": "サブエージェント","workedDuration": "作業時間 {{duration}}",+ "durationSeconds": "{{seconds}}秒",+ "durationMinutes": "{{minutes}}分",+ "durationMinutesSeconds": "{{minutes}}分{{seconds}}秒","subagentSummary": "サブエージェントの要約","agentSwitchLabel": "{{from}} から {{to}} に切り替えました","agentSwitchViewHandoff": "{{label}}、引き継ぎ内容を表示",@@ -90,7 +93,6 @@"retryFetch": "取得を再試行","openMedia": "メディアを開く","readCurrentRemoteFile": "現在のリモートファイルを読み取り",- "reading": "読み取り中","retryFilePreview": "ファイルプレビューを再試行","readCurrentFile": "現在のファイルを読み取り","currentFilePreview": "現在のファイルのプレビュー",@@ -123,17 +125,17 @@"mediaSize": "サイズ: {{size}}","mediaExpiresAt": "有効期限: {{time}}","mediaErrorLine": "エラー: {{message}}",- "mediaDeviceLinkHint": "モバイルは device-link 経由でリモートデバイスにメディアのアップロードを要求してから開きます。",+ "mediaDeviceLinkHint": "開く前に、スマートフォンからリモートデバイスにこのメディアのアップロードを依頼します。","controlDelete": "メッセージを削除",- "controlRewind": "ここまで戻す",- "controlFork": "セッションを分岐",+ "controlRewind": "ここまで戻る",+ "controlFork": "ここから新しいセッションを始める","markdownDocAriaLabel": "メッセージ本文","toolOutputTitle": "{{label}} の出力","toolInputTitle": "{{label}} の入力","viewToolInput": "完全な入力を表示","loadingToolInput": "完全な入力を読み込み中","retryToolInput": "入力を読み込めませんでした。再試行",- "toolResultCompacted": "Full tool output was released (original size {{size}})",+ "toolResultCompacted": "完全なツール出力は省略されました(元のサイズ {{size}})","mermaidEmpty": "空の Mermaid 図。","diffEditCount": "{{n}} 件の編集"},@@ -312,7 +314,7 @@"inlineMediaData": "インライン{{kind}}データ","mediaActionsAvailable": "デスクトップアプリでは、このメディアの追加操作を利用できます。","availableActions": "利用可能な操作:{{actions}}",- "mediaActionsDesktopOnly": "モバイル版 V1 ではこれらの操作を表示するだけで、リモート実行はまだできません。デスクトップアプリに戻って選択してください。",+ "mediaActionsDesktopOnly": "スマートフォンでは現在これらの操作を表示するだけです。パソコンで操作してください。","moreEdits": "…ほか {{count}} 件の編集"},"quote": {diff --git a/apps/mobile/src/i18n/locales/ja/models.json b/apps/mobile/src/i18n/locales/ja/models.jsonindex 7c553f87ed..9441a43b06 100644--- a/apps/mobile/src/i18n/locales/ja/models.json+++ b/apps/mobile/src/i18n/locales/ja/models.json@@ -65,7 +65,7 @@"restoreRecommended": "推奨設定に戻す","saveFailed": "保存できませんでした。再試行してください。","configure": "設定",- "syncFailed": "お気に入りを同期できません。選択画面を開き直してください。接続先の更新が必要な場合があります。",+ "syncFailed": "お気に入りを同期できません。選択画面を開き直してください。リモートのパソコンの Cindy を更新する必要がある場合があります。","timeUnit": {"day": "日","hour": "時間",diff --git a/apps/mobile/src/i18n/locales/ja/remoteDesktop.json b/apps/mobile/src/i18n/locales/ja/remoteDesktop.jsonindex d82ac2987e..a03b4fe518 100644--- a/apps/mobile/src/i18n/locales/ja/remoteDesktop.json+++ b/apps/mobile/src/i18n/locales/ja/remoteDesktop.json@@ -159,7 +159,7 @@"lockOnExit": "終了時にパソコンをロック","lockOnExitHint": "リモートデスクトップを終了するとロックします。再接続やアプリ切り替えではロックしません。","lockOnExitFailed": "パソコンのロックを確認できませんでした。パソコンの状態を確認してください。",- "hostMute": "操作先をミュート",- "hostMuteHint": "接続中は操作先の音声をミュートします",- "hostMuteFailed": "操作先のミュート状態を変更できません"+ "hostMute": "リモートのパソコンをミュート",+ "hostMuteHint": "接続中はリモートのパソコンの音声をミュートします",+ "hostMuteFailed": "リモートのパソコンのミュート状態を変更できません"}diff --git a/apps/mobile/src/i18n/locales/ja/session.json b/apps/mobile/src/i18n/locales/ja/session.jsonindex 8db18c1706..02dc4ffa1b 100644--- a/apps/mobile/src/i18n/locales/ja/session.json+++ b/apps/mobile/src/i18n/locales/ja/session.json@@ -29,18 +29,18 @@"openMicPermission": "マイクの権限設定を開く","maxAttachments": "添付は最大 {{max}} 件までです。","voiceStopRecording": "録音を停止",- "capabilitiesUnsupported": "リモート機能の形式に対応していません"+ "capabilitiesUnsupported": "パソコンからコマンドとリソースの一覧を読み込めませんでした。パソコンの Cindy を更新してから再試行してください"},"presentation": {"collaboration": {"labelLead": "コラボレーション Lead","labelWorker": "コラボレーション Worker","labelRole": "コラボレーション {{role}}",- "noticeLead": "これはコンピューター側の Orca Lead セッションです。スマートフォンからメッセージを続けて送れます。Worker の作成、フォーカスの変更、Fork/Rewind、キューの編集、セッション設定の変更はコンピューターで行ってください。",- "noticeWorker": "これはコンピューター側の Orca Worker セッションです。モバイル版の初期バージョンは読み取り専用で、メッセージ送信、Worker フォーカスの変更、Worker のアーカイブ、コラボレーションの停止には対応していません。",- "noticeOther": "これはコンピューター側のコラボレーションセッションです。モバイル版の初期バージョンは読み取り専用です。コラボレーションの管理はコンピューターで行ってください。",- "readOnlyReason": "モバイル版の初期バージョンではコラボレーションは読み取り専用です。確認、キュー編集、セッション変更はコンピューターで行ってください。",- "composerReadOnlyReason": "このコラボレーションのサブタスクはモバイルでは読み取り専用です。メッセージはコンピューターから送信してください。"+ "noticeLead": "これはコンピューター側の Orca Lead セッションです。スマートフォンからメッセージを続けて送れます。Worker の作成、フォーカスの変更、ここまで戻る操作、ここから新しいセッションを始める操作、キューの編集、セッション設定の変更はコンピューターで行ってください。",+ "noticeWorker": "これはコンピューター側の Orca Worker セッションです。スマートフォンでは現在表示のみ可能です。メッセージ送信、Worker フォーカスの変更、Worker のアーカイブ、コラボレーションの停止はコンピューターで行ってください。",+ "noticeOther": "これはコンピューター側のコラボレーションセッションです。スマートフォンでは現在表示のみ可能です。コラボレーションの管理はコンピューターで行ってください。",+ "readOnlyReason": "コラボレーションセッションはスマートフォンでは現在表示のみ可能です。確認、キュー編集、セッション変更はコンピューターで行ってください。",+ "composerReadOnlyReason": "このコラボレーションのサブタスクはスマートフォンでは現在表示のみ可能です。メッセージはコンピューターから送信してください。"},"composer": {"voice": {@@ -212,7 +212,7 @@"shareUnsupported": "このバージョンはまだ共有に対応していません。最新版に更新してから再試行してください。","downloadFailed": "ダウンロードに失敗しました","voiceNoRemoteDevice": "リモートデバイスがないため、音声入力を開始できません。",- "voiceSenderNotReady": "メッセージ送信機能が初期化されていません。",+ "voiceSenderNotReady": "メッセージを送信できません。一度戻ってから、セッションを開き直してください。","voiceStopAndSend": "音声入力を終了して送信","sendMessage": "リモートメッセージを送信","voiceStartInput": "音声入力を開始",@@ -333,7 +333,7 @@"selectDir": "ディレクトリ {{name}} を選択","select": "選択","noModelSelected": "モデル未選択",- "assignedDialogueDir": "パソコンが割り当てた会話ディレクトリ",+ "assignedDialogueDir": "パソコンが自動で割り当てる作業ディレクトリ","extraDirsSuffix": "+{{num}} 追加ディレクトリ","noProjectPath": "プロジェクトパス未選択","dialogueWorkspace": "会話ワークスペース",@@ -364,7 +364,7 @@"worktreeNotGitRepo": "現在のディレクトリは git リポジトリではありません","worktreeAlreadyInWorktree": "すでに worktree 内です。ネストは禁止です","worktreeDetectFailed": "ディレクトリ環境を確認できません。後でディレクトリを選び直してもう一度お試しください",- "worktreeUnsupported": "このデスクトップでは worktree を安全に作成できません。続行するには worktree をオフにするか、デスクトップアプリを更新してください。",+ "worktreeUnsupported": "パソコンの Cindy では worktree を安全に作成できません。続行するには worktree をオフにするか、パソコンの Cindy を更新してください。","worktreeCreateFailed": "worktree の作成に失敗しました:{{message}}","worktreeRecoveryStateFailed": "worktree の復旧状態を保存できませんでした。もう一度お試しください。","worktreeCleanupPending": "前回の worktree はまだクリーンアップ待ちです。デバイスを再接続してから再試行してください。"@@ -456,7 +456,6 @@"contextLabel": "コンテキスト","accountLimits": "アカウントの上限","quotaExhaustedResettable": "現在のクォータを使い切りました。リセットするとすぐに 1 回消費され、取り消せません。",- "resetting": "リセット中…","resetCodexUsage": "Codex の使用量をリセット","quotaExhaustedNoCredit": "現在のクォータを使い切りましたが、利用できるリセット回数がありません。","openDir": "ディレクトリを開く",@@ -474,7 +473,8 @@"noSubDirs": "このディレクトリには開けるサブディレクトリがありません。","dirLimitNotice": "最初の 30 件のディレクトリのみ表示しています。より具体的なディレクトリを開いて選択を続けてください。","confirmRename": "名前の変更を確定",- "confirm": "確定",+ "renameSubmit": "名前を変更",+ "confirm": "名前を変更","cancelRename": "名前の変更をキャンセル","backToMenu": "セッションメニューに戻る"},@@ -500,8 +500,8 @@"toolUseLoopDetectedConsecutiveWithCount": "モデルが同じツール呼び出しを {{count}} 回繰り返したため、無限ループを防ぐためこのターンを停止しました。新しいメッセージを送信して続行できます。","toolUseLoopDetectedPingPongWithCount": "モデルがツール呼び出しの間を行き来するループを続けたため、このターンで {{count}} 回の呼び出しを検出した時点で停止しました。新しいメッセージを送信して続行できます。","toolUseLoopDetectedRotationWithCount": "モデルが複数のツール呼び出しを順番に繰り返したため、このターンで {{count}} 回の呼び出しを検出した時点で停止しました。新しいメッセージを送信して続行できます。",- "codexThreadLost": "Codex の認証モードが切り替わったため、このセッションは続行できません —— 新しいセッションを作成すると反映されます。",- "encryptedContentInvalid": "プロバイダーの変更により暗号化が利用できなくなったため、このセッションは元のプロバイダーでのみ使用できます。パソコン側で対応してください(Fork してプロトコルの暗号化コンテンツを破棄すれば、新しいセッションで続行できます)。"+ "codexThreadLost": "Codex の認証モードが切り替わったため、このセッションは続行できません。新しいセッションを作成してください。",+ "encryptedContentInvalid": "プロバイダーの変更により暗号化が利用できなくなったため、このセッションは元のプロバイダーでのみ使用できます。パソコン側で対応してください(「ここから新しいセッションを始める」でプロトコルの暗号化コンテンツを破棄すれば、新しいセッションで続行できます)。"},"row": {"moreOptions": "その他のオプション",@@ -518,6 +518,8 @@"authGateHint": "{{agent}} はこのパソコンに接続済みのモデルプロバイダーがないため、送信は失敗します。パソコンの {{appName}} で「設定 → モデルプロバイダー」を設定してください。"},"outbox": {+ "deleteConfirmTitle": "このメッセージを削除しますか?",+ "deleteConfirmBody": "このメッセージは送信されていません。削除すると元に戻せません。","legacyPlanRecovery": "このパソコンではプランモードで保存済みメッセージを復元できません。プランモードをオフにするか、パソコンの Cindy を更新して再試行してください。","creationRecoveryRequired": "先頭のメッセージを削除する前に、セッションの作成を再試行してください。このメッセージには後続メッセージの復元に必要な情報が保存されています。","confirmationRequired": "このコンピューターではメッセージの受信を確認できません。履歴を確認するか、Cindy を更新してから再試行してください。",@@ -529,15 +531,15 @@"remoteError": {"REMOTE_DAEMON_CLOSED": "リモート接続が切れました。更新中の可能性があります。このターンは終了したので、もう一度送信してください。","REMOTE_LOCAL_ATTACHMENT_UNSUPPORTED": "リモートセッションではローカルのファイル/画像の添付にアクセスできません。内容を直接貼り付けてください。",- "AUTO_REVIEW_UNAVAILABLE": "自動レビューが判断できませんでした。レビューが必要な操作は、ご自身で確認する形に切り替わりました。中断を減らしたい場合は、このタスクを「フルアクセス」に切り替えてください。リスクはより高くなります。",- "AUTO_REVIEW_UNAVAILABLE_WECHAT": "自動レビューが判断できませんでした。レビューが必要な操作は、ご自身で確認する形に切り替わりました。個人 WeChat ではフルアクセスを使えません。この操作を直接確認してください。",- "AUTO_REVIEW_CONFIRM_UNDELIVERED": "自動レビューを完了できず、確認も完了しませんでした。これはユーザーによる拒否ではありません。",+ "AUTO_REVIEW_UNAVAILABLE": "自動承認が判断できませんでした。承認が必要な操作は、ご自身で確認する形に切り替わりました。中断を減らしたい場合は、このセッションを「フルアクセス」に切り替えてください。リスクはより高くなります。",+ "AUTO_REVIEW_UNAVAILABLE_WECHAT": "自動承認が判断できませんでした。承認が必要な操作は、ご自身で確認する形に切り替わりました。個人 WeChat ではフルアクセスを使えません。この操作を直接確認してください。",+ "AUTO_REVIEW_CONFIRM_UNDELIVERED": "自動承認を完了できず、確認も完了しませんでした。これはユーザーによる拒否ではありません。","REMOTE_COMPAT_MODE_UNSUPPORTED": "リモートのタスクでは、このパソコン側の互換経路を使えません。Cindy AI に切り替えるか、このパソコン上のタスクで続けてください。",- "REMOTE_GATEWAY_ENDPOINT_UNAVAILABLE": "Cindy AI の資格情報がまだ準備できていません(サインイン後に自動発行されます)。しばらくしてから再試行してください。続く場合は 設定 → モデルプロバイダー で Cindy AI の接続状態を確認してください。",+ "REMOTE_GATEWAY_ENDPOINT_UNAVAILABLE": "Cindy AI の資格情報がまだ準備できていません(サインイン後に自動発行されます)。しばらくしてから再試行してください。続く場合は「設定 → モデルプロバイダー」で Cindy AI の接続状態を確認してください。","REMOTE_LOCAL_ONLY_PROVIDER": "このモデルプロバイダーはローカル専用サービス(Ollama など)で、SSH リモートタスクからはアクセスできません。Cindy AI ゲートウェイに切り替えるか、リモートホストから到達可能なプロバイダーを選んでください。","DEVICE_LINK_CONTROL_DISABLED": "このデバイスの操作はオフです。メッセージは送信されていません。","DEVICE_LINK_MEDIA_TRANSFER_FAILED": "添付ファイルの転送に失敗しました。メッセージは送信されていません。もう一度お試しください。",- "MCP_APPROVAL_AUTO_BLOCKED": "このツール呼び出しは自動審査でブロックされました。手動で拒否された記録はありません。",+ "MCP_APPROVAL_AUTO_BLOCKED": "このツール呼び出しは自動承認でブロックされました。手動で拒否された記録はありません。","MCP_APPROVAL_CONFIRMATION_TIMEOUT": "権限の確認がタイムアウトし、有効な確認結果を受信できませんでした。タイムアウトだけでは、ボタンをクリックしたかどうかは判断できません。","MCP_APPROVAL_CONFIRMATION_UNAVAILABLE": "権限の確認を完了できませんでした。手動で拒否された記録はありません。","REMOTE_HOST_PROXY_FORWARD_UNAVAILABLE": "このモデルはパソコン側でのリクエスト転送が必要ですが、今のリモート接続では転送できません。Cindy AI に切り替えるか、このパソコン上のタスクで使ってください。",diff --git a/apps/mobile/src/i18n/locales/ja/settings.json b/apps/mobile/src/i18n/locales/ja/settings.jsonindex f8202402af..ee78ddaf27 100644--- a/apps/mobile/src/i18n/locales/ja/settings.json+++ b/apps/mobile/src/i18n/locales/ja/settings.json@@ -19,8 +19,8 @@"cancel": "キャンセル","exportHint": "詳細なローカルログを共有して問題を調査します。会話の本文や認証情報は含みません。","options": "ログのオプション",- "uploadCopied": "送信しました。番号 {{code}} をコピーしました。",- "uploadSucceeded": "送信しました。番号 {{code}}。"+ "uploadCopied": "ログを送信しました。番号 {{code}} をコピーしました",+ "uploadSucceeded": "ログを送信しました。番号 {{code}}"},"title": "設定","appearance": {@@ -47,15 +47,14 @@},"version": {"sectionTitle": "バージョン",- "currentLabel": "現在のバージョン",- "bundleVersion": "アプリ本体 {{version}}",- "otaVersion": "OTA バージョン {{version}}",+ "appVersion": "バージョン {{version}}",+ "updateMethodInApp": "更新方法:アプリ内で更新(再起動後に反映)",+ "updateMethodPackage": "更新方法:新しいバージョンをダウンロードしてインストール",+ "updateMethodUnavailable": "開発ビルドのため、アプリ内更新は利用できません","pairedDesktopVersion": "対応デスクトップ版 {{version}}",- "devNoOta": "開発ビルドのため OTA 更新は利用できません","checkAction": "更新を確認","testFlightCheckAction": "コンテンツ更新を確認","checking": "確認中",- "updating": "更新中","checkingAccessibility": "更新を確認しています","testFlightCheckingAccessibility": "コンテンツ更新を確認しています","testFlightUpdateManaged": "テスト版アプリの更新は TestFlight で管理されます",@@ -144,7 +143,8 @@"runtime": "Runtime","otaMarker": "OTA マーカー","emergencyLaunch": "緊急起動",- "emergencyLaunchYes": "はい(この起動では OTA を適用できません)"+ "emergencyLaunchYes": "はい(この起動では OTA を適用できません)",+ "otaVersion": "OTA バージョン"},"legal": {"sectionTitle": "法的情報",@@ -161,6 +161,8 @@"analyticsResetAction": "戻す"},"account": {+ "logoutConfirmTitle": "ログアウトしますか?",+ "logoutConfirmRunning": "実行中のセッションがあります。セッションはパソコンで実行を続けますが、このスマートフォンでは受信・操作できなくなり、保存されたアカウントとローカルのリモートミラーも削除されます。","logoutHint": "ログアウトすると、このスマートフォンに保存されたすべてのアカウントとローカルのリモートミラーが削除されます。パソコン側のセッションには影響しません。","logout": "ログアウト","loggingOut": "ログアウト中",@@ -193,9 +195,12 @@"resetAccessibility": "デフォルトの端末名に戻す","emptyError": "デバイス名を入力してください。","deviceInitializing": "デバイスを初期化しています。しばらくしてからもう一度お試しください。",- "saving": "保存中…",- "saved": "保存しました。",- "restoringDefault": "デフォルト名に戻しています…",- "restoredDefault": "デフォルト名に戻しました。"+ "restoredDefault": "デフォルト名に戻しました。",+ "resetAction": "デフォルト名に戻す",+ "clearAccessibility": "名前を消去",+ "discardTitle": "変更を破棄しますか?",+ "discardBody": "デバイス名の変更はまだ保存されていません。",+ "discardConfirm": "変更を破棄",+ "keepEditing": "編集を続ける"}}diff --git a/apps/mobile/src/i18n/locales/ja/sharedTask.json b/apps/mobile/src/i18n/locales/ja/sharedTask.jsonindex e2c7bad025..febf865222 100644--- a/apps/mobile/src/i18n/locales/ja/sharedTask.json+++ b/apps/mobile/src/i18n/locales/ja/sharedTask.json@@ -42,7 +42,7 @@"joined": "共有タスクに参加しました","joinedBody": "参加前のメッセージ、ツールの結果、添付ファイルを確認し、同じ Agent にメッセージを送信できます。","enterTask": "タスクを開く",- "inviteBoxTitle": "仲間に招待を送信",+ "inviteBoxTitle": "一緒に作業する人に招待を送信","roleGuest": "ゲスト","removeShort": "削除","removeNamedTitle": "{{name}}を削除しますか?",diff --git a/apps/mobile/src/i18n/locales/ko/composer.json b/apps/mobile/src/i18n/locales/ko/composer.jsonindex 0dc903524b..dcab666cc7 100644--- a/apps/mobile/src/i18n/locales/ko/composer.json+++ b/apps/mobile/src/i18n/locales/ko/composer.json@@ -25,10 +25,10 @@"fileNotFound": "파일이 없습니다","pathNotReadable": "이 경로는 읽기가 허용되지 않습니다","readFailed": "읽기 실패",- "notFetchableMedia": "가져올 수 있는 데스크톱 미디어가 아닙니다",- "mediaResultInvalid": "원격 미디어 가져오기 결과가 잘못되었습니다",+ "notFetchableMedia": "이 미디어는 컴퓨터에서 가져올 수 없습니다",+ "mediaResultInvalid": "원격 미디어를 가져오지 못했습니다. 다시 시도하세요","mediaUrlInvalid": "원격 미디어 다운로드 URL이 잘못되었습니다",- "mediaCacheMiss": "원격 미디어 캐시에 없습니다(cachedOnly)",+ "mediaCacheMiss": "이 미디어는 아직 휴대폰에 캐시되지 않았습니다. 컴퓨터에 연결되면 다시 여세요","mediaFetchCancelled": "원격 미디어 가져오기를 취소했습니다","fileMenu": {"openBrowser": "파일 브라우저 열기",@@ -49,7 +49,7 @@"integrityUnavailable": "이 첨부 파일 업로드 본문은 무결성 검사를 할 수 없습니다.","sizeChanged": "첨부 파일 크기가 변경되었습니다. 예상: {{expected}}바이트, 실제: {{actual}}바이트.","invalidSize": "첨부 파일 크기가 잘못되어 무결성 다이제스트를 계산할 수 없습니다.",- "invalidBase64": "첨부 파일 청크가 유효한 base64가 아닙니다.",+ "invalidBase64": "첨부 파일 데이터를 읽지 못했습니다. 다시 추가한 후 전송하세요.","failedHttp": "첨부 파일 업로드에 실패했습니다: HTTP {{status}}{{code}}","failedNetwork": "첨부 파일 업로드에 실패했습니다. 네트워크 전송 오류입니다. 연결을 확인한 후 다시 시도하세요. ({{detail}})","timeout": "첨부 파일 업로드 시간이 초과되었습니다. 연결을 확인한 후 다시 시도하세요.",@@ -89,13 +89,13 @@"realtimeUnsupported": "모바일 실시간 음성은 아직 {{detail}} ASR을 지원하지 않습니다.","realtimeAuthUnsupported": "모바일 실시간 음성은 아직 {{auth}} ASR 인증을 지원하지 않습니다.","realtimeProtocolUnsupported": "모바일 실시간 음성은 아직 {{detail}} ASR 프로토콜을 지원하지 않습니다.",- "missingConnectionProvider": "모바일 음성 입력에는 {{appName}} 음성 세션 티켓이 필요합니다(connectionProvider 누락).",+ "missingConnectionProvider": "음성 서비스를 사용할 수 없습니다. {{appName}}에 다시 로그인한 후 다시 시도하세요.","realtimeAsrFailed": "실시간 음성 인식에 실패했습니다.","volcengineAuthUnsupported": "모바일 Volcengine 음성은 아직 {{auth}} 인증을 지원하지 않습니다.","volcengineMissingResourceId": "Volcengine ASR 구성에 resourceId가 없습니다.",- "sessionExpiredOrForbidden": "{{appName}} 음성 세션이 만료되었거나 권한이 없습니다(WebSocket {{status}}). 로그인 상태를 확인한 후 다시 시도하세요.",+ "sessionExpiredOrForbidden": "{{appName}} 음성 서비스 로그인이 만료되었거나 권한이 없습니다. 로그인 상태를 확인한 후 다시 시도하세요(상태 코드 {{status}}).","incomplete": "음성 입력이 완료되지 않았습니다. 다시 시도하세요.",- "missingRefinerTargetProvider": "모바일 음성 다듬기에는 {{appName}} 음성 세션이 필요합니다(refinerTargetProvider 누락).",+ "missingRefinerTargetProvider": "음성 다듬기를 사용할 수 없습니다. {{appName}}에 다시 로그인한 후 다시 시도하세요.","emptyTranscript": "음성이 감지되었지만 텍스트를 인식하지 못했습니다. 다시 시도해 주세요.","connectionInterrupted": "음성 연결이 중단되었습니다. 네트워크를 확인한 뒤 다시 시도하세요.","recognitionStalled": "음성 인식 결과가 더 이상 오지 않습니다. 다시 시도하세요.",diff --git a/apps/mobile/src/i18n/locales/ko/devices.json b/apps/mobile/src/i18n/locales/ko/devices.jsonindex 60c88e9ac9..a630b2a33e 100644--- a/apps/mobile/src/i18n/locales/ko/devices.json+++ b/apps/mobile/src/i18n/locales/ko/devices.json@@ -12,6 +12,10 @@"deleteFailed": "기기를 삭제하지 못했습니다.","deleteOnline": "기기가 온라인입니다. 오프라인으로 전환한 후 삭제하세요.","currentlyOnline": "현재 온라인",+ "availableSection": "온라인 기기",+ "offlineSection": "오프라인 기기",+ "showAllOffline": "모두 보기({{count}}대)",+ "showFewerOffline": "간단히 보기","nameTooLong": "기기 이름은 {{limit}}자 이하여야 합니다.","fields": {"name": "이름",@@ -29,9 +33,7 @@"common": {"cancel": "취소","save": "저장",- "saving": "저장 중","delete": "삭제",- "deleting": "삭제 중","create": "새로 만들기"},"resources": {@@ -47,7 +49,8 @@"openFailed": "세션을 열 수 없습니다","resolving": "최신 세션을 여는 중…","retry": "다시 시도",- "hostCount": "컴퓨터 {{count}}대"+ "hostCount": "컴퓨터 {{count}}대",+ "stale": "내용이 오래되었을 수 있습니다. 새로고침할 수 없습니다."},"presentation": {"deviceList": {@@ -177,10 +180,10 @@},"home": {"allDevices": "전체",- "allComputers": "모든 컴퓨터",+ "allComputers": "모든 기기","waitingCount": "대기 {{count}}개","synced": "동기화됨",- "unknownComputer": "알 수 없는 컴퓨터",+ "unknownComputer": "알 수 없는 기기","uncategorizedProject": "분류되지 않은 프로젝트","cindyMake": "Cindy Make","empty": {@@ -314,7 +317,7 @@"syncing": "다시 동기화하는 중","sync": "다시 동기화","pinnedConversations": "고정된 세션 {{count}}개",- "newRemoteConversation": "새 원격 세션",+ "newRemoteConversation": "새 세션","renameDevice": "{{label}} 이름 변경","project": "프로젝트 {{title}}","dialogue": "채팅",@@ -537,7 +540,7 @@},"runNow": "지금 실행","error": {- "projectMissingConfig": "프로젝트 자동화에 projectConfigId가 없습니다. 데스크톱에서 삭제하세요.",+ "projectMissingConfig": "이 프로젝트 자동화에 프로젝트 설정이 없습니다. 컴퓨터에서 삭제하세요.","deletePartial": "자동화를 삭제했지만 생성된 세션 {{count}}개의 상태를 업데이트하지 못했습니다. 데스크톱에서 이 세션들을 확인하세요."},"subtitle": "실행 중 {{active}}개 · 작업 {{total}}개",@@ -606,6 +609,8 @@"useWorktree": "worktree 사용","modelPlaceholderBound": "세션 따르기","modelPlaceholderPiDefault": "비워두면 기본 모델",+ "boundSessionIdPlaceholder": "세션 ID",+ "effortDefault": "기본값","fastMode": "Fast 모드","notifyDesktop": "데스크톱 알림","notifyFeishu": "Feishu 알림",@@ -635,7 +640,6 @@"detailFallback": "일시 중지하면 이 자동화의 트리거가 멈춥니다.","previewFallback": "실행 중인 run이 없습니다","confirmA11y": "자동화 일시 중지 확인",- "pausing": "일시 중지 중","confirm": "일시 중지 확인","cancelA11y": "자동화 일시 중지 취소"},@@ -705,7 +709,6 @@"promptEmpty": "저장된 작업 프롬프트가 없습니다","deleteA11y": "자동화 삭제","runNowA11y": "자동화 지금 실행",- "running": "실행 중","resumeA11y": "자동화 재개","pauseA11y": "자동화 일시 중지","resume": "재개",@@ -715,13 +718,10 @@},"run": {"openSessionA11y": "자동화 세션 열기",- "opening": "여는 중","session": "세션","restartA11y": "자동화 다시 실행",- "restarting": "다시 실행 중","restart": "다시 실행","markReadA11y": "실행 기록 읽음으로 표시",- "marking": "표시 중","markRead": "읽음","deleteA11y": "실행 기록 삭제"},@@ -779,7 +779,7 @@"unknownTime": "시간 알 수 없음","status": {"running": "실행 중",- "success": "성공",+ "success": "완료","failed": "실패","aborted": "중단됨","interrupted": "중단됨",@@ -812,6 +812,7 @@}},"companions": {+ "noCreateHosts": "사용 가능한 호환 컴퓨터가 없습니다. 컴퓨터에서 Cindy를 열고 같은 계정으로 로그인하면 팀원을 새로 만들 수 있습니다.","messageSent": "백그라운드 작업에 메시지를 보냈습니다","sentTo": "{{name}}에게 메시지를 보냄","receivedFrom": "{{name}}의 메시지",@@ -836,18 +837,18 @@"messages": "메시지","readOnly": "읽기 전용","directEmpty": "아직 볼 수 있는 메시지가 없습니다.",- "directLimitReached": "이번 동료 간 대화가 한도에 도달해 양쪽 모두 각자의 기본 작업으로 돌아갔습니다",- "directUnavailable": "이 동료 간 대화를 더 이상 사용할 수 없습니다.",+ "directLimitReached": "이번 팀원 간 대화가 한도에 도달해 양쪽 모두 각자의 기본 세션으로 돌아갔습니다",+ "directUnavailable": "이 팀원 간 대화를 더 이상 사용할 수 없습니다.","unread": "새 답변","status": {"queued": "시작하는 중",- "running": "작업 중",+ "running": "실행 중","waiting": "처리 대기 중","completed": "완료","failed": "실패","cancelled": "중지됨","timed-out": "시간 초과",- "unknown": "작업 상태를 확인할 수 없어요"+ "unknown": "알 수 없는 상태"},"title": "팀원","tasks": "세션",@@ -1014,7 +1015,7 @@"memorySaveFailed": "저장하지 못했습니다. 편집 내용은 유지됩니다.","memoryMissing": "이 기억은 더 이상 없습니다.","memoryDeleteFailed": "삭제하지 못했습니다",- "create": "새 팀원",+ "create": "팀원 새로 만들기","createFailed": "생성 결과를 아직 확인하지 못했습니다. 다시 시도해 확인하세요.","title": "팀원","profile": "프로필 및 성격",diff --git a/apps/mobile/src/i18n/locales/ko/files.json b/apps/mobile/src/i18n/locales/ko/files.jsonindex 3891cf9c76..bb128c7ee1 100644--- a/apps/mobile/src/i18n/locales/ko/files.json+++ b/apps/mobile/src/i18n/locales/ko/files.json@@ -131,6 +131,7 @@"browserCancelAddress": "편집 취소","browserReturnToFile": "파일로 돌아가기","browserCopyAddress": "주소 복사",+ "browserCopiedAddress": "주소를 복사했습니다","browserInvalidAddress": "올바른 http 또는 https 주소를 입력하세요.","browserWebsiteFailed": "웹페이지를 열 수 없습니다. 다시 로드해 주세요."},@@ -140,6 +141,6 @@"exportTimeout": "내보내기 시간이 초과되었습니다. 다시 시도하세요."},"gallery": {- "cacheMiss": "원격 미디어 캐시 미스(cachedOnly)"+ "cacheMiss": "이 미디어는 아직 휴대폰에 캐시되지 않았습니다. 컴퓨터에 연결되면 다시 여세요"}}diff --git a/apps/mobile/src/i18n/locales/ko/interaction.json b/apps/mobile/src/i18n/locales/ko/interaction.jsonindex 15a54dbdcd..f02be0049a 100644--- a/apps/mobile/src/i18n/locales/ko/interaction.json+++ b/apps/mobile/src/i18n/locales/ko/interaction.json@@ -20,7 +20,13 @@"allowOnceAccessibility": "권한 요청 한 번 허용","allowOnceConfirm": "한 번 허용 확인","highRisk": "고위험",- "autoReviewUnavailable": "자동 리뷰를 끝내지 못했습니다. 이 작업을 허용할지 확인해 주세요."+ "autoReviewUnavailable": "자동 리뷰를 끝내지 못했습니다. 이 작업을 허용할지 확인해 주세요.",+ "fullAccessConfirm": {+ "title": "전체 접근을 활성화할까요?",+ "description": "전체 접근은 작업 공간 샌드박스를 비활성화하고 일반 승인을 건너뜁니다. {{appName}}가 작업 공간 밖의 파일을 수정하고 네트워크 명령을 묻지 않고 실행할 수 있습니다. 기본 제공 고위험 작업은 계속 확인을 요청합니다.",+ "confirm": "전체 접근 활성화",+ "cancel": "현재 권한 유지"+ }},"planMode": {"label": "플랜 모드",diff --git a/apps/mobile/src/i18n/locales/ko/message.json b/apps/mobile/src/i18n/locales/ko/message.jsonindex 254fd4cef5..5c884b08e2 100644--- a/apps/mobile/src/i18n/locales/ko/message.json+++ b/apps/mobile/src/i18n/locales/ko/message.json@@ -67,6 +67,9 @@"subagentTyped": "하위 에이전트 · {{type}}","subagent": "하위 에이전트","workedDuration": "작업 시간 {{duration}}",+ "durationSeconds": "{{seconds}}초",+ "durationMinutes": "{{minutes}}분",+ "durationMinutesSeconds": "{{minutes}}분 {{seconds}}초","subagentSummary": "하위 에이전트 요약","agentSwitchLabel": "{{from}}에서 {{to}}(으)로 전환됨","agentSwitchViewHandoff": "{{label}}, 인계 내용 보기",@@ -90,7 +93,6 @@"retryFetch": "가져오기 재시도","openMedia": "미디어 열기","readCurrentRemoteFile": "현재 원격 파일 읽기",- "reading": "읽는 중","retryFilePreview": "파일 미리보기 재시도","readCurrentFile": "현재 파일 읽기","currentFilePreview": "현재 파일 미리보기",@@ -123,17 +125,17 @@"mediaSize": "크기: {{size}}","mediaExpiresAt": "만료 시간: {{time}}","mediaErrorLine": "오류: {{message}}",- "mediaDeviceLinkHint": "모바일은 device-link를 통해 원격 기기에 미디어 업로드를 요청한 후 엽니다.",+ "mediaDeviceLinkHint": "열기 전에 휴대폰이 원격 기기에 이 미디어 업로드를 요청합니다.","controlDelete": "메시지 삭제",- "controlRewind": "여기로 되돌리기",- "controlFork": "세션 분기",+ "controlRewind": "여기로 돌아가기",+ "controlFork": "여기서 새 세션 시작","markdownDocAriaLabel": "메시지 본문","toolOutputTitle": "{{label}} 출력","toolInputTitle": "{{label}} 입력","viewToolInput": "전체 입력 보기","loadingToolInput": "전체 입력 불러오는 중","retryToolInput": "입력을 불러오지 못했습니다. 다시 시도",- "toolResultCompacted": "Full tool output was released (original size {{size}})",+ "toolResultCompacted": "전체 도구 출력이 축약되었습니다(원래 크기 {{size}})","mermaidEmpty": "빈 Mermaid 다이어그램.","diffEditCount": "{{n}}개 편집"},@@ -312,7 +314,7 @@"inlineMediaData": "인라인 {{kind}} 데이터","mediaActionsAvailable": "데스크톱 앱에서 이 미디어의 후속 작업을 제공합니다.","availableActions": "사용 가능한 작업: {{actions}}",- "mediaActionsDesktopOnly": "모바일 V1에서는 이 작업을 표시만 하며 아직 원격으로 실행하지 않습니다. 데스크톱 앱으로 돌아가 선택하세요.",+ "mediaActionsDesktopOnly": "휴대폰에서는 현재 이 작업을 확인만 할 수 있습니다. 컴퓨터에서 진행하세요.","moreEdits": "…편집 {{count}}개 더 있음"},"quote": {diff --git a/apps/mobile/src/i18n/locales/ko/session.json b/apps/mobile/src/i18n/locales/ko/session.jsonindex 8fec30305d..2b1a443832 100644--- a/apps/mobile/src/i18n/locales/ko/session.json+++ b/apps/mobile/src/i18n/locales/ko/session.json@@ -29,18 +29,18 @@"openMicPermission": "마이크 권한 설정 열기","maxAttachments": "첨부는 최대 {{max}}개까지 가능합니다.","voiceStopRecording": "녹음 중지",- "capabilitiesUnsupported": "지원되지 않는 원격 기능 형식입니다"+ "capabilitiesUnsupported": "컴퓨터에서 명령과 리소스 목록을 불러오지 못했습니다. 컴퓨터의 Cindy를 업데이트한 후 다시 시도하세요"},"presentation": {"collaboration": {"labelLead": "협업 Lead","labelWorker": "협업 Worker","labelRole": "협업 {{role}}",- "noticeLead": "컴퓨터의 Orca Lead 세션입니다. 휴대폰에서 메시지를 계속 보낼 수 있습니다. Worker 생성, 포커스 변경, Fork/Rewind, 대기열 편집 및 세션 설정 변경은 컴퓨터에서 진행하세요.",- "noticeWorker": "컴퓨터의 Orca Worker 세션입니다. 모바일 첫 버전은 읽기 전용이며 메시지 전송, Worker 포커스 변경, Worker 보관 또는 협업 중지를 지원하지 않습니다.",- "noticeOther": "컴퓨터의 협업 세션입니다. 모바일 첫 버전은 읽기 전용이므로 협업 관리는 컴퓨터에서 진행하세요.",- "readOnlyReason": "모바일 첫 버전에서 협업 모드는 읽기 전용입니다. 확인 처리, 대기열 편집 및 세션 변경은 컴퓨터에서 진행하세요.",- "composerReadOnlyReason": "이 협업 하위 작업은 모바일에서 읽기 전용입니다. 컴퓨터에서 메시지를 보내세요."+ "noticeLead": "컴퓨터의 Orca Lead 세션입니다. 휴대폰에서 메시지를 계속 보낼 수 있습니다. Worker 생성, 포커스 변경, 여기로 돌아가기, 여기서 새 세션 시작, 대기열 편집 및 세션 설정 변경은 컴퓨터에서 진행하세요.",+ "noticeWorker": "컴퓨터의 Orca Worker 세션입니다. 휴대폰에서는 현재 보기만 할 수 있습니다. 메시지 전송, Worker 포커스 변경, Worker 보관 또는 협업 중지는 컴퓨터에서 진행하세요.",+ "noticeOther": "컴퓨터의 협업 세션입니다. 휴대폰에서는 현재 보기만 할 수 있으므로 협업 관리는 컴퓨터에서 진행하세요.",+ "readOnlyReason": "협업 세션은 휴대폰에서 현재 보기만 할 수 있습니다. 확인 처리, 대기열 편집 및 세션 변경은 컴퓨터에서 진행하세요.",+ "composerReadOnlyReason": "이 협업 하위 작업은 휴대폰에서 현재 보기만 할 수 있습니다. 컴퓨터에서 메시지를 보내세요."},"composer": {"voice": {@@ -208,7 +208,7 @@"shareUnsupported": "현재 앱 버전은 아직 공유를 지원하지 않습니다. 최신 버전으로 업데이트한 후 다시 시도하세요.","downloadFailed": "다운로드 실패","voiceNoRemoteDevice": "원격 기기가 없어 음성 입력을 시작할 수 없습니다.",- "voiceSenderNotReady": "메시지 전송기가 초기화되지 않았습니다.",+ "voiceSenderNotReady": "지금은 메시지를 보낼 수 없습니다. 뒤로 갔다가 세션을 다시 여세요.","voiceStopAndSend": "음성 입력 종료 후 전송","sendMessage": "원격 메시지 보내기","voiceStartInput": "음성 입력 시작",@@ -329,7 +329,7 @@"selectDir": "디렉터리 {{name}} 선택","select": "선택","noModelSelected": "모델 미선택",- "assignedDialogueDir": "컴퓨터가 할당한 대화 디렉터리",+ "assignedDialogueDir": "컴퓨터가 자동으로 할당하는 작업 디렉터리","extraDirsSuffix": "+{{num}} 추가 디렉터리","noProjectPath": "프로젝트 경로 미선택","dialogueWorkspace": "대화 작업 공간",@@ -360,7 +360,7 @@"worktreeNotGitRepo": "현재 디렉터리는 git 리포지토리가 아닙니다","worktreeAlreadyInWorktree": "이미 worktree 안에 있어 중첩이 금지됩니다","worktreeDetectFailed": "디렉터리 환경을 확인할 수 없습니다. 나중에 디렉터리를 다시 선택해 시도하세요",- "worktreeUnsupported": "이 데스크톱에서는 worktree를 안전하게 만들 수 없습니다. 계속하려면 worktree를 끄거나 데스크톱 앱을 업데이트하세요.",+ "worktreeUnsupported": "컴퓨터의 Cindy에서는 worktree를 안전하게 만들 수 없습니다. 계속하려면 worktree를 끄거나 컴퓨터의 Cindy를 업데이트하세요.","worktreeCreateFailed": "worktree 생성 실패: {{message}}","worktreeRecoveryStateFailed": "worktree 복구 상태를 저장할 수 없습니다. 다시 시도하세요.","worktreeCleanupPending": "이전 worktree가 아직 정리 대기 중입니다. 기기를 다시 연결한 후 재시도하세요."@@ -452,7 +452,6 @@"contextLabel": "컨텍스트","accountLimits": "계정 한도","quotaExhaustedResettable": "현재 사용량을 모두 소진했습니다. 재설정하면 즉시 1회가 사용되며 취소할 수 없습니다.",- "resetting": "재설정 중…","resetCodexUsage": "Codex 사용량 재설정","quotaExhaustedNoCredit": "현재 사용량을 모두 소진했지만 사용 가능한 재설정 횟수가 없습니다.","openDir": "디렉터리 열기",@@ -470,7 +469,8 @@"noSubDirs": "이 디렉터리에는 열 수 있는 하위 디렉터리가 없습니다.","dirLimitNotice": "처음 30개 디렉터리만 표시합니다. 더 구체적인 디렉터리로 들어가 계속 선택하세요.","confirmRename": "이름 변경 확인",- "confirm": "확인",+ "renameSubmit": "이름 변경",+ "confirm": "이름 변경","cancelRename": "이름 변경 취소","backToMenu": "세션 메뉴로 돌아가기"},@@ -496,8 +496,8 @@"toolUseLoopDetectedConsecutiveWithCount": "모델이 동일한 도구 호출을 {{count}}회 반복하여 무한 루프를 막기 위해 이번 턴을 중단했습니다. 새 메시지를 보내 계속할 수 있습니다.","toolUseLoopDetectedPingPongWithCount": "모델이 여러 도구 호출 사이를 오가며 반복하여 이번 턴에서 {{count}}회의 호출을 감지한 뒤 중단했습니다. 새 메시지를 보내 계속할 수 있습니다.","toolUseLoopDetectedRotationWithCount": "모델이 여러 도구 호출을 계속 순환하여 이번 턴에서 {{count}}회의 호출을 감지한 뒤 중단했습니다. 새 메시지를 보내 계속할 수 있습니다.",- "codexThreadLost": "Codex 인증 모드가 전환되어 이 세션을 계속할 수 없습니다 —— 새 세션을 만들면 적용됩니다.",- "encryptedContentInvalid": "제공자 변경으로 암호화를 사용할 수 없게 되어 이 세션은 원래 제공자에서만 사용할 수 있습니다. 컴퓨터에서 처리하세요(Fork하여 프로토콜 암호화 콘텐츠를 버린 후 새 세션에서 계속할 수 있습니다)."+ "codexThreadLost": "Codex 인증 모드가 전환되어 이 세션을 계속할 수 없습니다. 새 세션을 만드세요.",+ "encryptedContentInvalid": "제공자 변경으로 암호화를 사용할 수 없게 되어 이 세션은 원래 제공자에서만 사용할 수 있습니다. 컴퓨터에서 처리하세요('여기서 새 세션 시작'으로 프로토콜 암호화 콘텐츠를 버린 후 새 세션에서 계속할 수 있습니다)."},"row": {"moreOptions": "기타 옵션",@@ -514,6 +514,8 @@"authGateHint": "이 컴퓨터에 {{agent}}에 연결된 모델 제공자가 없어 전송이 실패합니다. 컴퓨터의 {{appName}}에서 '설정 → 모델 제공자'를 설정하세요."},"outbox": {+ "deleteConfirmTitle": "이 메시지를 삭제할까요?",+ "deleteConfirmBody": "이 메시지는 전송되지 않았습니다. 삭제하면 되돌릴 수 없습니다.","legacyPlanRecovery": "이 컴퓨터에서는 계획 모드로 저장된 메시지를 복원할 수 없습니다. 계획 모드를 끄거나 컴퓨터의 Cindy를 업데이트한 후 다시 시도해 주세요.","creationRecoveryRequired": "첫 메시지를 삭제하기 전에 세션 생성을 다시 시도하세요. 이 메시지에는 후속 메시지를 복원하는 데 필요한 정보가 저장되어 있습니다.","confirmationRequired": "이 컴퓨터에서 메시지 수신 여부를 확인할 수 없습니다. 기록을 확인하거나 컴퓨터의 Cindy를 업데이트한 후 다시 시도하세요.",@@ -525,15 +527,15 @@"remoteError": {"REMOTE_DAEMON_CLOSED": "원격 연결이 끊겼습니다. 업데이트 중일 수 있습니다. 이번 차례는 끝났으니 다시 보내 주세요.","REMOTE_LOCAL_ATTACHMENT_UNSUPPORTED": "원격 세션에서는 로컬 파일/이미지 첨부에 접근할 수 없습니다. 내용을 직접 붙여넣으세요.",- "AUTO_REVIEW_UNAVAILABLE": "자동 리뷰가 판단을 내리지 못했습니다. 검토가 필요한 작업은 직접 확인하도록 바뀌었습니다. 중단을 줄이려면 이 작업을 전체 접근으로 전환하세요. 위험도는 더 높습니다.",- "AUTO_REVIEW_UNAVAILABLE_WECHAT": "자동 리뷰가 판단을 내리지 못했습니다. 검토가 필요한 작업은 직접 확인하도록 바뀌었습니다. 개인 WeChat에서는 전체 접근을 사용할 수 없습니다. 이번 작업을 직접 확인하세요.",- "AUTO_REVIEW_CONFIRM_UNDELIVERED": "자동 리뷰를 끝내지 못했고 확인도 완료되지 않았습니다. 사용자가 거부한 것이 아닙니다.",+ "AUTO_REVIEW_UNAVAILABLE": "자동 승인이 판단을 내리지 못했습니다. 승인이 필요한 작업은 직접 확인하도록 바뀌었습니다. 중단을 줄이려면 이 세션을 전체 접근으로 전환하세요. 위험도는 더 높습니다.",+ "AUTO_REVIEW_UNAVAILABLE_WECHAT": "자동 승인이 판단을 내리지 못했습니다. 승인이 필요한 작업은 직접 확인하도록 바뀌었습니다. 개인 WeChat에서는 전체 접근을 사용할 수 없습니다. 이번 작업을 직접 확인하세요.",+ "AUTO_REVIEW_CONFIRM_UNDELIVERED": "자동 승인을 끝내지 못했고 확인도 완료되지 않았습니다. 사용자가 거부한 것이 아닙니다.","REMOTE_COMPAT_MODE_UNSUPPORTED": "원격 작업에서는 이 컴퓨터의 호환 경로를 사용할 수 없습니다. Cindy AI로 바꾸거나 이 컴퓨터의 작업에서 계속하세요.",- "REMOTE_GATEWAY_ENDPOINT_UNAVAILABLE": "Cindy AI 자격 증명이 아직 준비되지 않았습니다(로그인 후 자동 발급됩니다). 잠시 후 다시 시도해 주세요. 계속되면 설정 → 모델 제공자에서 Cindy AI 연결 상태를 확인하세요.",+ "REMOTE_GATEWAY_ENDPOINT_UNAVAILABLE": "Cindy AI 자격 증명이 아직 준비되지 않았습니다(로그인 후 자동 발급됩니다). 잠시 후 다시 시도해 주세요. 계속되면 '설정 → 모델 제공자'에서 Cindy AI 연결 상태를 확인하세요.","REMOTE_LOCAL_ONLY_PROVIDER": "이 모델 제공자는 로컬 전용 서비스(예: Ollama)라서 SSH 원격 작업에서 접근할 수 없습니다. Cindy AI 게이트웨이로 전환하거나 원격 호스트에서 접근 가능한 제공자를 선택하세요.","DEVICE_LINK_CONTROL_DISABLED": "이 기기의 제어가 꺼져 있어 메시지가 전송되지 않았습니다.","DEVICE_LINK_MEDIA_TRANSFER_FAILED": "첨부 파일 전송에 실패했습니다. 메시지가 전송되지 않았습니다. 다시 시도하세요.",- "MCP_APPROVAL_AUTO_BLOCKED": "자동 승인 검토가 이 도구 호출을 차단했습니다. 직접 거부한 기록은 없습니다.",+ "MCP_APPROVAL_AUTO_BLOCKED": "자동 승인이 이 도구 호출을 차단했습니다. 직접 거부한 기록은 없습니다.","MCP_APPROVAL_CONFIRMATION_TIMEOUT": "권한 확인 시간이 초과되어 유효한 확인 결과를 받지 못했습니다. 시간 초과만으로는 버튼을 클릭했는지 알 수 없습니다.","MCP_APPROVAL_CONFIRMATION_UNAVAILABLE": "권한 확인을 완료하지 못했습니다. 직접 거부한 기록은 없습니다.","REMOTE_HOST_PROXY_FORWARD_UNAVAILABLE": "이 모델은 컴퓨터에서 요청을 전달해야 하는데, 현재 원격 연결은 전달할 수 없습니다. Cindy AI로 바꾸거나 이 컴퓨터의 작업에서 사용하세요.",diff --git a/apps/mobile/src/i18n/locales/ko/settings.json b/apps/mobile/src/i18n/locales/ko/settings.jsonindex a0131f0022..52e71aac59 100644--- a/apps/mobile/src/i18n/locales/ko/settings.json+++ b/apps/mobile/src/i18n/locales/ko/settings.json@@ -19,8 +19,8 @@"cancel": "취소","exportHint": "문제 해결을 위해 상세 로컬 로그를 공유합니다. 대화 내용이나 인증 정보는 포함하지 않습니다.","options": "로그 옵션",- "uploadCopied": "업로드했습니다. 번호 {{code}}를 복사했습니다.",- "uploadSucceeded": "업로드했습니다. 번호 {{code}}."+ "uploadCopied": "로그를 업로드했습니다. 번호 {{code}}를 복사했습니다",+ "uploadSucceeded": "로그를 업로드했습니다. 번호 {{code}}"},"title": "설정","appearance": {@@ -47,15 +47,14 @@},"version": {"sectionTitle": "버전",- "currentLabel": "현재 버전",- "bundleVersion": "앱 패키지 {{version}}",- "otaVersion": "OTA 버전 {{version}}",+ "appVersion": "버전 {{version}}",+ "updateMethodInApp": "업데이트 방식: 앱 내 업데이트(다시 시작하면 적용)",+ "updateMethodPackage": "업데이트 방식: 새 버전을 다운로드해 설치",+ "updateMethodUnavailable": "개발 빌드에서는 앱 내 업데이트를 사용할 수 없습니다","pairedDesktopVersion": "연동 대상 데스크톱 버전 {{version}}",- "devNoOta": "개발 빌드에서는 OTA 업데이트를 사용할 수 없습니다","checkAction": "업데이트 확인","testFlightCheckAction": "콘텐츠 업데이트 확인","checking": "확인 중",- "updating": "업데이트 중","checkingAccessibility": "업데이트를 확인하는 중","testFlightCheckingAccessibility": "콘텐츠 업데이트를 확인하는 중","testFlightUpdateManaged": "테스트 빌드 업데이트는 TestFlight에서 관리합니다",@@ -144,7 +143,8 @@"runtime": "Runtime","otaMarker": "OTA 마커","emergencyLaunch": "긴급 실행",- "emergencyLaunchYes": "예 (이번 실행에서는 OTA를 적용할 수 없음)"+ "emergencyLaunchYes": "예 (이번 실행에서는 OTA를 적용할 수 없음)",+ "otaVersion": "OTA 버전"},"legal": {"sectionTitle": "법적 정보",@@ -161,6 +161,8 @@"analyticsResetAction": "되돌리기"},"account": {+ "logoutConfirmTitle": "로그아웃할까요?",+ "logoutConfirmRunning": "실행 중인 세션이 있습니다. 세션은 컴퓨터에서 계속 실행되지만 이 휴대폰에서는 더 이상 받거나 제어할 수 없으며, 저장된 계정과 로컬 원격 미러도 삭제됩니다.","logoutHint": "로그아웃하면 이 휴대폰에 저장된 모든 계정과 로컬 원격 미러가 삭제됩니다. 컴퓨터의 세션에는 영향이 없습니다.","logout": "로그아웃","loggingOut": "로그아웃 중",@@ -193,9 +195,12 @@"resetAccessibility": "기본 기기 이름 복원","emptyError": "기기 이름을 입력해 주세요.","deviceInitializing": "기기를 초기화하는 중입니다. 잠시 후 다시 시도해 주세요.",- "saving": "저장 중…",- "saved": "저장했습니다.",- "restoringDefault": "기본 이름을 복원하는 중…",- "restoredDefault": "기본 이름을 복원했습니다."+ "restoredDefault": "기본 이름을 복원했습니다.",+ "resetAction": "기본 이름 복원",+ "clearAccessibility": "이름 지우기",+ "discardTitle": "변경 사항을 버릴까요?",+ "discardBody": "기기 이름 변경 사항이 아직 저장되지 않았습니다.",+ "discardConfirm": "변경 사항 버리기",+ "keepEditing": "계속 편집"}}diff --git a/apps/mobile/src/i18n/locales/ko/sharedTask.json b/apps/mobile/src/i18n/locales/ko/sharedTask.jsonindex 1260e766a0..f4216b59fa 100644--- a/apps/mobile/src/i18n/locales/ko/sharedTask.json+++ b/apps/mobile/src/i18n/locales/ko/sharedTask.json@@ -42,7 +42,7 @@"joined": "공유 작업에 참여했습니다","joinedBody": "참여 전의 메시지, 도구 결과, 첨부 파일을 확인하고 같은 Agent에게 메시지를 보낼 수 있습니다.","enterTask": "작업 열기",- "inviteBoxTitle": "동료에게 초대 보내기",+ "inviteBoxTitle": "함께 작업할 사람에게 초대 보내기","roleGuest": "게스트","removeShort": "제거","removeNamedTitle": "{{name}} 님을 제거할까요?",diff --git a/apps/mobile/src/i18n/locales/zh-CN/composer.json b/apps/mobile/src/i18n/locales/zh-CN/composer.jsonindex c3e03f9f7f..f473050f15 100644--- a/apps/mobile/src/i18n/locales/zh-CN/composer.json+++ b/apps/mobile/src/i18n/locales/zh-CN/composer.json@@ -17,7 +17,7 @@"uploadFailed": "{{name}} · 上传失败","collapsedBadge": "{{count}} 个附件,点击展开","imageNotAnnotatable": "这张图片暂不支持标注或转发。",- "downloadOriginalFailed": "下载原图失败(HTTP {{status}})。",+ "downloadOriginalFailed": "原图下载失败,请稍后重试(HTTP {{status}})。","annotationSaveFailed": "标注保存失败","tryAgain": "请重试。","sendToChat": "发送到对话",@@ -25,11 +25,11 @@"fileNotFound": "文件不存在","pathNotReadable": "该路径不允许读取","readFailed": "读取失败",- "notFetchableMedia": "不是可取件的桌面端媒体",- "mediaResultInvalid": "远程媒体取件结果无效",+ "notFetchableMedia": "这个媒体无法从电脑端取回",+ "mediaResultInvalid": "远程媒体取回结果无效,请重试","mediaUrlInvalid": "远程媒体下载地址无效",- "mediaCacheMiss": "远程媒体缓存未命中(cachedOnly)",- "mediaFetchCancelled": "远程媒体取件已取消",+ "mediaCacheMiss": "这个媒体还没有缓存到手机上,请在连上电脑后重新打开",+ "mediaFetchCancelled": "已取消取回远程媒体","fileMenu": {"openBrowser": "打开文件浏览器","sendToSession": "发送到对话",@@ -49,9 +49,9 @@"integrityUnavailable": "当前附件上传体无法进行完整性校验。","sizeChanged": "附件大小已变化:预期 {{expected}} 字节,实际 {{actual}} 字节。","invalidSize": "附件大小无效,无法计算完整性摘要。",- "invalidBase64": "附件分块不是有效的 base64。",+ "invalidBase64": "附件数据读取出错,请重新添加后再发送。","failedHttp": "附件上传失败:HTTP {{status}}{{code}}",- "failedNetwork": "附件上传失败:网络传输异常,请检查网络后重试。({{detail}})",+ "failedNetwork": "附件上传失败:网络传输异常,请检查网络后重试。({{detail}})","timeout": "附件上传超时,请检查网络后重试。","fileTypeUnsupported": "这个本机文件类型暂不支持作为附件发送。","snapshotFailedNoCacheDir": "无法创建附件快照:缓存目录不可用",@@ -89,13 +89,13 @@"realtimeUnsupported": "手机版实时语音暂不支持 {{detail}} ASR。","realtimeAuthUnsupported": "手机版实时语音暂不支持 {{auth}} ASR 鉴权。","realtimeProtocolUnsupported": "手机版实时语音暂不支持 {{detail}} ASR 协议。",- "missingConnectionProvider": "手机语音输入需要 {{appName}} 语音会话票据(缺少 connectionProvider)。",+ "missingConnectionProvider": "语音服务暂不可用,请重新登录 {{appName}} 后重试。","realtimeAsrFailed": "实时语音识别失败。","volcengineAuthUnsupported": "手机版 Volcengine 语音暂不支持 {{auth}} 鉴权。","volcengineMissingResourceId": "Volcengine ASR 配置缺少 resourceId。",- "sessionExpiredOrForbidden": "{{appName}} 语音会话已失效或没有权限(WebSocket {{status}})。请确认登录状态后重试。",+ "sessionExpiredOrForbidden": "{{appName}} 语音服务的登录已失效或没有权限,请确认登录状态后重试(状态码 {{status}})。","incomplete": "语音输入未完成,请重试。",- "missingRefinerTargetProvider": "手机版语音润色需要 {{appName}} 语音会话(缺少 refinerTargetProvider)。",+ "missingRefinerTargetProvider": "语音润色暂不可用,请重新登录 {{appName}} 后重试。","emptyTranscript": "检测到语音但未识别出文本,请重试。","connectionInterrupted": "语音连接中断了,请检查网络后重试。","recognitionStalled": "语音识别没有继续返回结果,请重试。",diff --git a/apps/mobile/src/i18n/locales/zh-CN/deviceLink.json b/apps/mobile/src/i18n/locales/zh-CN/deviceLink.jsonindex 6d2e3c580c..7740bdf371 100644--- a/apps/mobile/src/i18n/locales/zh-CN/deviceLink.json+++ b/apps/mobile/src/i18n/locales/zh-CN/deviceLink.json@@ -50,12 +50,12 @@}},"agentAuth": {- "noKey": "{{agent}} 无法使用:电脑端还没有配置可用的 API Key。请在电脑端 {{appName}} 的“设置 → 模型供应商”完成配置后再试。",- "noOauth": "{{agent}} 无法使用:电脑端尚未完成账号授权。请在电脑端 {{appName}} 的“设置 → 模型供应商”重新连接账号后再试。",- "noCredentials": "{{agent}} 无法使用:电脑端尚未登录。请在电脑端 {{appName}} 的“设置 → 模型供应商”完成登录后再试。",+ "noKey": "{{agent}} 无法使用:电脑端还没有配置可用的 API Key。请在电脑端 {{appName}} 的「设置 → 模型供应商」完成配置后再试。",+ "noOauth": "{{agent}} 无法使用:电脑端尚未完成账号授权。请在电脑端 {{appName}} 的「设置 → 模型供应商」重新连接账号后再试。",+ "noCredentials": "{{agent}} 无法使用:电脑端尚未登录。请在电脑端 {{appName}} 的「设置 → 模型供应商」完成登录后再试。","noEncryption": "{{agent}} 无法使用:电脑端系统安全存储不可用,读取不到已保存的密钥。请检查系统钥匙串(macOS)或系统账户加密(Windows),然后重启电脑端 {{appName}}。","proxyNotReady": "{{agent}} 暂时无法使用:电脑端组件尚未就绪。请稍候重试;若持续出现,请重启电脑端 {{appName}}。",- "default": "{{agent}} 无法使用:电脑端登录凭证不可用。请在电脑端 {{appName}} 的“设置 → 模型供应商”重新登录后再试。({{reason}})"+ "default": "{{agent}} 无法使用:电脑端登录凭证不可用。请在电脑端 {{appName}} 的「设置 → 模型供应商」重新登录后再试。({{reason}})"},"remoteError": {"remoteDisabled": "远程电脑已关闭允许远程控制。",diff --git a/apps/mobile/src/i18n/locales/zh-CN/devices.json b/apps/mobile/src/i18n/locales/zh-CN/devices.jsonindex 9a039435c1..2be6c2bd0c 100644--- a/apps/mobile/src/i18n/locales/zh-CN/devices.json+++ b/apps/mobile/src/i18n/locales/zh-CN/devices.json@@ -12,6 +12,10 @@"deleteFailed": "删除设备失败。","deleteOnline": "设备当前在线,请让设备离线后再删除。","currentlyOnline": "当前在线",+ "availableSection": "在线设备",+ "offlineSection": "离线设备",+ "showAllOffline": "显示全部 {{count}} 台",+ "showFewerOffline": "收起","nameTooLong": "设备名称不能超过 {{limit}} 个字符。","fields": {"name": "名称",@@ -29,9 +33,7 @@"common": {"cancel": "取消","save": "保存",- "saving": "保存中","delete": "删除",- "deleting": "删除中","create": "新建"},"resources": {@@ -47,7 +49,8 @@"openFailed": "无法打开任务","resolving": "正在打开最新任务…","retry": "重试",- "hostCount": "{{count}} 台电脑"+ "hostCount": "{{count}} 台电脑",+ "stale": "内容可能已过期,暂时无法更新"},"presentation": {"deviceList": {@@ -155,7 +158,7 @@},"active": {"title": "这台电脑暂无活跃任务",- "copy": "先在桌面端创建或继续一个任务,手机端会把它显示在这里。"+ "copy": "先在电脑端创建或继续一个任务,手机端会把它显示在这里。"}},"time": {@@ -177,10 +180,10 @@},"home": {"allDevices": "全部",- "allComputers": "全部电脑",+ "allComputers": "全部设备","waitingCount": "{{count}} 待处理","synced": "已同步",- "unknownComputer": "未知电脑",+ "unknownComputer": "未知设备","uncategorizedProject": "未分类项目","cindyMake": "Cindy Make","empty": {@@ -202,7 +205,7 @@},"noSession": {"title": "还没有任务",- "copy": "先在桌面端创建或继续一个任务,手机端会直接显示对应项目和任务。"+ "copy": "先在电脑端创建或继续一个任务,手机端会直接显示对应项目和任务。"}},"noDevice": {@@ -294,7 +297,7 @@"error": {"sessionDeviceNotFound": "找不到这个任务所属设备,请重新同步后再试。","taskDeviceNotFound": "找不到这个任务所属设备,请重新同步后再试。",- "noDevice": "没有可用设备。请先打开桌面端远程控制,然后重新同步。"+ "noDevice": "没有可用设备。请先在电脑端打开远程控制,然后重新同步。"},"alert": {"cacheSaveFailed": "离线缓存未能保存",@@ -314,7 +317,7 @@"syncing": "正在重新同步","sync": "重新同步","pinnedConversations": "置顶 {{count}} 条任务",- "newRemoteConversation": "新建远程任务",+ "newRemoteConversation": "新建任务","renameDevice": "重命名 {{label}}","project": "项目 {{title}}","dialogue": "对话",@@ -537,8 +540,8 @@},"runNow": "立即运行","error": {- "projectMissingConfig": "项目自动化缺少 projectConfigId,请在桌面端删除",- "deletePartial": "自动化已删除,但 {{count}} 个生成任务未能更新状态。请在桌面端检查这些任务。"+ "projectMissingConfig": "这个项目自动化缺少项目配置,请在电脑端删除",+ "deletePartial": "自动化已删除,但 {{count}} 个生成任务未能更新状态。请在电脑端检查这些任务。"},"subtitle": "{{active}} 个运行中 · {{total}} 个自动化","metric": {@@ -551,7 +554,7 @@"default": "选择自动化后可以运行、暂停、编辑或打开最近任务。"},"empty": {- "copy": "可以直接从手机创建第一条自动化,或在桌面端创建后同步到这里。",+ "copy": "可以直接从手机创建第一条自动化,或在电脑端创建后同步到这里。","title": "这台设备暂无自动化"},"createAutomation": "新建自动化",@@ -584,7 +587,7 @@"timezone": "时区"},"namePlaceholder": "例如:每日项目巡检",- "scriptHint": "这是一个仅运行脚本的自动化,脚本配置只能在桌面端编辑;此处可以改动名称、触发方式、通知等其它字段。",+ "scriptHint": "这是一个仅运行脚本的自动化,脚本配置只能在电脑端编辑;此处可以改动名称、触发方式、通知等其它字段。","promptPlaceholder": "写清楚每次自动执行要让 {{appName}} 做什么","trigger": {"recurring": "周期",@@ -606,6 +609,8 @@"useWorktree": "使用 worktree","modelPlaceholderBound": "跟随任务","modelPlaceholderPiDefault": "留空使用默认模型",+ "boundSessionIdPlaceholder": "任务 ID",+ "effortDefault": "默认","fastMode": "Fast 模式","notifyDesktop": "桌面通知","notifyFeishu": "飞书通知",@@ -619,7 +624,7 @@"confirmArchive": "删除自动化并归档任务","confirmTaskOnly": "只删除自动化","title": "删除 {{name}}",- "copy": "删除自动化不会中断已经开始的执行。生成过的任务按下面的选项处理,和桌面端保持一致。",+ "copy": "删除自动化不会中断已经开始的执行。生成过的任务按下面的选项处理,和电脑端保持一致。","optionsA11y": "选择生成任务处理方式","keepDesc": "只删除这条自动化,历史任务继续保留在原列表里。","keepLabel": "保留生成任务",@@ -635,7 +640,6 @@"detailFallback": "暂停会阻止这条自动化继续触发。","previewFallback": "没有正在执行的 run","confirmA11y": "确认暂停自动化",- "pausing": "暂停中","confirm": "确认暂停","cancelA11y": "取消暂停自动化"},@@ -701,11 +705,10 @@},"scheduleRowA11y": "自动化 {{title}}","detail": {- "promptScriptFallback": "仅运行脚本的自动化,配置只能在桌面端编辑",+ "promptScriptFallback": "仅运行脚本的自动化,配置只能在电脑端编辑","promptEmpty": "没有保存自动化提示词","deleteA11y": "删除自动化","runNowA11y": "立即执行自动化",- "running": "运行中","resumeA11y": "恢复自动化","pauseA11y": "暂停自动化","resume": "恢复",@@ -715,13 +718,10 @@},"run": {"openSessionA11y": "打开自动化生成的任务",- "opening": "打开中","session": "任务","restartA11y": "重新执行自动化",- "restarting": "重跑中","restart": "重跑","markReadA11y": "标记执行记录已读",- "marking": "标记中","markRead": "已读","deleteA11y": "删除执行记录"},@@ -779,7 +779,7 @@"unknownTime": "未知时间","status": {"running": "运行中",- "success": "成功",+ "success": "已完成","failed": "失败","aborted": "已中止","interrupted": "被中断",@@ -812,6 +812,7 @@}},"companions": {+ "noCreateHosts": "当前没有可用的兼容电脑。在电脑上打开 Cindy 并登录同一账号后即可新建伙伴。","messageSent": "已向后台任务发送消息","sentTo": "已发消息给 {{name}}","receivedFrom": "消息来自 {{name}}",@@ -841,13 +842,13 @@"unread": "有新回复","status": {"queued": "正在开始",- "running": "正在做",+ "running": "运行中","waiting": "等待处理","completed": "已完成",- "failed": "失败了",+ "failed": "失败","cancelled": "已停止","timed-out": "已超时",- "unknown": "任务状态查不到了"+ "unknown": "状态未知"},"title": "伙伴","tasks": "任务",@@ -1014,7 +1015,7 @@"memorySaveFailed": "没有保存成功,你的编辑已保留。","memoryMissing": "这条记忆已不存在。","memoryDeleteFailed": "删除失败",- "create": "新伙伴",+ "create": "新建伙伴","createFailed": "暂未确认创建结果,请重试核对。","title": "伙伴资料","profile": "资料与性格",diff --git a/apps/mobile/src/i18n/locales/zh-CN/files.json b/apps/mobile/src/i18n/locales/zh-CN/files.jsonindex 769db7b518..b7e32a0410 100644--- a/apps/mobile/src/i18n/locales/zh-CN/files.json+++ b/apps/mobile/src/i18n/locales/zh-CN/files.json@@ -6,7 +6,7 @@"footerConnecting": "连接中…","folderEmpty": "文件夹为空。","noWorkdir": "该任务没有工作目录,无法浏览文件。",- "rootDir": "(根目录)",+ "rootDir": "(根目录)","copyPath": "复制路径","sendToSession": "发送到对话","exportShare": "导出 / 分享",@@ -58,11 +58,11 @@},"preview": {"nonText": {- "pdf": "PDF 文件暂不支持在手机版内嵌预览;请复制路径,在桌面端或系统 PDF 阅读器中打开。",- "drawio": "Draw.io 文件暂不支持在手机版内嵌预览;请复制路径,在桌面端继续查看或编辑。",- "office": "Office 文件暂不支持在手机版内嵌预览;请复制路径,在桌面端或系统应用中打开。",- "binary": "当前文件不是文本格式,手机版暂不读取内容;可复制路径到桌面端打开。",- "unknown": "当前文件类型无法确认,手机版暂不读取内容;可复制路径到桌面端打开。",+ "pdf": "PDF 文件暂不支持在手机版内嵌预览;请复制路径,在电脑端或系统 PDF 阅读器中打开。",+ "drawio": "Draw.io 文件暂不支持在手机版内嵌预览;请复制路径,在电脑端继续查看或编辑。",+ "office": "Office 文件暂不支持在手机版内嵌预览;请复制路径,在电脑端或系统应用中打开。",+ "binary": "当前文件不是文本格式,手机版暂不读取内容;可复制路径到电脑端打开。",+ "unknown": "当前文件类型无法确认,手机版暂不读取内容;可复制路径到电脑端打开。","text": "可以按需加载文本预览。"},"pathOnly": "当前文件只有路径信息,无法从远程电脑读取预览。",@@ -100,7 +100,7 @@"fetchPdfFailed": "取回 PDF 失败:{{detail}}","fetchingPdf": "正在从电脑取回 PDF…","unsupportedType": "此类型暂不支持在手机上预览",- "oversize": "文件超过预览上限({{size}}),可下载原文件查看",+ "oversize": "文件超过预览上限({{size}}),可下载原文件查看","oversizeUnknown": "过大","binaryFile": "二进制文件,无法以文本预览","readFailed": "读取失败",@@ -131,6 +131,7 @@"browserCancelAddress": "取消编辑","browserReturnToFile": "返回文件","browserCopyAddress": "复制网址",+ "browserCopiedAddress": "已复制网址","browserInvalidAddress": "请输入有效的 http 或 https 网址。","browserWebsiteFailed": "无法打开网页,请尝试重新加载。"},@@ -140,6 +141,6 @@"exportTimeout": "导出超时,请重试"},"gallery": {- "cacheMiss": "远程媒体缓存未命中(cachedOnly)"+ "cacheMiss": "这个媒体还没有缓存到手机上,请在连上电脑后重新打开"}}diff --git a/apps/mobile/src/i18n/locales/zh-CN/interaction.json b/apps/mobile/src/i18n/locales/zh-CN/interaction.jsonindex ab485cbf82..adea39f5ec 100644--- a/apps/mobile/src/i18n/locales/zh-CN/interaction.json+++ b/apps/mobile/src/i18n/locales/zh-CN/interaction.json@@ -20,7 +20,13 @@"allowOnceAccessibility": "允许一次权限请求","allowOnceConfirm": "确认允许一次","highRisk": "高风险",- "autoReviewUnavailable": "自动审批没完成,请确认要不要允许这次操作。"+ "autoReviewUnavailable": "自动审批没完成,请确认要不要允许这次操作。",+ "fullAccessConfirm": {+ "title": "开启完全访问?",+ "description": "完全访问会关闭工作区沙箱并跳过常规审批。{{appName}} 可以修改工作区外的文件、执行联网命令且不再询问;内置高风险操作仍会要求确认。",+ "confirm": "开启完全访问",+ "cancel": "保留当前权限"+ }},"planMode": {"label": "计划模式",@@ -37,7 +43,7 @@"queuePositionNth": "第 {{index}}","composerBlockedByPending": "先处理电脑端的待处理请求后才能继续输入。","missingRequestId": "这个远程交互缺少 requestId,无法回传决定。",- "desktopConfirmUnsupported": "此确认只能在远程电脑处理。请回到桌面端继续。",+ "desktopConfirmUnsupported": "此确认只能在远程电脑上处理。请回到电脑端继续。","unsupportedType": "手机版暂不支持这个远程交互类型。","unsupportedKind": "暂不支持","desktopOnlyKind": "电脑端处理",@@ -158,7 +164,7 @@"sendTitle": "发消息给 Worker","sendBodyFallback": "发送消息","reportTitle": "Worker 回报",- "reportBodyFallback": "(空回报)"+ "reportBodyFallback": "(空回报)"},"contextSheet": {"backAccessibility": "返回上下文面板",@@ -194,7 +200,7 @@"enablePhotoPermission": "开启照片权限","enable": "去开启","icloudTimeout": "照片还在从 iCloud 下载,等待超时了。请检查网络,稍后重试。",- "photoNotReadable": "这张照片暂时无法读取(可能还没从 iCloud 下载完成),请稍后重试。"+ "photoNotReadable": "这张照片暂时无法读取(可能还没从 iCloud 下载完成),请稍后重试。"},"pluginSetup": {"completeOnDesktop": "请在远程电脑完成设置,本卡片会自动更新状态。",@@ -274,7 +280,7 @@"ask_user_question": "回答会保存草稿,提交后电脑端继续。","issue_confirm": "确认标题和正文后再提交。","plugin_setup": "配置要在电脑端完成,这里可以取消这次请求。",- "fallback": "手机版会按桌面端的请求顺序处理。"+ "fallback": "手机上会按电脑端的请求顺序处理。"}}},diff --git a/apps/mobile/src/i18n/locales/zh-CN/message.json b/apps/mobile/src/i18n/locales/zh-CN/message.jsonindex a0c44eb5d1..85a94f3fbb 100644--- a/apps/mobile/src/i18n/locales/zh-CN/message.json+++ b/apps/mobile/src/i18n/locales/zh-CN/message.json@@ -36,7 +36,7 @@"botOriginNamed": "由伙伴「{{name}}」发送","sessionOrigin": "由其他任务发送","openSessionOrigin": "打开来源任务",- "modelMismatch": "本轮由 {{actual}} 响应,而非所选的 {{selected}}(服务端临时降级)",+ "modelMismatch": "本轮由 {{actual}} 响应,而非所选的 {{selected}}(服务端临时降级)","copyStateCopying": "复制中","copyStateCopied": "已复制","copyStateFailed": "复制失败",@@ -67,12 +67,15 @@"subagentTyped": "Subagent · {{type}}","subagent": "Subagent","workedDuration": "已工作 {{duration}}",+ "durationSeconds": "{{seconds}} 秒",+ "durationMinutes": "{{minutes}} 分钟",+ "durationMinutesSeconds": "{{minutes}} 分 {{seconds}} 秒","subagentSummary": "Subagent 小结","agentSwitchLabel": "已从 {{from}} 切换到 {{to}}","agentSwitchViewHandoff": "{{label}},查看交接内容","sessionResumedPill": "已续接原任务",- "handoffContentDesc": "交接内容——切换时发送给新引擎的上下文摘要(不计入对话记录,仅在此展示)",- "handoffContentDescEnglishSource": "交接内容——切换时发送给新引擎的上下文摘要,原文为英文(不计入对话记录,仅在此展示)",+ "handoffContentDesc": "交接内容——切换时发送给新引擎的上下文摘要(不计入对话记录,仅在此展示)",+ "handoffContentDescEnglishSource": "交接内容——切换时发送给新引擎的上下文摘要,原文为英文(不计入对话记录,仅在此展示)","openDiagramDetail": "打开图表详情","sessionChipFallback": "任务 {{id}}","imageFallbackTitle": "图片",@@ -86,11 +89,10 @@"copyDetailContent": "复制详情内容","openDetailLink": "打开详情链接","mediaNotPreviewable": "当前媒体暂不能直接预览。",- "retryRemoteMediaFetch": "重试远程媒体取件",- "retryFetch": "重试取件",+ "retryRemoteMediaFetch": "重试取回远程媒体",+ "retryFetch": "重试取回","openMedia": "打开媒体","readCurrentRemoteFile": "读取当前远程文件",- "reading": "读取中","retryFilePreview": "重试文件预览","readCurrentFile": "读取当前文件","currentFilePreview": "当前文件预览",@@ -107,10 +109,10 @@"copyPath": "复制路径","copiedPath": "已复制路径","copyPathFailed": "复制路径失败",- "remoteMediaIdle": "正在准备远程媒体取件",- "remoteMediaLoading": "正在从远程设备取件",+ "remoteMediaIdle": "正在准备取回远程媒体",+ "remoteMediaLoading": "正在从远程设备取回","remoteMediaReady": "已取回远程媒体",- "remoteMediaFetchFailed": "取件失败:{{message}}",+ "remoteMediaFetchFailed": "取回失败:{{message}}","mediaPending": "{{label}} 待播放","mediaLoaded": "{{label}} 已加载{{progress}}","mediaPlaying": "{{label}} 播放中{{progress}}",@@ -123,17 +125,17 @@"mediaSize": "大小:{{size}}","mediaExpiresAt": "过期时间:{{time}}","mediaErrorLine": "错误:{{message}}",- "mediaDeviceLinkHint": "移动端会通过 device-link 请求远程设备上传媒体后再打开。",+ "mediaDeviceLinkHint": "打开前,手机会先请远程设备上传这个媒体。","controlDelete": "删除消息",- "controlRewind": "回退到这里",- "controlFork": "分叉任务",+ "controlRewind": "回到此处",+ "controlFork": "从这里开启新任务","markdownDocAriaLabel": "消息正文","toolOutputTitle": "{{label}} 输出","toolInputTitle": "{{label}} 输入","viewToolInput": "查看完整输入","loadingToolInput": "正在读取完整输入","retryToolInput": "读取失败,重试",- "toolResultCompacted": "Full tool output was released (original size {{size}})",+ "toolResultCompacted": "已精简完整工具输出(原始大小 {{size}})","mermaidEmpty": "空 Mermaid 图表。","diffEditCount": "{{n}} 处编辑"},@@ -162,7 +164,7 @@"closeImage": "关闭图片"},"queue": {- "continueSystemInstruction": "继续未完成的任务(系统指令)",+ "continueSystemInstruction": "继续未完成的任务(系统指令)","systemInstruction": "系统指令","retrySend": "重试发送","clearError": "清除错误",@@ -177,7 +179,7 @@"attachmentCount": "{{n}} 个附件","attachmentMessage": "附件消息","steeringLabel": "插话发送中:{{text}}",- "queuedMessageLabel": "排队消息 {{index}}:{{text}}",+ "queuedMessageLabel": "排队消息 {{index}}:{{text}}","editingInComposer": "正在下方输入框编辑…","cancel": "取消","edit": "编辑",@@ -197,8 +199,8 @@"labelOverflow": "已整理上下文并继续","labelTimeout": "上一轮没有响应,已整理后继续","labelStrip": "已去掉过大图片并继续",- "handoffTitle": "交接内容——整理后发送给后续对话的上下文摘要(不计入对话记录,仅在此展示)",- "handoffTitleEnglishSource": "交接内容——整理后发送给后续对话的上下文摘要,原文为英文(不计入对话记录,仅在此展示)"+ "handoffTitle": "交接内容——整理后发送给后续对话的上下文摘要(不计入对话记录,仅在此展示)",+ "handoffTitleEnglishSource": "交接内容——整理后发送给后续对话的上下文摘要,原文为英文(不计入对话记录,仅在此展示)"},"compact": {"savedTokens": "节省 {{tokens}} tokens",@@ -228,7 +230,7 @@"sessionResumed": "已续接","agentSwitch": "已从 {{from}} 切换到 {{to}}","learnStarted": "技能学习已启动",- "learnStartedBody": "蒸馏在桌面端后台进行,完成后请到桌面端查看并评审技能草案。",+ "learnStartedBody": "蒸馏在电脑端后台进行,完成后请到电脑端查看并评审技能草案。","learnFailed": "技能学习未能启动","learnBusyBody": "已有一个学习任务在运行中,等它完成后再试。","learnFailedBody": "启动失败:{{detail}}",@@ -241,13 +243,13 @@"errorHint": "先处理队列错误,再继续发送新的消息。","errorTitle": "队列需要处理","abortQueued": "{{count}} 条消息保留在队列里",- "abortWaiting": "等待桌面端确认停止",+ "abortWaiting": "等待电脑端确认停止","abortHint": "停止完成前先不要重复发送,保留的消息会继续显示在这里。","abortTitle": "停止处理中","pausedDetail": "{{count}} 条消息等待恢复",- "pausedHint": "点“继续”后会按当前顺序继续发送到桌面端。",+ "pausedHint": "点「继续」后会按当前顺序继续发送到电脑端。","pausedTitle": "队列已暂停",- "defaultDetail": "{{count}} 条消息 · 按桌面端顺序发送",+ "defaultDetail": "{{count}} 条消息 · 按电脑端顺序发送","defaultHint": "可调整顺序、插话、编辑或删除普通队列消息。","defaultTitle": "待发送队列"},@@ -259,14 +261,14 @@"steering": "插话发送中","orcaTitle": "协同队列 {{index}}","title": "队列 {{index}}",- "orcaReadOnly": "协同消息由桌面端编排,手机端只读显示。",+ "orcaReadOnly": "协同消息由电脑端编排,手机上只能查看。","busy": "队列操作同步中,完成后再继续操作。",- "steeringDisabled": "插话正在发送到当前 turn,等待桌面端回流后再操作。",+ "steeringDisabled": "插话正在发送到当前这一轮,等电脑端回应后再操作。","editLocked": "这条队列消息正在编辑中,完成后再操作。","interactionLocked": "队列正在被其它操作锁定,完成后再操作。","syntheticHint": "这是系统自动生成的指令,可以取消,但不能编辑或插话发送。","steeringHint": "插话正在发送到当前 turn,暂时不能编辑或移动。",- "editHint": "这条消息正在编辑中,桌面端会暂停自动发送。",+ "editHint": "这条消息正在编辑中,电脑端会暂停自动发送。","interactionHint": "队列正在被排序或其它交互锁定,暂时不能编辑。"}},@@ -277,11 +279,11 @@"mermaidSourceTitle": "Mermaid 图表源码","diffStats": "+{{insertions}} / -{{deletions}} 行","directPreview": "可直接预览",- "remoteFetchRequired": "需要远程取件",+ "remoteFetchRequired": "需要从远程设备取回","chartSource": "图表源码","noDiffContent": "没有 diff 内容。","noMediaAddress": "没有媒体地址。",- "remoteMediaPreparing": "正在准备远程媒体取件",+ "remoteMediaPreparing": "正在准备取回远程媒体","mediaAddressOnlySentence": "当前媒体类型暂以地址形式展示。","mediaCannotPreviewSentence": "当前媒体暂不能直接预览。","emptyMermaid": "空 Mermaid 图表。",@@ -294,7 +296,7 @@"remotePathMissing": "缺少远程路径","fetchMedia": "取回媒体","fetchMediaFromDesktop": "需要从电脑端取回媒体",- "pendingFetch": "待取件",+ "pendingFetch": "待取回","previewMedia": "预览媒体","previewable": "可预览","openMedia": "打开媒体",@@ -310,9 +312,9 @@"video": "视频","audio": "音频","inlineMediaData": "内联{{kind}}数据",- "mediaActionsAvailable": "桌面端为这个媒体提供了后续操作。",+ "mediaActionsAvailable": "电脑端为这个媒体提供了后续操作。","availableActions": "可用操作:{{actions}}",- "mediaActionsDesktopOnly": "手机版 V1 只安全展示这些操作,暂不远程触发。请回到电脑端点击。",+ "mediaActionsDesktopOnly": "手机上暂时只能查看这些操作,请在电脑端操作。","moreEdits": "…还有 {{count}} 处编辑"},"quote": {diff --git a/apps/mobile/src/i18n/locales/zh-CN/models.json b/apps/mobile/src/i18n/locales/zh-CN/models.jsonindex 8c582295d2..1303524033 100644--- a/apps/mobile/src/i18n/locales/zh-CN/models.json+++ b/apps/mobile/src/i18n/locales/zh-CN/models.json@@ -65,7 +65,7 @@"restoreRecommended": "恢复推荐","saveFailed": "未能保存,请重试。","configure": "设置",- "syncFailed": "收藏未能同步。请重新打开重试;被控电脑可能需要更新。",+ "syncFailed": "收藏未能同步。请重新打开重试;远程电脑上的 Cindy 可能需要更新。","timeUnit": {"day": "天","hour": "小时",diff --git a/apps/mobile/src/i18n/locales/zh-CN/remoteDesktop.json b/apps/mobile/src/i18n/locales/zh-CN/remoteDesktop.jsonindex 9097cc06d7..a712156257 100644--- a/apps/mobile/src/i18n/locales/zh-CN/remoteDesktop.json+++ b/apps/mobile/src/i18n/locales/zh-CN/remoteDesktop.json@@ -159,7 +159,7 @@"lockOnExit": "退出后锁定电脑","lockOnExitHint": "退出远程桌面时锁屏。重连或切换 App 不会触发。","lockOnExitFailed": "未能确认电脑已锁屏,请检查电脑的锁屏状态。",- "hostMute": "被控端静音",- "hostMuteHint": "连接期间将被控电脑静音",- "hostMuteFailed": "无法修改被控端静音状态"+ "hostMute": "远程电脑静音",+ "hostMuteHint": "连接期间将远程电脑静音",+ "hostMuteFailed": "无法修改远程电脑的静音状态"}diff --git a/apps/mobile/src/i18n/locales/zh-CN/session.json b/apps/mobile/src/i18n/locales/zh-CN/session.jsonindex fff9f68263..43328eb661 100644--- a/apps/mobile/src/i18n/locales/zh-CN/session.json+++ b/apps/mobile/src/i18n/locales/zh-CN/session.json@@ -29,18 +29,18 @@"openMicPermission": "打开麦克风权限设置","maxAttachments": "最多添加 {{max}} 个附件。","voiceStopRecording": "停止录音",- "capabilitiesUnsupported": "远程能力返回格式不支持"+ "capabilitiesUnsupported": "无法读取电脑端的命令和资源列表,请更新电脑上的 Cindy 后重试"},"presentation": {"collaboration": {"labelLead": "协同 Lead","labelWorker": "协同 Worker","labelRole": "协同 {{role}}",- "noticeLead": "这是桌面端 Orca Lead 任务。可以在手机上继续发消息;创建 Worker、切换焦点、Fork/Rewind、编辑队列和修改任务设置等编排操作请在电脑端完成。",- "noticeWorker": "这是桌面端 Orca Worker 任务。手机版第一版只读,不提供发送消息、切换 Worker 焦点、归档 Worker 或停止协同。",- "noticeOther": "这是桌面端协同任务。手机版第一版只读,协同编排操作请在电脑端完成。",- "readOnlyReason": "协同模式在手机版第一版中为只读。确认处理、队列编辑和任务修改请在电脑端完成。",- "composerReadOnlyReason": "这个协同子任务在手机版中只读,请在电脑端发送消息。"+ "noticeLead": "这是电脑端的 Orca Lead 任务。可以在手机上继续发消息;创建 Worker、切换焦点、回到此处、从这里开启新任务、编辑队列和修改任务设置,请在电脑端操作。",+ "noticeWorker": "这是电脑端的 Orca Worker 任务。手机上暂时只能查看;发送消息、切换 Worker 焦点、归档 Worker 或停止协同,请在电脑端操作。",+ "noticeOther": "这是电脑端的协同任务。手机上暂时只能查看,协同编排请在电脑端操作。",+ "readOnlyReason": "协同任务在手机上暂时只能查看。确认处理、编辑队列和修改任务,请在电脑端操作。",+ "composerReadOnlyReason": "这个协同子任务在手机上暂时只能查看,请在电脑端发送消息。"},"composer": {"voice": {@@ -83,7 +83,7 @@"default": "继续聊一聊…"},"guidance": {- "sending": "消息正在写入桌面端队列,完成前请不要重复发送。",+ "sending": "消息正在写入电脑端队列,完成前请不要重复发送。","queueBusy": "正在同步队列操作,完成后会刷新队列状态。","listeningWithDraft": "点发送会结束语音并发送当前文字;点输入框会结束语音并弹出键盘。","listening": "正在听;点发送会结束语音并发送识别的文字,点输入框可结束语音并弹出键盘。",@@ -93,7 +93,7 @@"attachmentsWithText": "将发送 {{count}} 个附件和输入框里的文字。","attachmentsOnly": "将只发送 {{count}} 个附件,也可以补充说明后再发送。","attachmentPickerOpen": "可以添加手机上的照片、截图或文件。",- "draft": "点发送后会进入桌面端队列,按当前任务设置执行。",+ "draft": "点发送后会进入电脑端队列,按当前任务设置执行。","quotesOnly": "将发送 {{count}} 处引用,也可以补充说明后再发送。","canStop": "电脑端正在执行;可继续排队输入,或点停止保留当前队列。","empty": "输入文字开始,使用 / 调命令,使用 @ 引用项目资源。"@@ -208,7 +208,7 @@"shareUnsupported": "当前客户端暂不支持分享,更新到最新版本后重试。","downloadFailed": "下载失败","voiceNoRemoteDevice": "缺少远程设备,不能开始语音输入。",- "voiceSenderNotReady": "消息发送器未初始化。",+ "voiceSenderNotReady": "消息暂时无法发送,请返回后重新进入任务。","voiceStopAndSend": "结束语音输入并发送","sendMessage": "发送远程消息","voiceStartInput": "开始语音输入",@@ -311,7 +311,7 @@"selectAgent": "选择 Agent","switchToAgent": "切换到 {{label}}","selectWorkspace": "选择工作区",- "dialogueNoProject": "对话(不绑定项目)",+ "dialogueNoProject": "对话(不绑定项目)","selectProjectNamed": "选择项目 {{title}}","noProjects": "暂无项目","chooseOtherFolder": "选择其他项目文件夹",@@ -329,7 +329,7 @@"selectDir": "选择目录 {{name}}","select": "选择","noModelSelected": "未选择模型",- "assignedDialogueDir": "电脑端分配对话目录",+ "assignedDialogueDir": "由电脑自动分配工作目录","extraDirsSuffix": "+{{num}} 附加目录","noProjectPath": "未选择项目路径","dialogueWorkspace": "对话工作区",@@ -360,7 +360,7 @@"worktreeNotGitRepo": "当前目录不是 git 仓库","worktreeAlreadyInWorktree": "已在 worktree 中,禁止嵌套","worktreeDetectFailed": "无法检测目录环境,可稍后重选目录再试",- "worktreeUnsupported": "当前桌面端无法安全创建 worktree,请关闭 worktree 后继续,或升级桌面端。",+ "worktreeUnsupported": "电脑端当前的 Cindy 无法安全创建 worktree,请关闭 worktree 后继续,或更新电脑上的 Cindy。","worktreeCreateFailed": "worktree 创建失败:{{message}}","worktreeRecoveryStateFailed": "无法保存 worktree 恢复状态,请重试。","worktreeCleanupPending": "上一次 worktree 仍待回收,请重新连接设备后再试。"@@ -452,7 +452,6 @@"contextLabel": "上下文","accountLimits": "账号限额","quotaExhaustedResettable": "当前配额已耗尽。重置会立即消耗 1 次,且不能撤销。",- "resetting": "正在重置…","resetCodexUsage": "重置 Codex 用量","quotaExhaustedNoCredit": "当前配额已耗尽,但没有可用重置次数。","openDir": "打开目录",@@ -470,7 +469,8 @@"noSubDirs": "这个目录下没有可进入的子目录。","dirLimitNotice": "仅显示前 30 个目录,可进入更具体的目录继续选择。","confirmRename": "确认重命名",- "confirm": "确定",+ "renameSubmit": "重命名",+ "confirm": "重命名","cancelRename": "取消重命名","backToMenu": "返回任务菜单"},@@ -496,8 +496,8 @@"toolUseLoopDetectedConsecutiveWithCount": "模型重复调用同一个工具 {{count}} 次,Cindy 已停止本轮以避免无限循环。可以发送新消息继续。","toolUseLoopDetectedPingPongWithCount": "模型在多个工具调用之间来回循环,Cindy 检测到本轮已有 {{count}} 次调用后停止了本轮。可以发送新消息继续。","toolUseLoopDetectedRotationWithCount": "模型持续轮转调用多个工具,Cindy 检测到本轮已有 {{count}} 次调用后停止了本轮。可以发送新消息继续。",- "codexThreadLost": "Codex 鉴权模式已切换,当前任务无法继续 —— 请新建任务后生效。",- "encryptedContentInvalid": "由于更换供应商导致加密不可用,本任务只能在原供应商下使用;请回到电脑端处理(可 Fork 丢弃协议加密内容后在新任务继续)。"+ "codexThreadLost": "Codex 鉴权模式已切换,当前任务无法继续,请新建任务。",+ "encryptedContentInvalid": "由于更换供应商导致加密不可用,本任务只能在原供应商下使用;请回到电脑端处理(可以用「从这里开启新任务」丢弃协议加密内容,在新任务里继续)。"},"row": {"moreOptions": "更多选项",@@ -514,6 +514,8 @@"authGateHint": "{{agent}} 在这台电脑上还没有已连接的模型供应商,发送会失败。请在电脑端 {{appName}} 的「设置 → 模型供应商」完成配置。"},"outbox": {+ "deleteConfirmTitle": "删除这条消息?",+ "deleteConfirmBody": "这条消息没有发送成功,删除后无法恢复。","legacyPlanRecovery": "这台电脑暂不支持在计划模式下恢复待发消息。请关闭计划模式,或更新电脑上的 Cindy 后重试","creationRecoveryRequired": "请先重试创建任务,再删除首条消息;这条消息还保存着后续消息所需的任务恢复信息。","confirmationRequired": "电脑暂时无法确认是否收到这条消息。请核对消息记录,或更新电脑上的 Cindy 后重试。",@@ -523,26 +525,26 @@"taskAlreadyCreated": "电脑上已创建这个任务,已保存的消息会在原任务中继续发送。"},"remoteError": {- "REMOTE_DAEMON_CLOSED": "远端连接中断了,可能正在更新。这一轮已经结束,请重新发送。",- "REMOTE_LOCAL_ATTACHMENT_UNSUPPORTED": "远端任务无法访问本地文件/图片附件。请直接粘贴内容。",+ "REMOTE_DAEMON_CLOSED": "远程连接中断了,可能正在更新。这一轮已经结束,请重新发送。",+ "REMOTE_LOCAL_ATTACHMENT_UNSUPPORTED": "远程任务无法访问本地文件或图片附件。请直接粘贴内容。","AUTO_REVIEW_UNAVAILABLE": "自动审批暂时无法给出判断,需要审批的操作已改为由你确认。想少被打断,可以把任务切到「完全访问」,但风险更高。","AUTO_REVIEW_UNAVAILABLE_WECHAT": "自动审批暂时无法给出判断,需要审批的操作已改为由你确认。个人微信不能使用「完全访问」,请直接确认这次操作。","AUTO_REVIEW_CONFIRM_UNDELIVERED": "自动审批没完成,确认也没有送到或没有被点。这次拒绝不是你点的。",- "REMOTE_COMPAT_MODE_UNSUPPORTED": "远端任务不能使用本机兼容通道。请改用 Cindy AI,或在本机任务里继续。",- "REMOTE_GATEWAY_ENDPOINT_UNAVAILABLE": "Cindy AI 凭据尚未就绪(登录后由服务端自动下发)。请稍候重试;若持续出现,请到 设置 → 模型供应商 检查 Cindy AI 连接状态。",- "REMOTE_LOCAL_ONLY_PROVIDER": "该模型供应商是本机专属服务(如 Ollama),SSH 远端任务无法访问本机地址。请改用 Cindy AI 网关,或选择远端主机可达的模型供应商。",+ "REMOTE_COMPAT_MODE_UNSUPPORTED": "远程任务不能使用本机兼容通道。请改用 Cindy AI,或在本机任务里继续。",+ "REMOTE_GATEWAY_ENDPOINT_UNAVAILABLE": "Cindy AI 凭据尚未就绪(登录后由服务端自动下发)。请稍候重试;若持续出现,请到「设置 → 模型供应商」检查 Cindy AI 连接状态。",+ "REMOTE_LOCAL_ONLY_PROVIDER": "该模型供应商是本机专属服务(如 Ollama),SSH 远程任务无法访问本机地址。请改用 Cindy AI 网关,或选择远程主机可达的模型供应商。","DEVICE_LINK_CONTROL_DISABLED": "已关闭对该设备的控制,消息未发送。","DEVICE_LINK_MEDIA_TRANSFER_FAILED": "附件传输失败,消息未发送。请重试。",- "MCP_APPROVAL_AUTO_BLOCKED": "这次工具调用被自动审核拦截,未收到你手动拒绝的记录。",+ "MCP_APPROVAL_AUTO_BLOCKED": "这次工具调用被自动审批拦截,未收到你手动拒绝的记录。","MCP_APPROVAL_CONFIRMATION_TIMEOUT": "权限确认超时,未收到有效的确认结果。仅凭超时无法判断你是否点过按钮。","MCP_APPROVAL_CONFIRMATION_UNAVAILABLE": "这次权限确认未完成,未收到你手动拒绝的记录。",- "REMOTE_HOST_PROXY_FORWARD_UNAVAILABLE": "这个模型需要电脑端转发请求,当前远端连接还不能转发。请改用 Cindy AI,或在本机任务里使用这个模型。",+ "REMOTE_HOST_PROXY_FORWARD_UNAVAILABLE": "这个模型需要电脑端转发请求,当前远程连接还不能转发。请改用 Cindy AI,或在本机任务里使用这个模型。","REMOTE_MODEL_SWITCH_ROUTE_CHANGE": "换成这个模型需要另一条连接。请新建任务后再使用。",- "REMOTE_NATIVE_OAUTH_UNAVAILABLE": "远端任务还不能使用订阅登录。请改用 Cindy AI,或选择已配置密钥的模型供应商。",- "REMOTE_PI_CONTEXT_PROFILE_UNAVAILABLE": "远端 Pi 任务不能使用这个上下文配置。请改用 Cindy AI,或选择远端可以访问的模型。",- "REMOTE_PROVIDER_UNSUPPORTED": "远端任务还不能使用这个模型供应商。请换一个供应商,或在本机任务里使用它。",+ "REMOTE_NATIVE_OAUTH_UNAVAILABLE": "远程任务还不能使用订阅登录。请改用 Cindy AI,或选择已配置密钥的模型供应商。",+ "REMOTE_PI_CONTEXT_PROFILE_UNAVAILABLE": "远程 Pi 任务不能使用这个上下文配置。请改用 Cindy AI,或选择远程电脑可以访问的模型。",+ "REMOTE_PROVIDER_UNSUPPORTED": "远程任务还不能使用这个模型供应商。请换一个供应商,或在本机任务里使用它。","REMOTE_PROVIDER_UPDATING": "这个模型供应商的凭据正在更新。请稍后再试。",- "REMOTE_WORKDIR_UNAVAILABLE": "远端工作目录现在不可用。请确认那台电脑上的目录还在,然后重试。",+ "REMOTE_WORKDIR_UNAVAILABLE": "远程工作目录现在不可用。请确认那台电脑上的目录还在,然后重试。","REMOTE_OPTIMISTIC_SESSION_STATE_UNAVAILABLE": "电脑端暂时无法确认这条消息是否已经发出。请稍后再试,不要重复发送同一条。"}}diff --git a/apps/mobile/src/i18n/locales/zh-CN/settings.json b/apps/mobile/src/i18n/locales/zh-CN/settings.jsonindex 1ee7a24b1b..f00aa51c4a 100644--- a/apps/mobile/src/i18n/locales/zh-CN/settings.json+++ b/apps/mobile/src/i18n/locales/zh-CN/settings.json@@ -19,8 +19,8 @@"cancel": "取消","exportHint": "分享详细本地日志供排障使用;不包含对话正文或凭证。","options": "日志选项",- "uploadCopied": "上传成功,编号 {{code}} 已复制。",- "uploadSucceeded": "上传成功,编号 {{code}}。"+ "uploadCopied": "日志已上传,编号 {{code}} 已复制",+ "uploadSucceeded": "日志已上传,编号 {{code}}"},"title": "设置","appearance": {@@ -47,15 +47,14 @@},"version": {"sectionTitle": "版本",- "currentLabel": "当前版本",- "bundleVersion": "整包版本 {{version}}",- "otaVersion": "热更版本 {{version}}",+ "appVersion": "版本 {{version}}",+ "updateMethodInApp": "更新方式:在 App 内更新,重启后生效",+ "updateMethodPackage": "更新方式:下载并安装新版本",+ "updateMethodUnavailable": "开发版,不支持 App 内更新","pairedDesktopVersion": "配套桌面版本 {{version}}",- "devNoOta": "开发版,热更不可用","checkAction": "检查更新","testFlightCheckAction": "检查内容更新","checking": "检查中",- "updating": "更新中","checkingAccessibility": "正在检查更新","testFlightCheckingAccessibility": "正在检查内容更新","testFlightUpdateManaged": "测试版安装更新由 TestFlight 管理",@@ -144,7 +143,8 @@"runtime": "Runtime","otaMarker": "热更标记","emergencyLaunch": "应急启动",- "emergencyLaunchYes": "是(本次运行内热更无法生效)"+ "emergencyLaunchYes": "是(本次运行内热更无法生效)",+ "otaVersion": "热更版本"},"legal": {"sectionTitle": "备案信息",@@ -161,6 +161,8 @@"analyticsResetAction": "恢复"},"account": {+ "logoutConfirmTitle": "退出登录?",+ "logoutConfirmRunning": "仍有任务正在运行。退出后任务会继续在电脑上运行,但这台手机将不再接收和控制这些任务;这台手机上保存的账号和本地远程镜像也会被清除。","logoutHint": "退出会清除这台手机上保存的全部账号和本地远程镜像,不会影响电脑端任务。","logout": "退出登录","loggingOut": "退出中",@@ -193,9 +195,12 @@"resetAccessibility": "恢复默认本机名称","emptyError": "设备名称不能为空。","deviceInitializing": "设备还在初始化,请稍后再试。",- "saving": "保存中…",- "saved": "已保存。",- "restoringDefault": "正在恢复默认名称…",- "restoredDefault": "已恢复默认名称。"+ "restoredDefault": "已恢复默认名称。",+ "resetAction": "恢复默认名称",+ "clearAccessibility": "清空名称",+ "discardTitle": "放弃修改?",+ "discardBody": "设备名称的修改还没有保存。",+ "discardConfirm": "放弃修改",+ "keepEditing": "继续编辑"}}diff --git a/apps/mobile/src/i18n/locales/zh-CN/sharedTask.json b/apps/mobile/src/i18n/locales/zh-CN/sharedTask.jsonindex cfdbfc347d..86dbf83fde 100644--- a/apps/mobile/src/i18n/locales/zh-CN/sharedTask.json+++ b/apps/mobile/src/i18n/locales/zh-CN/sharedTask.json@@ -42,7 +42,7 @@"joined": "已加入共享任务","joinedBody": "你可以查看加入前的消息、工具结果和附件,也可以向同一个 Agent 发消息。","enterTask": "进入任务",- "inviteBoxTitle": "将邀请发给你的伙伴",+ "inviteBoxTitle": "把邀请发给要一起协作的人","roleGuest": "访客","removeShort": "移除","removeNamedTitle": "移除{{name}}?",diff --git a/apps/mobile/src/i18n/locales/zh-TW/composer.json b/apps/mobile/src/i18n/locales/zh-TW/composer.jsonindex 603a65304b..35bd44024f 100644--- a/apps/mobile/src/i18n/locales/zh-TW/composer.json+++ b/apps/mobile/src/i18n/locales/zh-TW/composer.json@@ -17,7 +17,7 @@"uploadFailed": "{{name}} · 上傳失敗","collapsedBadge": "{{count}} 個附件,點選展開","imageNotAnnotatable": "這張圖片暫不支援標註或轉發。",- "downloadOriginalFailed": "下載原圖失敗(HTTP {{status}})。",+ "downloadOriginalFailed": "原圖下載失敗,請稍後重試(HTTP {{status}})。","annotationSaveFailed": "標註儲存失敗","tryAgain": "請重試。","sendToChat": "傳送到對話",@@ -25,11 +25,11 @@"fileNotFound": "檔案不存在","pathNotReadable": "該路徑不允許讀取","readFailed": "讀取失敗",- "notFetchableMedia": "不是可取件的桌面端媒體",- "mediaResultInvalid": "遠端媒體取件結果無效",+ "notFetchableMedia": "這個媒體無法從電腦端取回",+ "mediaResultInvalid": "遠端媒體取回結果無效,請重試","mediaUrlInvalid": "遠端媒體下載地址無效",- "mediaCacheMiss": "遠端媒體快取未命中(cachedOnly)",- "mediaFetchCancelled": "遠端媒體取件已取消",+ "mediaCacheMiss": "這個媒體還沒有快取到手機上,請在連上電腦後重新開啟",+ "mediaFetchCancelled": "已取消取回遠端媒體","fileMenu": {"openBrowser": "開啟檔案瀏覽器","sendToSession": "傳送到對話",@@ -49,9 +49,9 @@"integrityUnavailable": "當前附件上傳體無法進行完整性校驗。","sizeChanged": "附件大小已變化:預期 {{expected}} 位元組,實際 {{actual}} 位元組。","invalidSize": "附件大小無效,無法計算完整性摘要。",- "invalidBase64": "附件分塊不是有效的 base64。",+ "invalidBase64": "附件資料讀取出錯,請重新新增後再傳送。","failedHttp": "附件上傳失敗:HTTP {{status}}{{code}}",- "failedNetwork": "附件上傳失敗:網路傳輸異常,請檢查網路後重試。({{detail}})",+ "failedNetwork": "附件上傳失敗:網路傳輸異常,請檢查網路後重試。({{detail}})","timeout": "附件上傳超時,請檢查網路後重試。","fileTypeUnsupported": "這個本機檔案型別暫不支援作為附件傳送。","snapshotFailedNoCacheDir": "無法建立附件快照:快取目錄不可用",@@ -89,13 +89,13 @@"realtimeUnsupported": "手機版即時語音暫不支援 {{detail}} ASR。","realtimeAuthUnsupported": "手機版即時語音暫不支援 {{auth}} ASR 鑑權。","realtimeProtocolUnsupported": "手機版即時語音暫不支援 {{detail}} ASR 協議。",- "missingConnectionProvider": "手機語音輸入需要 {{appName}} 語音會話票據(缺少 connectionProvider)。",+ "missingConnectionProvider": "語音服務暫時無法使用,請重新登入 {{appName}} 後重試。","realtimeAsrFailed": "即時語音識別失敗。","volcengineAuthUnsupported": "手機版 Volcengine 語音暫不支援 {{auth}} 鑑權。","volcengineMissingResourceId": "Volcengine ASR 配置缺少 resourceId。",- "sessionExpiredOrForbidden": "{{appName}} 語音會話已失效或沒有權限(WebSocket {{status}})。請確認登入狀態後重試。",+ "sessionExpiredOrForbidden": "{{appName}} 語音服務的登入已失效或沒有權限,請確認登入狀態後重試(狀態碼 {{status}})。","incomplete": "語音輸入未完成,請重試。",- "missingRefinerTargetProvider": "手機版語音潤色需要 {{appName}} 語音會話(缺少 refinerTargetProvider)。",+ "missingRefinerTargetProvider": "語音潤色暫時無法使用,請重新登入 {{appName}} 後重試。","emptyTranscript": "檢測到語音但未識別出文字,請重試。","connectionInterrupted": "語音連線中斷了,請檢查網路後重試。","recognitionStalled": "語音識別沒有繼續返回結果,請重試。",diff --git a/apps/mobile/src/i18n/locales/zh-TW/devices.json b/apps/mobile/src/i18n/locales/zh-TW/devices.jsonindex 3d24944224..2199cb9d1b 100644--- a/apps/mobile/src/i18n/locales/zh-TW/devices.json+++ b/apps/mobile/src/i18n/locales/zh-TW/devices.json@@ -12,6 +12,10 @@"deleteFailed": "刪除裝置失敗。","deleteOnline": "裝置目前在線,請讓裝置離線後再刪除。","currentlyOnline": "目前在線",+ "availableSection": "在線裝置",+ "offlineSection": "離線裝置",+ "showAllOffline": "顯示全部 {{count}} 台",+ "showFewerOffline": "收合","nameTooLong": "裝置名稱不能超過 {{limit}} 個字元。","fields": {"name": "名稱",@@ -29,9 +33,7 @@"common": {"cancel": "取消","save": "儲存",- "saving": "儲存中","delete": "刪除",- "deleting": "刪除中","create": "新建"},"resources": {@@ -47,7 +49,8 @@"openFailed": "無法開啟任務","resolving": "正在開啟最新任務…","retry": "重試",- "hostCount": "{{count}} 台電腦"+ "hostCount": "{{count}} 台電腦",+ "stale": "內容可能已過期,暫時無法更新"},"presentation": {"deviceList": {@@ -177,10 +180,10 @@},"home": {"allDevices": "全部",- "allComputers": "全部電腦",+ "allComputers": "全部裝置","waitingCount": "{{count}} 待處理","synced": "已同步",- "unknownComputer": "未知電腦",+ "unknownComputer": "未知裝置","uncategorizedProject": "未分類專案","cindyMake": "Cindy Make","empty": {@@ -294,7 +297,7 @@"error": {"sessionDeviceNotFound": "找不到這個任務所屬裝置,請重新同步後再試。","taskDeviceNotFound": "找不到這個任務所屬裝置,請重新同步後再試。",- "noDevice": "沒有可用裝置。請先開啟桌面端遠端控制,然後重新同步。"+ "noDevice": "沒有可用裝置。請先在電腦端開啟遠端控制,然後重新同步。"},"alert": {"cacheSaveFailed": "離線快取未能儲存",@@ -314,7 +317,7 @@"syncing": "正在重新同步","sync": "重新同步","pinnedConversations": "置頂 {{count}} 條任務",- "newRemoteConversation": "新建遠端任務",+ "newRemoteConversation": "新建任務","renameDevice": "重新命名 {{label}}","project": "專案 {{title}}","dialogue": "對話",@@ -537,8 +540,8 @@},"runNow": "立即執行","error": {- "projectMissingConfig": "專案自動化缺少 projectConfigId,請在桌面端刪除",- "deletePartial": "自動化已刪除,但 {{count}} 個生成任務未能更新狀態。請在桌面端檢查這些任務。"+ "projectMissingConfig": "這個專案自動化缺少專案設定,請在電腦端刪除",+ "deletePartial": "自動化已刪除,但 {{count}} 個生成任務未能更新狀態。請在電腦端檢查這些任務。"},"subtitle": "{{active}} 個執行中 · {{total}} 個自動化","metric": {@@ -551,7 +554,7 @@"default": "選擇自動化後可以執行、暫停、編輯或開啟最近任務。"},"empty": {- "copy": "可以直接從手機建立第一條自動化,或在桌面端建立後同步到這裡。",+ "copy": "可以直接從手機建立第一條自動化,或在電腦端建立後同步到這裡。","title": "這臺裝置暫無自動化"},"createAutomation": "新建自動化",@@ -584,7 +587,7 @@"timezone": "時區"},"namePlaceholder": "例如:每日專案巡檢",- "scriptHint": "這是一個僅執行指令碼的自動化,指令碼配置只能在桌面端編輯;此處可以改動名稱、觸發方式、通知等其它欄位。",+ "scriptHint": "這是一個僅執行指令碼的自動化,指令碼配置只能在電腦端編輯;此處可以改動名稱、觸發方式、通知等其它欄位。","promptPlaceholder": "寫清楚每次自動執行要讓 {{appName}} 做什麼","trigger": {"recurring": "週期",@@ -606,6 +609,8 @@"useWorktree": "使用 worktree","modelPlaceholderBound": "跟隨任務","modelPlaceholderPiDefault": "留空使用預設模型",+ "boundSessionIdPlaceholder": "任務 ID",+ "effortDefault": "預設","fastMode": "Fast 模式","notifyDesktop": "桌面通知","notifyFeishu": "飛書通知",@@ -619,7 +624,7 @@"confirmArchive": "刪除自動化並歸檔任務","confirmTaskOnly": "只刪除自動化","title": "刪除 {{name}}",- "copy": "刪除自動化不會中斷已經開始的執行。生成過的任務按下面的選項處理,和桌面端保持一致。",+ "copy": "刪除自動化不會中斷已經開始的執行。生成過的任務按下面的選項處理,和電腦端保持一致。","optionsA11y": "選擇生成任務處理方式","keepDesc": "只刪除這條自動化,歷史任務繼續保留在原列表裡。","keepLabel": "保留生成任務",@@ -635,7 +640,6 @@"detailFallback": "暫停會阻止這條自動化繼續觸發。","previewFallback": "沒有正在執行的 run","confirmA11y": "確認暫停自動化",- "pausing": "暫停中","confirm": "確認暫停","cancelA11y": "取消暫停自動化"},@@ -701,11 +705,10 @@},"scheduleRowA11y": "自動化 {{title}}","detail": {- "promptScriptFallback": "僅執行指令碼的自動化,配置只能在桌面端編輯",+ "promptScriptFallback": "僅執行指令碼的自動化,配置只能在電腦端編輯","promptEmpty": "沒有儲存自動化提示詞","deleteA11y": "刪除自動化","runNowA11y": "立即執行自動化",- "running": "執行中","resumeA11y": "恢復自動化","pauseA11y": "暫停自動化","resume": "恢復",@@ -715,13 +718,10 @@},"run": {"openSessionA11y": "開啟自動化生成的任務",- "opening": "開啟中","session": "任務","restartA11y": "重新執行自動化",- "restarting": "重跑中","restart": "重跑","markReadA11y": "標記執行記錄已讀",- "marking": "標記中","markRead": "已讀","deleteA11y": "刪除執行記錄"},@@ -779,7 +779,7 @@"unknownTime": "未知時間","status": {"running": "執行中",- "success": "成功",+ "success": "已完成","failed": "失敗","aborted": "已中止","interrupted": "被中斷",@@ -812,6 +812,7 @@}},"companions": {+ "noCreateHosts": "目前沒有可用的相容電腦。在電腦上開啟 Cindy 並登入同一帳號後即可新建夥伴。","messageSent": "已向背景任務傳送訊息","sentTo": "已傳訊息給 {{name}}","receivedFrom": "訊息來自 {{name}}",@@ -841,13 +842,13 @@"unread": "有新回覆","status": {"queued": "正在開始",- "running": "正在做",+ "running": "執行中","waiting": "等待處理","completed": "已完成",- "failed": "失敗了",+ "failed": "失敗","cancelled": "已停止","timed-out": "已逾時",- "unknown": "任務狀態查不到了"+ "unknown": "狀態未知"},"title": "夥伴","tasks": "任務",@@ -1014,7 +1015,7 @@"memorySaveFailed": "沒有儲存成功,你的編輯已保留。","memoryMissing": "這條記憶已不存在。","memoryDeleteFailed": "刪除失敗",- "create": "新夥伴",+ "create": "新建夥伴","createFailed": "尚未確認建立結果,請重試核對。","title": "夥伴資料","profile": "資料與性格",diff --git a/apps/mobile/src/i18n/locales/zh-TW/files.json b/apps/mobile/src/i18n/locales/zh-TW/files.jsonindex 799b5ccdb6..e3b601465a 100644--- a/apps/mobile/src/i18n/locales/zh-TW/files.json+++ b/apps/mobile/src/i18n/locales/zh-TW/files.json@@ -6,7 +6,7 @@"footerConnecting": "連線中…","folderEmpty": "資料夾為空。","noWorkdir": "該任務沒有工作目錄,無法瀏覽檔案。",- "rootDir": "(根目錄)",+ "rootDir": "(根目錄)","copyPath": "複製路徑","sendToSession": "傳送到對話","exportShare": "匯出 / 分享",@@ -100,7 +100,7 @@"fetchPdfFailed": "取回 PDF 失敗:{{detail}}","fetchingPdf": "正在從電腦取回 PDF…","unsupportedType": "此型別暫不支援在手機上預覽",- "oversize": "檔案超過預覽上限({{size}}),可下載原檔案檢視",+ "oversize": "檔案超過預覽上限({{size}}),可下載原檔案檢視","oversizeUnknown": "過大","binaryFile": "二進位制檔案,無法以文字預覽","readFailed": "讀取失敗",@@ -131,6 +131,7 @@"browserCancelAddress": "取消編輯","browserReturnToFile": "返回檔案","browserCopyAddress": "複製網址",+ "browserCopiedAddress": "已複製網址","browserInvalidAddress": "請輸入有效的 http 或 https 網址。","browserWebsiteFailed": "無法開啟網頁,請嘗試重新載入。"},@@ -140,6 +141,6 @@"exportTimeout": "匯出超時,請重試"},"gallery": {- "cacheMiss": "遠端媒體快取未命中(cachedOnly)"+ "cacheMiss": "這個媒體還沒有快取到手機上,請在連上電腦後重新開啟"}}diff --git a/apps/mobile/src/i18n/locales/zh-TW/interaction.json b/apps/mobile/src/i18n/locales/zh-TW/interaction.jsonindex 03bd0d811b..995d5ae06c 100644--- a/apps/mobile/src/i18n/locales/zh-TW/interaction.json+++ b/apps/mobile/src/i18n/locales/zh-TW/interaction.json@@ -20,7 +20,13 @@"allowOnceAccessibility": "允許一次權限請求","allowOnceConfirm": "確認允許一次","highRisk": "高風險",- "autoReviewUnavailable": "自動審批沒完成,請確認要不要允許這次操作。"+ "autoReviewUnavailable": "自動審批沒完成,請確認要不要允許這次操作。",+ "fullAccessConfirm": {+ "title": "開啟完全訪問?",+ "description": "完全訪問會關閉工作區沙箱並跳過常規審批。{{appName}} 可以修改工作區外的檔案、執行聯網命令且不再詢問;內建高風險操作仍會要求確認。",+ "confirm": "開啟完全訪問",+ "cancel": "保留當前權限"+ }},"planMode": {"label": "計劃模式",@@ -37,7 +43,7 @@"queuePositionNth": "第 {{index}}","composerBlockedByPending": "先處理電腦端的待處理請求後才能繼續輸入。","missingRequestId": "這個遠端互動缺少 requestId,無法回傳決定。",- "desktopConfirmUnsupported": "此確認只能在遠端電腦處理。請回到桌面端繼續。",+ "desktopConfirmUnsupported": "此確認只能在遠端電腦上處理。請回到電腦端繼續。","unsupportedType": "手機版暫不支援這個遠端互動型別。","unsupportedKind": "暫不支援","desktopOnlyKind": "電腦端處理",@@ -158,7 +164,7 @@"sendTitle": "發訊息給 Worker","sendBodyFallback": "傳送訊息","reportTitle": "Worker 回報",- "reportBodyFallback": "(空回報)"+ "reportBodyFallback": "(空回報)"},"contextSheet": {"backAccessibility": "返回上下文面板",@@ -194,7 +200,7 @@"enablePhotoPermission": "開啟照片權限","enable": "去開啟","icloudTimeout": "照片還在從 iCloud 下載,等待超時了。請檢查網路,稍後重試。",- "photoNotReadable": "這張照片暫時無法讀取(可能還沒從 iCloud 下載完成),請稍後重試。"+ "photoNotReadable": "這張照片暫時無法讀取(可能還沒從 iCloud 下載完成),請稍後重試。"},"pluginSetup": {"completeOnDesktop": "請在遠端電腦完成設定,本卡片會自動更新狀態。",@@ -274,7 +280,7 @@"ask_user_question": "回答會儲存草稿,提交後電腦端繼續。","issue_confirm": "確認標題和正文後再提交。","plugin_setup": "設定要在電腦端完成,這裡可以取消這次請求。",- "fallback": "手機版會按桌面端的請求順序處理。"+ "fallback": "手機上會按電腦端的請求順序處理。"}}},diff --git a/apps/mobile/src/i18n/locales/zh-TW/message.json b/apps/mobile/src/i18n/locales/zh-TW/message.jsonindex f1f6f852b8..a529488435 100644--- a/apps/mobile/src/i18n/locales/zh-TW/message.json+++ b/apps/mobile/src/i18n/locales/zh-TW/message.json@@ -36,7 +36,7 @@"botOriginNamed": "由夥伴「{{name}}」傳送","sessionOrigin": "由其他任務傳送","openSessionOrigin": "開啟來源任務",- "modelMismatch": "本輪由 {{actual}} 響應,而非所選的 {{selected}}(服務端臨時降級)",+ "modelMismatch": "本輪由 {{actual}} 響應,而非所選的 {{selected}}(服務端臨時降級)","copyStateCopying": "複製中","copyStateCopied": "已複製","copyStateFailed": "複製失敗",@@ -67,12 +67,15 @@"subagentTyped": "Subagent · {{type}}","subagent": "Subagent","workedDuration": "已工作 {{duration}}",+ "durationSeconds": "{{seconds}} 秒",+ "durationMinutes": "{{minutes}} 分鐘",+ "durationMinutesSeconds": "{{minutes}} 分 {{seconds}} 秒","subagentSummary": "Subagent 小結","agentSwitchLabel": "已從 {{from}} 切換到 {{to}}","agentSwitchViewHandoff": "{{label}},檢視交接內容","sessionResumedPill": "已續接原任務",- "handoffContentDesc": "交接內容——切換時傳送給新引擎的上下文摘要(不計入對話記錄,僅在此展示)",- "handoffContentDescEnglishSource": "交接內容——切換時傳送給新引擎的上下文摘要,原文為英文(不計入對話記錄,僅在此展示)",+ "handoffContentDesc": "交接內容——切換時傳送給新引擎的上下文摘要(不計入對話記錄,僅在此展示)",+ "handoffContentDescEnglishSource": "交接內容——切換時傳送給新引擎的上下文摘要,原文為英文(不計入對話記錄,僅在此展示)","openDiagramDetail": "開啟圖表詳情","sessionChipFallback": "任務 {{id}}","imageFallbackTitle": "圖片",@@ -86,11 +89,10 @@"copyDetailContent": "複製詳情內容","openDetailLink": "開啟詳情連結","mediaNotPreviewable": "當前媒體暫不能直接預覽。",- "retryRemoteMediaFetch": "重試遠端媒體取件",- "retryFetch": "重試取件",+ "retryRemoteMediaFetch": "重試取回遠端媒體",+ "retryFetch": "重試取回","openMedia": "開啟媒體","readCurrentRemoteFile": "讀取當前遠端檔案",- "reading": "讀取中","retryFilePreview": "重試檔案預覽","readCurrentFile": "讀取當前檔案","currentFilePreview": "當前檔案預覽",@@ -107,10 +109,10 @@"copyPath": "複製路徑","copiedPath": "已複製路徑","copyPathFailed": "複製路徑失敗",- "remoteMediaIdle": "正在準備遠端媒體取件",- "remoteMediaLoading": "正在從遠端裝置取件",+ "remoteMediaIdle": "正在準備取回遠端媒體",+ "remoteMediaLoading": "正在從遠端裝置取回","remoteMediaReady": "已取回遠端媒體",- "remoteMediaFetchFailed": "取件失敗:{{message}}",+ "remoteMediaFetchFailed": "取回失敗:{{message}}","mediaPending": "{{label}} 待播放","mediaLoaded": "{{label}} 已載入{{progress}}","mediaPlaying": "{{label}} 播放中{{progress}}",@@ -123,17 +125,17 @@"mediaSize": "大小:{{size}}","mediaExpiresAt": "過期時間:{{time}}","mediaErrorLine": "錯誤:{{message}}",- "mediaDeviceLinkHint": "移動端會通過 device-link 請求遠端裝置上傳媒體後再開啟。",+ "mediaDeviceLinkHint": "開啟前,手機會先請遠端裝置上傳這個媒體。","controlDelete": "刪除訊息",- "controlRewind": "回退到這裡",- "controlFork": "分叉任務",+ "controlRewind": "回到此處",+ "controlFork": "從這裡開啟新任務","markdownDocAriaLabel": "訊息正文","toolOutputTitle": "{{label}} 輸出","toolInputTitle": "{{label}} 輸入","viewToolInput": "查看完整輸入","loadingToolInput": "正在讀取完整輸入","retryToolInput": "讀取失敗,重試",- "toolResultCompacted": "Full tool output was released (original size {{size}})",+ "toolResultCompacted": "已精簡完整工具輸出(原始大小 {{size}})","mermaidEmpty": "空 Mermaid 圖表。","diffEditCount": "{{n}} 處編輯"},@@ -162,7 +164,7 @@"closeImage": "關閉圖片"},"queue": {- "continueSystemInstruction": "繼續未完成的任務(系統指令)",+ "continueSystemInstruction": "繼續未完成的任務(系統指令)","systemInstruction": "系統指令","retrySend": "重試傳送","clearError": "清除錯誤",@@ -177,7 +179,7 @@"attachmentCount": "{{n}} 個附件","attachmentMessage": "附件訊息","steeringLabel": "插話傳送中:{{text}}",- "queuedMessageLabel": "排隊訊息 {{index}}:{{text}}",+ "queuedMessageLabel": "排隊訊息 {{index}}:{{text}}","editingInComposer": "正在下方輸入框編輯…","cancel": "取消","edit": "編輯",@@ -197,8 +199,8 @@"labelOverflow": "已整理上下文並繼續","labelTimeout": "上一輪沒有回應,已整理後繼續","labelStrip": "已去掉過大圖片並繼續",- "handoffTitle": "交接內容——整理後傳送給後續對話的上下文摘要(不計入對話記錄,僅在此展示)",- "handoffTitleEnglishSource": "交接內容——整理後傳送給後續對話的上下文摘要,原文為英文(不計入對話記錄,僅在此展示)"+ "handoffTitle": "交接內容——整理後傳送給後續對話的上下文摘要(不計入對話記錄,僅在此展示)",+ "handoffTitleEnglishSource": "交接內容——整理後傳送給後續對話的上下文摘要,原文為英文(不計入對話記錄,僅在此展示)"},"compact": {"savedTokens": "節省 {{tokens}} tokens",@@ -228,7 +230,7 @@"sessionResumed": "已續接","agentSwitch": "已從 {{from}} 切換到 {{to}}","learnStarted": "技能學習已啟動",- "learnStartedBody": "蒸餾在桌面端後臺進行,完成後請到桌面端檢視並評審技能草案。",+ "learnStartedBody": "蒸餾在電腦端後臺進行,完成後請到電腦端檢視並評審技能草案。","learnFailed": "技能學習未能啟動","learnBusyBody": "已有一個學習任務在執行中,等它完成後再試。","learnFailedBody": "啟動失敗:{{detail}}",@@ -241,13 +243,13 @@"errorHint": "先處理佇列錯誤,再繼續傳送新的訊息。","errorTitle": "佇列需要處理","abortQueued": "{{count}} 條訊息保留在佇列裡",- "abortWaiting": "等待桌面端確認停止",+ "abortWaiting": "等待電腦端確認停止","abortHint": "停止完成前先不要重複傳送,保留的訊息會繼續顯示在這裡。","abortTitle": "停止處理中","pausedDetail": "{{count}} 條訊息等待恢復",- "pausedHint": "點選「繼續」後會按目前順序繼續傳送到桌面端。",+ "pausedHint": "點選「繼續」後會按目前順序繼續傳送到電腦端。","pausedTitle": "佇列已暫停",- "defaultDetail": "{{count}} 條訊息 · 按桌面端順序傳送",+ "defaultDetail": "{{count}} 條訊息 · 按電腦端順序傳送","defaultHint": "可調整順序、插話、編輯或刪除一般佇列訊息。","defaultTitle": "待傳送佇列"},@@ -259,14 +261,14 @@"steering": "插話傳送中","orcaTitle": "協同佇列 {{index}}","title": "佇列 {{index}}",- "orcaReadOnly": "協同訊息由桌面端編排,手機端唯讀顯示。",+ "orcaReadOnly": "協同訊息由電腦端編排,手機上只能檢視。","busy": "佇列操作同步中,完成後再繼續操作。",- "steeringDisabled": "插話正在傳送到目前 turn,等待桌面端回流後再操作。",+ "steeringDisabled": "插話正在傳送到目前這一輪,等電腦端回應後再操作。","editLocked": "這條佇列訊息正在編輯中,完成後再操作。","interactionLocked": "佇列正在被其它操作鎖定,完成後再操作。","syntheticHint": "這是系統自動生成的指令,可以取消,但不能編輯或插話傳送。","steeringHint": "插話正在傳送到目前 turn,暫時不能編輯或移動。",- "editHint": "這條訊息正在編輯中,桌面端會暫停自動傳送。",+ "editHint": "這條訊息正在編輯中,電腦端會暫停自動傳送。","interactionHint": "佇列正在被排序或其它互動鎖定,暫時不能編輯。"}},@@ -277,11 +279,11 @@"mermaidSourceTitle": "Mermaid 圖表原始碼","diffStats": "+{{insertions}} / -{{deletions}} 行","directPreview": "可直接預覽",- "remoteFetchRequired": "需要遠端取件",+ "remoteFetchRequired": "需要從遠端裝置取回","chartSource": "圖表原始碼","noDiffContent": "沒有 diff 內容。","noMediaAddress": "沒有媒體位址。",- "remoteMediaPreparing": "正在準備遠端媒體取件",+ "remoteMediaPreparing": "正在準備取回遠端媒體","mediaAddressOnlySentence": "目前媒體類型暫以位址形式顯示。","mediaCannotPreviewSentence": "目前無法直接預覽此媒體。","emptyMermaid": "空白 Mermaid 圖表。",@@ -294,7 +296,7 @@"remotePathMissing": "缺少遠端路徑","fetchMedia": "取回媒體","fetchMediaFromDesktop": "需要從電腦端取回媒體",- "pendingFetch": "等待取件",+ "pendingFetch": "待取回","previewMedia": "預覽媒體","previewable": "可預覽","openMedia": "開啟媒體",@@ -310,9 +312,9 @@"video": "影片","audio": "音訊","inlineMediaData": "內嵌{{kind}}資料",- "mediaActionsAvailable": "桌面端為此媒體提供了後續操作。",+ "mediaActionsAvailable": "電腦端為此媒體提供了後續操作。","availableActions": "可用操作:{{actions}}",- "mediaActionsDesktopOnly": "手機版 V1 僅顯示這些操作,暫不從遠端觸發。請回到電腦端點選。",+ "mediaActionsDesktopOnly": "手機上暫時只能檢視這些操作,請在電腦端操作。","moreEdits": "…還有 {{count}} 處編輯"},"quote": {diff --git a/apps/mobile/src/i18n/locales/zh-TW/models.json b/apps/mobile/src/i18n/locales/zh-TW/models.jsonindex 5b416ac746..23685ae0fc 100644--- a/apps/mobile/src/i18n/locales/zh-TW/models.json+++ b/apps/mobile/src/i18n/locales/zh-TW/models.json@@ -65,7 +65,7 @@"restoreRecommended": "恢復推薦","saveFailed": "無法儲存,請重試。","configure": "設定",- "syncFailed": "收藏未能同步。請重新開啟重試;被控電腦可能需要更新。",+ "syncFailed": "收藏未能同步。請重新開啟重試;遠端電腦上的 Cindy 可能需要更新。","timeUnit": {"day": "天","hour": "小時",diff --git a/apps/mobile/src/i18n/locales/zh-TW/remoteDesktop.json b/apps/mobile/src/i18n/locales/zh-TW/remoteDesktop.jsonindex 1b9b7d7627..e7c09ecbb0 100644--- a/apps/mobile/src/i18n/locales/zh-TW/remoteDesktop.json+++ b/apps/mobile/src/i18n/locales/zh-TW/remoteDesktop.json@@ -159,7 +159,7 @@"lockOnExit": "退出後鎖定電腦","lockOnExitHint": "離開遠端桌面時鎖定螢幕。重新連線或切換 App 不會觸發。","lockOnExitFailed": "無法確認電腦已鎖定螢幕,請檢查電腦狀態。",- "hostMute": "被控端靜音",- "hostMuteHint": "連線期間將被控電腦靜音",- "hostMuteFailed": "無法修改被控端靜音狀態"+ "hostMute": "遠端電腦靜音",+ "hostMuteHint": "連線期間將遠端電腦靜音",+ "hostMuteFailed": "無法修改遠端電腦的靜音狀態"}diff --git a/apps/mobile/src/i18n/locales/zh-TW/session.json b/apps/mobile/src/i18n/locales/zh-TW/session.jsonindex 2d28e7fed9..eef11fde62 100644--- a/apps/mobile/src/i18n/locales/zh-TW/session.json+++ b/apps/mobile/src/i18n/locales/zh-TW/session.json@@ -29,18 +29,18 @@"openMicPermission": "開啟麥克風權限設定","maxAttachments": "最多新增 {{max}} 個附件。","voiceStopRecording": "停止錄音",- "capabilitiesUnsupported": "遠端能力返回格式不支援"+ "capabilitiesUnsupported": "無法讀取電腦端的指令和資源清單,請更新電腦上的 Cindy 後重試"},"presentation": {"collaboration": {"labelLead": "協同 Lead","labelWorker": "協同 Worker","labelRole": "協同 {{role}}",- "noticeLead": "這是電腦端的 Orca Lead 任務。你可以在手機上繼續傳送訊息;建立 Worker、切換焦點、Fork/Rewind、編輯佇列和修改任務設定等編排操作請在電腦端完成。",- "noticeWorker": "這是電腦端的 Orca Worker 任務。手機版第一版為唯讀,不提供傳送訊息、切換 Worker 焦點、封存 Worker 或停止協同。",- "noticeOther": "這是電腦端的協同任務。手機版第一版為唯讀,協同編排操作請在電腦端完成。",- "readOnlyReason": "協同模式在手機版第一版中為唯讀。確認處理、佇列編輯和任務修改請在電腦端完成。",- "composerReadOnlyReason": "這個協同子任務在手機版中為唯讀,請在電腦端傳送訊息。"+ "noticeLead": "這是電腦端的 Orca Lead 任務。你可以在手機上繼續傳送訊息;建立 Worker、切換焦點、回到此處、從這裡開啟新任務、編輯佇列和修改任務設定,請在電腦端操作。",+ "noticeWorker": "這是電腦端的 Orca Worker 任務。手機上暫時只能檢視;傳送訊息、切換 Worker 焦點、封存 Worker 或停止協同,請在電腦端操作。",+ "noticeOther": "這是電腦端的協同任務。手機上暫時只能檢視,協同編排請在電腦端操作。",+ "readOnlyReason": "協同任務在手機上暫時只能檢視。確認處理、編輯佇列和修改任務,請在電腦端操作。",+ "composerReadOnlyReason": "這個協同子任務在手機上暫時只能檢視,請在電腦端傳送訊息。"},"composer": {"voice": {@@ -212,7 +212,7 @@"shareUnsupported": "當前客戶端暫不支援分享,更新到最新版本後重試。","downloadFailed": "下載失敗","voiceNoRemoteDevice": "缺少遠端裝置,不能開始語音輸入。",- "voiceSenderNotReady": "訊息傳送器未初始化。",+ "voiceSenderNotReady": "訊息暫時無法傳送,請返回後重新進入任務。","voiceStopAndSend": "結束語音輸入並傳送","sendMessage": "傳送遠端訊息","voiceStartInput": "開始語音輸入",@@ -315,7 +315,7 @@"selectAgent": "選擇 Agent","switchToAgent": "切換到 {{label}}","selectWorkspace": "選擇工作區",- "dialogueNoProject": "對話(不繫結專案)",+ "dialogueNoProject": "對話(不繫結專案)","selectProjectNamed": "選擇專案 {{title}}","noProjects": "暫無專案","chooseOtherFolder": "選擇其他專案資料夾",@@ -333,7 +333,7 @@"selectDir": "選擇目錄 {{name}}","select": "選擇","noModelSelected": "未選擇模型",- "assignedDialogueDir": "電腦端分配對話目錄",+ "assignedDialogueDir": "由電腦自動分配工作目錄","extraDirsSuffix": "+{{num}} 附加目錄","noProjectPath": "未選擇專案路徑","dialogueWorkspace": "對話工作區",@@ -364,7 +364,7 @@"worktreeNotGitRepo": "當前目錄不是 git 倉庫","worktreeAlreadyInWorktree": "已在 worktree 中,禁止巢狀","worktreeDetectFailed": "無法檢測目錄環境,可稍後重選目錄再試",- "worktreeUnsupported": "當前桌面端無法安全建立 worktree,請關閉 worktree 後繼續,或升級桌面端。",+ "worktreeUnsupported": "電腦端目前的 Cindy 無法安全建立 worktree,請關閉 worktree 後繼續,或更新電腦上的 Cindy。","worktreeCreateFailed": "worktree 建立失敗:{{message}}","worktreeRecoveryStateFailed": "無法儲存 worktree 恢復狀態,請重試。","worktreeCleanupPending": "上一次 worktree 仍待回收,請重新連線裝置後再試。"@@ -456,7 +456,6 @@"contextLabel": "上下文","accountLimits": "帳號限額","quotaExhaustedResettable": "當前配額已耗盡。重置會立即消耗 1 次,且不能撤銷。",- "resetting": "正在重置…","resetCodexUsage": "重置 Codex 用量","quotaExhaustedNoCredit": "當前配額已耗盡,但沒有可用重置次數。","openDir": "開啟目錄",@@ -474,7 +473,8 @@"noSubDirs": "這個目錄下沒有可進入的子目錄。","dirLimitNotice": "僅顯示前 30 個目錄,可進入更具體的目錄繼續選擇。","confirmRename": "確認重新命名",- "confirm": "確定",+ "renameSubmit": "重新命名",+ "confirm": "重新命名","cancelRename": "取消重新命名","backToMenu": "返回任務選單"},@@ -500,8 +500,8 @@"toolUseLoopDetectedConsecutiveWithCount": "模型重複呼叫同一個工具 {{count}} 次,Cindy 已停止本輪以避免無限迴圈。可以傳送新訊息繼續。","toolUseLoopDetectedPingPongWithCount": "模型在多個工具呼叫之間來回循環,Cindy 偵測到本輪已有 {{count}} 次呼叫後停止了本輪。可以傳送新訊息繼續。","toolUseLoopDetectedRotationWithCount": "模型持續輪轉呼叫多個工具,Cindy 偵測到本輪已有 {{count}} 次呼叫後停止了本輪。可以傳送新訊息繼續。",- "codexThreadLost": "Codex 鑑權模式已切換,當前任務無法繼續 —— 請新建任務後生效。",- "encryptedContentInvalid": "由於更換供應商導致加密不可用,本任務只能在原供應商下使用;請回到電腦端處理(可 Fork 丟棄協議加密內容後在新任務繼續)。"+ "codexThreadLost": "Codex 鑑權模式已切換,當前任務無法繼續,請新建任務。",+ "encryptedContentInvalid": "由於更換供應商導致加密不可用,本任務只能在原供應商下使用;請回到電腦端處理(可以用「從這裡開啟新任務」丟棄協議加密內容,在新任務裡繼續)。"},"row": {"moreOptions": "更多選項",@@ -518,6 +518,8 @@"authGateHint": "{{agent}} 在這臺電腦上還沒有已連線的模型供應商,傳送會失敗。請在電腦端 {{appName}} 的「設定 → 模型供應商」完成配置。"},"outbox": {+ "deleteConfirmTitle": "刪除這則訊息?",+ "deleteConfirmBody": "這則訊息未能成功傳送,刪除後無法復原。","legacyPlanRecovery": "這臺電腦暫不支援在計畫模式下恢復待傳訊息。請關閉計畫模式,或更新電腦上的 Cindy 後重試","creationRecoveryRequired": "請先重試建立任務,再刪除首則訊息;這則訊息仍保存著後續訊息所需的任務恢復資訊。","confirmationRequired": "電腦暫時無法確認是否收到這則訊息。請核對訊息記錄,或更新電腦上的 Cindy 後重試。",@@ -528,16 +530,16 @@},"remoteError": {"REMOTE_DAEMON_CLOSED": "遠端連線中斷了,可能正在更新。這一輪已經結束,請重新傳送。",- "REMOTE_LOCAL_ATTACHMENT_UNSUPPORTED": "遠端任務無法訪問本地檔案/圖片附件。請直接貼上內容。",+ "REMOTE_LOCAL_ATTACHMENT_UNSUPPORTED": "遠端任務無法存取本地檔案或圖片附件。請直接貼上內容。","AUTO_REVIEW_UNAVAILABLE": "自動審批暫時無法給出判斷,需要審批的操作已改為由你確認。想少被打斷,可以把任務切到「完全訪問」,但風險更高。","AUTO_REVIEW_UNAVAILABLE_WECHAT": "自動審批暫時無法給出判斷,需要審批的操作已改為由你確認。個人微信不能使用「完全訪問」,請直接確認這次操作。","AUTO_REVIEW_CONFIRM_UNDELIVERED": "自動審批沒完成,確認也沒有送到或沒有被點。這次拒絕不是你點的。","REMOTE_COMPAT_MODE_UNSUPPORTED": "遠端任務不能使用本機相容通道。請改用 Cindy AI,或在本機任務裡繼續。",- "REMOTE_GATEWAY_ENDPOINT_UNAVAILABLE": "Cindy AI 憑據尚未就緒(登入後由服務端自動下發)。請稍候重試;若持續出現,請到 設定 → 模型供應商 檢查 Cindy AI 連線狀態。",+ "REMOTE_GATEWAY_ENDPOINT_UNAVAILABLE": "Cindy AI 憑據尚未就緒(登入後由服務端自動下發)。請稍候重試;若持續出現,請到「設定 → 模型供應商」檢查 Cindy AI 連線狀態。","REMOTE_LOCAL_ONLY_PROVIDER": "此模型供應商是本機專屬服務(如 Ollama),SSH 遠端任務無法存取本機位址。請改用 Cindy AI 閘道,或選擇遠端主機可達的模型供應商。","DEVICE_LINK_CONTROL_DISABLED": "已關閉對該裝置的控制,訊息未傳送。","DEVICE_LINK_MEDIA_TRANSFER_FAILED": "附件傳輸失敗,訊息未傳送。請重試。",- "MCP_APPROVAL_AUTO_BLOCKED": "這次工具呼叫被自動審核攔截,未收到你手動拒絕的紀錄。",+ "MCP_APPROVAL_AUTO_BLOCKED": "這次工具呼叫被自動審批攔截,未收到你手動拒絕的紀錄。","MCP_APPROVAL_CONFIRMATION_TIMEOUT": "權限確認逾時,未收到有效的確認結果。僅憑逾時無法判斷你是否點過按鈕。","MCP_APPROVAL_CONFIRMATION_UNAVAILABLE": "這次權限確認未完成,未收到你手動拒絕的紀錄。","REMOTE_HOST_PROXY_FORWARD_UNAVAILABLE": "這個模型需要電腦端轉送請求,目前遠端連線還不能轉送。請改用 Cindy AI,或在本機任務裡使用這個模型。",diff --git a/apps/mobile/src/i18n/locales/zh-TW/settings.json b/apps/mobile/src/i18n/locales/zh-TW/settings.jsonindex 58f9b4dfb8..27e43c41b7 100644--- a/apps/mobile/src/i18n/locales/zh-TW/settings.json+++ b/apps/mobile/src/i18n/locales/zh-TW/settings.json@@ -19,8 +19,8 @@"cancel": "取消","exportHint": "分享詳細本機日誌供疑難排解;不含任務內文或憑證。","options": "日誌選項",- "uploadCopied": "上傳成功,編號 {{code}} 已複製。",- "uploadSucceeded": "上傳成功,編號 {{code}}。"+ "uploadCopied": "日誌已上傳,編號 {{code}} 已複製",+ "uploadSucceeded": "日誌已上傳,編號 {{code}}"},"title": "設定","appearance": {@@ -47,15 +47,14 @@},"version": {"sectionTitle": "版本",- "currentLabel": "當前版本",- "bundleVersion": "整包版本 {{version}}",- "otaVersion": "熱更版本 {{version}}",+ "appVersion": "版本 {{version}}",+ "updateMethodInApp": "更新方式:在 App 內更新,重新啟動後生效",+ "updateMethodPackage": "更新方式:下載並安裝新版本",+ "updateMethodUnavailable": "開發版,不支援 App 內更新","pairedDesktopVersion": "配套桌面版本 {{version}}",- "devNoOta": "開發版,熱更不可用","checkAction": "檢查更新","testFlightCheckAction": "檢查內容更新","checking": "檢查中",- "updating": "更新中","checkingAccessibility": "正在檢查更新","testFlightCheckingAccessibility": "正在檢查內容更新","testFlightUpdateManaged": "測試版安裝更新由 TestFlight 管理",@@ -144,7 +143,8 @@"runtime": "Runtime","otaMarker": "熱更標記","emergencyLaunch": "應急啟動",- "emergencyLaunchYes": "是(本次執行內熱更無法生效)"+ "emergencyLaunchYes": "是(本次執行內熱更無法生效)",+ "otaVersion": "熱更版本"},"legal": {"sectionTitle": "備案資訊",@@ -161,6 +161,8 @@"analyticsResetAction": "恢復"},"account": {+ "logoutConfirmTitle": "退出登入?",+ "logoutConfirmRunning": "仍有任務正在執行。退出後任務會繼續在電腦上執行,但這臺手機將不再接收和控制這些任務;這臺手機上儲存的帳號和本地遠端映象也會被清除。","logoutHint": "退出會清除這臺手機上儲存的全部帳號和本地遠端映象,不會影響電腦端任務。","logout": "退出登入","loggingOut": "退出中",@@ -193,9 +195,12 @@"resetAccessibility": "恢復預設本機名稱","emptyError": "裝置名稱不能為空。","deviceInitializing": "裝置還在初始化,請稍後再試。",- "saving": "儲存中…",- "saved": "已儲存。",- "restoringDefault": "正在恢復預設名稱…",- "restoredDefault": "已恢復預設名稱。"+ "restoredDefault": "已恢復預設名稱。",+ "resetAction": "恢復預設名稱",+ "clearAccessibility": "清空名稱",+ "discardTitle": "放棄修改?",+ "discardBody": "裝置名稱的修改還沒有儲存。",+ "discardConfirm": "放棄修改",+ "keepEditing": "繼續編輯"}}diff --git a/apps/mobile/src/i18n/locales/zh-TW/sharedTask.json b/apps/mobile/src/i18n/locales/zh-TW/sharedTask.jsonindex 66156ea162..29f4f1ab70 100644--- a/apps/mobile/src/i18n/locales/zh-TW/sharedTask.json+++ b/apps/mobile/src/i18n/locales/zh-TW/sharedTask.json@@ -42,7 +42,7 @@"joined": "已加入共享任務","joinedBody": "你可以查看加入前的訊息、工具結果和附件,也可以向同一個 Agent 傳送訊息。","enterTask": "進入任務",- "inviteBoxTitle": "將邀請傳給你的夥伴",+ "inviteBoxTitle": "把邀請傳給要一起協作的人","roleGuest": "訪客","removeShort": "移除","removeNamedTitle": "移除{{name}}?",diff --git a/apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx b/apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsxindex fb34bca12a..32ec7613a9 100644--- a/apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx+++ b/apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx@@ -1,10 +1,9 @@import type { ComponentProps, ReactNode } from "react";import { Stack } from "expo-router";import { HomeHeaderGlassButton } from "@/session/HomeHeaderGlassButton";-import { BlurBackdrop } from "@/session/BlurBackdrop";import { QuietSyncIndicator } from '@/components/QuietSyncIndicator';import { ChevronDown, Menu } from "lucide-react-native";-import { Pressable, StyleSheet, View } from "react-native";+import { Pressable, StyleSheet, View, useWindowDimensions } from "react-native";import { Text } from "@/components/AppText";import {NativePullDownMenu,@@ -21,7 +20,8 @@ import {useThemedStyles,type ThemeColors,} from "@/theme";-import { lineHeight, radius, spacing } from "@/theme/tokens";+import { lineHeight, spacing } from "@/theme/tokens";+import { navigationTitleMaxWidth } from "@/platform/chrome/navigationTitleWidth";/*** 首页 iOS 顶栏走系统 UINavigationBar。@@ -64,6 +64,9 @@ export function HomeNativeStackHeader({const { colors } = useTheme();const styles = useThemedStyles(makeStyles);const nativeMenus = usesNativePullDownMenu();+ const { width: windowWidth } = useWindowDimensions();+ // Menu button + two trailing actions; minus the title's own hit padding.+ const titleMaxWidth = Math.max(0, navigationTitleMaxWidth(windowWidth) - 2 * spacing.xs);if (!usesNativeStackHeader()) return null;@@ -83,8 +86,8 @@ export function HomeNativeStackHeader({style={({ pressed }) => [styles.titleHit, pressed && styles.pressed]}testID="devices.title">- <BlurBackdrop intensity={20} overlayColor={colors.surfaceTranslucent} />- <View style={styles.titleCluster}>+ {/* The title sits directly on the bar: no capsule material behind it. */}+ <View style={[styles.titleCluster, { maxWidth: titleMaxWidth }]}><Text numberOfLines={1} style={styles.title}>{title}</Text>@@ -177,13 +180,10 @@ const makeStyles = (colors: ThemeColors) =>flexDirection: "row",flexShrink: 1,gap: spacing.xs,- maxWidth: 220,minWidth: 0,},titleHit: {- borderRadius: radius.pill,- overflow: "hidden",- paddingHorizontal: spacing.md,+ paddingHorizontal: spacing.xs,alignItems: "center",justifyContent: "center",minHeight: 44,diff --git a/apps/mobile/src/platform/chrome/SimpleStackHeader.tsx b/apps/mobile/src/platform/chrome/SimpleStackHeader.tsxindex c0f9eb8762..82d50082b9 100644--- a/apps/mobile/src/platform/chrome/SimpleStackHeader.tsx+++ b/apps/mobile/src/platform/chrome/SimpleStackHeader.tsx@@ -34,6 +34,18 @@ export function simpleScreenSafeAreaEdges(): readonly Edge[] | undefined {return Platform.OS === "ios" ? ["left", "right", "bottom"] : undefined;}+/**+ * 整页滚动的简单页(配合 `<SimpleStackHeader scrollEdge />`):iOS 上内容铺到透明顶栏+ * 和底部指示条下面,由滚动视图自己让出上下安全区,系统柔和边缘替代硬分界。+ */+export function simpleScrollScreenSafeAreaEdges(): readonly Edge[] | undefined {+ return Platform.OS === "ios" ? ["left", "right"] : undefined;+}++export const simpleScrollInsetProps = Platform.OS === "ios"+ ? { automaticallyAdjustsScrollIndicatorInsets: true, contentInsetAdjustmentBehavior: "automatic" as const }+ : {};+export function SimpleStackHeader({action,right,@@ -44,6 +56,7 @@ export function SimpleStackHeader({title,titleTestID,syncing,+ scrollEdge = false,}: {action?: MainWindowAction;right?: ReactNode;@@ -54,6 +67,8 @@ export function SimpleStackHeader({title: string;titleTestID?: string;syncing?: boolean;+ /** 页面根部是整页滚动视图时打开;配套使用 simpleScrollScreenSafeAreaEdges / simpleScrollInsetProps。 */+ scrollEdge?: boolean;}) {const { colors } = useTheme();const { t } = useTranslation();@@ -82,7 +97,11 @@ export function SimpleStackHeader({headerShown: true,headerShadowVisible: false,headerBackVisible: false,- headerStyle: { backgroundColor: colors.surface },+ headerStyle: { backgroundColor: scrollEdge ? "transparent" : colors.surface },+ headerTransparent: scrollEdge,+ scrollEdgeEffects: scrollEdge+ ? { bottom: "soft", left: "hidden", right: "hidden", top: "soft" }+ : undefined,headerTintColor: colors.textPrimary,headerTitle: () => (<View style={styles.wrap} testID={titleTestID}>diff --git a/apps/mobile/src/platform/chrome/index.ts b/apps/mobile/src/platform/chrome/index.tsindex fa59df8075..0c07d96073 100644--- a/apps/mobile/src/platform/chrome/index.ts+++ b/apps/mobile/src/platform/chrome/index.ts@@ -19,6 +19,8 @@ export {export {SimpleStackHeader,simpleScreenSafeAreaEdges,+ simpleScrollInsetProps,+ simpleScrollScreenSafeAreaEdges,usesNativeStackHeader,} from "@/platform/chrome/SimpleStackHeader";export { HomeNativeStackHeader } from "@/platform/chrome/HomeNativeStackHeader";diff --git a/apps/mobile/src/platform/chrome/navigationTitleWidth.ts b/apps/mobile/src/platform/chrome/navigationTitleWidth.tsnew file mode 100644index 0000000000..f332cb6a37--- /dev/null+++ b/apps/mobile/src/platform/chrome/navigationTitleWidth.ts@@ -0,0 +1,13 @@+import { navigationChrome, spacing } from '@/theme/tokens';++/**+ * Widest a custom native-bar title may be. UIKit gives the title only the space+ * between the bar items (their chrome targets), the side margins and its own gap+ * on each side (measured: 204pt of 402 with one leading and two trailing items).+ * A wider title view is centered and clipped at both ends, cutting off trailing+ * glyphs such as a menu chevron. RN lays the title out before UIKit sizes it, so+ * callers cap it explicitly and let the text ellipsize instead.+ */+export function navigationTitleMaxWidth(windowWidth: number, { barItems = 3, max = 260 }: { barItems?: number; max?: number } = {}): number {+ return Math.max(0, Math.min(max, windowWidth - barItems * navigationChrome.target - 4 * spacing.lg));+}diff --git a/apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx b/apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsxindex 507ccd9539..476955cc3a 100644--- a/apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx+++ b/apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx@@ -1,6 +1,7 @@import { ChevronLeft } from "lucide-react-native";import { Pressable, StyleSheet } from "react-native";-import { useTheme, iconSize } from "@/theme";+import { mobileInteractionStyles } from "@/components/mobileInteractionStyles";+import { useTheme, iconSize, iconStroke } from "@/theme";export function RemoteDesktopBackButton({label,@@ -16,9 +17,10 @@ export function RemoteDesktopBackButton({accessibilityLabel={label}onPress={onPress}testID="remoteDesktop.back"- style={styles.button}+ style={({ pressed }) => [styles.button, pressed && mobileInteractionStyles.pressed]}>- <ChevronLeft size={iconSize.xl} color={colors.textPrimary} />+ {/* 与共享 ScreenBackButton 同档:iconSize.action + iconStroke.regular。 */}+ <ChevronLeft size={iconSize.action} strokeWidth={iconStroke.regular} color={colors.textPrimary} /></Pressable>);}diff --git a/apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx b/apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsxindex f202bedd83..efefa295da 100644--- a/apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx+++ b/apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx@@ -14,7 +14,9 @@ import {usesNativePullDownMenu,} from "@/platform/chrome/NativePullDownMenu";import { Text } from "@/components/AppText";-import { useTheme, radius, iconSize, iconStroke, spacing } from "@/theme";+import { MainWindowActionButton } from "@/components/MobilePrimitives";+import { mobileInteractionStyles } from "@/components/mobileInteractionStyles";+import { useTheme, radius, iconSize, iconStroke, lineHeight, spacing, typeScale } from "@/theme";export function RemoteDesktopClipboardButton({enabled,@@ -146,11 +148,8 @@ export function RemoteDesktopClipboardButton({}style={({ pressed }) => [styles.button,- {- borderRadius: radius.pill,- backgroundColor: pressed ? colors.surfaceChip : "transparent",- opacity: enabled ? 1 : 0.4,- },+ !enabled && styles.disabled,+ pressed && mobileInteractionStyles.pressed,]}>{busy ? (@@ -187,15 +186,13 @@ export function RemoteDesktopClipboardButton({{failure ?? t("remoteDesktop.clipboardTransferring")}</Text>{failure !== null && (- <Pressable- accessibilityRole="button"- onPress={() => setFailure(null)}- style={({ pressed }) => [styles.dismiss, {- backgroundColor: pressed ? colors.surfaceElevated : colors.surfaceChip,- }]}- >- <Text style={{ color: colors.textPrimary }}>{t("remoteDesktop.close")}</Text>- </Pressable>+ <MainWindowActionButton+ action={{+ label: t("remoteDesktop.close"),+ onPress: () => setFailure(null),+ }}+ style={styles.dismiss}+ />)}</View></View>@@ -219,19 +216,14 @@ const styles = StyleSheet.create({borderRadius: radius.container,borderWidth: StyleSheet.hairlineWidth,},- loadingText: { textAlign: "center" },- dismiss: {- alignSelf: "stretch",- minHeight: 44,- alignItems: "center",- justifyContent: "center",- borderRadius: radius.pill,- paddingHorizontal: spacing.md,- },+ loadingText: { fontSize: typeScale.body, lineHeight: lineHeight.body, textAlign: "center" },+ dismiss: { alignSelf: "stretch" },button: {width: 44,height: 44,+ borderRadius: radius.pill,justifyContent: "center",alignItems: "center",},+ disabled: { opacity: 0.4 },});diff --git a/apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx b/apps/mobile/src/remote-desktop/RemoteDesktopControls.tsxindex 6838f9c710..424dbcd0e5 100644--- a/apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx+++ b/apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx@@ -239,6 +239,7 @@ export function RemoteDesktopControls({{(["touch", "pointer"] as const).map((value) => (<MainWindowOptionButtonkey={value}+ accessibilityRole="tab"label={t(`remoteDesktop.${value}`)}testID={`remoteDesktop.${value}`}variant="segmented"@@ -300,6 +301,7 @@ export function RemoteDesktopControls({}}><NativeSwitch+ seedColor={colors.inputCaret}accessibilityLabel={t("remoteDesktop.showMouseButtons")}testID="remoteDesktop.showMouseButtons"value={showMouseButtons}@@ -329,7 +331,7 @@ export function RemoteDesktopControls({</Text>)}</View>- <ChevronRight size={iconSize.md} color={colors.textTertiary} />+ <ChevronRight size={iconSize.lg} strokeWidth={iconStroke.regular} color={colors.textTertiary} /></Pressable>{security && (<>@@ -349,7 +351,7 @@ export function RemoteDesktopControls({<Text style={[styles.rowTitle, styles.expand]}>{t("remoteDesktop.security")}</Text>- <ChevronRight size={iconSize.md} color={colors.textTertiary} />+ <ChevronRight size={iconSize.lg} strokeWidth={iconStroke.regular} color={colors.textTertiary} /></Pressable></>)}@@ -550,10 +552,10 @@ const makeStyles = (colors: ThemeColors) =>gap: spacing.xs,backgroundColor: colors.surfaceChip,padding: spacing.xs,- borderRadius: radius.control,+ borderRadius: radius.pill,},- segment: { flex: 1, minHeight: 44, borderRadius: radius.control },- hint: { color: colors.textPrimary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption },+ segment: { flex: 1, minHeight: 44, borderRadius: radius.pill },+ hint: { color: colors.textSecondary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption },group: {backgroundColor: colors.surfaceTranslucent,borderRadius: radius.container,diff --git a/apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx b/apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsxindex 9ae2caeb33..47769d7b08 100644--- a/apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx+++ b/apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx@@ -14,6 +14,7 @@ import type {RemoteDesktopVideoSettings,} from "@cindy/device-link";import { Text } from "@/components/AppText";+import { mobileInteractionStyles } from "@/components/mobileInteractionStyles";import { RemoteDesktopActionButton } from "./RemoteDesktopActionButton";import {NativePullDownMenu,@@ -82,9 +83,10 @@ export function RemoteDesktopDisplaySettings({}, [connected, video.modesSupported, video.displayGeometry, reload]);const disabled = !connected || !video.supported;const title = { color: colors.textPrimary, fontSize: typeScale.body, lineHeight: lineHeight.body };+ // 说明档(13/18,二级字色):成句的提示与当前分辨率取值。const hint = {- color: colors.textPrimary,- fontSize: typeScale.caption,+ color: colors.textSecondary,+ fontSize: typeScale.footnote,lineHeight: lineHeight.caption,};const segment = (label: string, selected: boolean, onPress: () => void) => (@@ -98,19 +100,20 @@ export function RemoteDesktopDisplaySettings({{flex: 1,minHeight: 44,- borderRadius: radius.control,+ borderRadius: radius.pill,alignItems: "center",justifyContent: "center",backgroundColor: selected ? colors.cta : "transparent",- opacity: disabled ? 0.6 : pressed ? 0.85 : 1,},+ disabled && { opacity: 0.6 },+ pressed && !disabled && mobileInteractionStyles.pressed,]}><Textstyle={{...title,color: selected ? colors.ctaText : colors.textPrimary,- fontWeight: selected ? fontWeight.semibold : fontWeight.medium,+ fontWeight: fontWeight.medium,}}>{label}@@ -120,7 +123,7 @@ export function RemoteDesktopDisplaySettings({const segments = {flexDirection: "row" as const,padding: spacing.xs,- borderRadius: radius.control,+ borderRadius: radius.pill,backgroundColor: colors.surfaceChip,};const segmented = (@@ -354,7 +357,8 @@ export function RemoteDesktopDisplaySettings({onPress={() => chooseMode(mode.id)}style={({ pressed }) => [styles.row,- { opacity: pressed ? 0.6 : !controlling ? 0.4 : 1 },+ !controlling && { opacity: 0.4 },+ pressed && mobileInteractionStyles.pressed,]}><Text style={[title, { flex: 1 }]}>{modeLabel(mode)}</Text>diff --git a/apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx b/apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsxindex 2d8d212fc4..eaff2dbb2b 100644--- a/apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx+++ b/apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx@@ -79,6 +79,7 @@ import {resolveDesktopIceServers,} from "@cindy/device-link";import { Text } from "@/components/AppText";+import { mobileInteractionStyles } from "@/components/mobileInteractionStyles";import { useScreenEdgePadding } from "@/components/screenEdgeInsets";import { goBackGuarded } from "@/utils/backGuard";import { mobileDebugEnabled, mobileDebugLog } from "@/debug/mobileDebugLog";@@ -3196,7 +3197,7 @@ export function RemoteDesktopSession({style={({ pressed }) => [styles.modeTab,fullKeys === computer && styles.modeTabSelected,- pressed && styles.keyPressed,+ pressed && mobileInteractionStyles.pressed,]}><Text@@ -3514,7 +3515,7 @@ const makeStyles = (colors: ThemeColors) =>flex: 1,flexDirection: "row",backgroundColor: colors.surfaceChip,- borderRadius: radius.container,+ borderRadius: radius.pill,padding: spacing.xs,},modeTab: {@@ -3522,7 +3523,7 @@ const makeStyles = (colors: ThemeColors) =>minHeight: 36,alignItems: "center",justifyContent: "center",- borderRadius: radius.control,+ borderRadius: radius.pill,},modeTabSelected: { backgroundColor: colors.surfaceElevated },modeText: {@@ -3531,9 +3532,9 @@ const makeStyles = (colors: ThemeColors) =>fontWeight: fontWeight.regular,color: colors.textTertiary,},+ // 选中只换色,字重保持与未选一致。modeTextSelected: {color: colors.textPrimary,- fontWeight: fontWeight.medium,},closeKey: {width: 44,diff --git a/apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx b/apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsxindex a100d80369..eca3ad1748 100644--- a/apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx+++ b/apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx@@ -1,13 +1,13 @@import {ActivityIndicator,Platform,- Pressable,StyleSheet,View,} from "react-native";import { LockKeyhole, ScanFace } from "lucide-react-native";import { useTranslation } from "react-i18next";import { Text } from "@/components/AppText";+import { MainWindowActionButton } from "@/components/MobilePrimitives";import { NativeSwitch } from "@/platform/chrome/NativeSwitch";import { supportsAutoUnlock } from "./autoUnlockSupport";import {@@ -53,7 +53,9 @@ export function RemoteDesktopSecuritySettings() {const { t } = useTranslation();const { colors } = useTheme();- const hint = { color: colors.textPrimary, fontSize: typeScale.caption, lineHeight: lineHeight.caption };+ // 说明档(13/18,二级字色);报错说明同字号改用 errorText。+ const hint = { color: colors.textSecondary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption };+ const alertText = { ...hint, color: colors.errorText };const switchSlot = {width: 56,minHeight: 44,@@ -122,6 +124,7 @@ export function RemoteDesktopSecuritySettings(</View><View style={switchSlot}><NativeSwitch+ seedColor={colors.inputCaret}testID="remoteDesktop.autoUnlock"accessibilityLabel={t("remoteDesktop.autoUnlock")}value={props.autoUnlock}@@ -165,6 +168,7 @@ export function RemoteDesktopSecuritySettings(</View><View style={switchSlot}><NativeSwitch+ seedColor={colors.inputCaret}testID="remoteDesktop.biometricVerification"accessibilityLabel={biometricLabel}value={props.biometricVerification}@@ -213,6 +217,7 @@ export function RemoteDesktopSecuritySettings(</View><View style={switchSlot}><NativeSwitch+ seedColor={colors.inputCaret}testID="remoteDesktop.lockOnExit"accessibilityLabel={t("remoteDesktop.lockOnExit")}value={props.lockOnExit === true}@@ -223,7 +228,7 @@ export function RemoteDesktopSecuritySettings(</View>{supportsAutoUnlock(props.hostPlatform) &&(props.notice || (!props.available && !props.busy)) && (- <Text style={hint} accessibilityRole="alert">+ <Text style={alertText} accessibilityRole="alert">{props.notice || t("remoteDesktop.autoUnlockUnavailable")}</Text>)}@@ -276,6 +281,7 @@ export function RemoteDesktopSecuritySettings(</View><View style={switchSlot}><NativeSwitch+ seedColor={colors.inputCaret}accessibilityLabel={t(`remoteDesktop.${item.key}`)}testID={`remoteDesktop.${item.key}`}value={item.value === true}@@ -286,27 +292,18 @@ export function RemoteDesktopSecuritySettings(</View>))}{props.safetyNotice && (- <Text style={hint} accessibilityRole="alert">+ <Text style={alertText} accessibilityRole="alert">{t(`remoteDesktop.${props.safetyNotice}`)}</Text>)}{props.clipboardSync &&props.safetyNotice?.startsWith("clipboardSync") && (- <Pressable- accessibilityRole="button"- onPress={props.onClipboardSyncRetry}- style={{- minHeight: 44,- justifyContent: "center",- alignItems: "center",- borderRadius: radius.pill,- backgroundColor: colors.sheetActionSurface,+ <MainWindowActionButton+ action={{+ label: t("remoteDesktop.clipboardSyncRetry"),+ onPress: props.onClipboardSyncRetry,}}- >- <Text style={{ color: colors.textPrimary }}>- {t("remoteDesktop.clipboardSyncRetry")}- </Text>- </Pressable>+ />)}</View>);diff --git a/apps/mobile/src/session/AccountSwitcherSheet.tsx b/apps/mobile/src/session/AccountSwitcherSheet.tsxindex 15cd83f488..f20e257b22 100644--- a/apps/mobile/src/session/AccountSwitcherSheet.tsx+++ b/apps/mobile/src/session/AccountSwitcherSheet.tsx@@ -3,19 +3,20 @@ import { useTranslation } from 'react-i18next';import {ActivityIndicator,Alert,- Image,Platform,Pressable,StyleSheet,View,useWindowDimensions,} from 'react-native';-import { Building2, Check, UserPlus, UserRound } from 'lucide-react-native';+import { Check } from 'lucide-react-native';import { useSafeAreaInsets } from 'react-native-safe-area-context';import { useAuth } from '@/auth/AuthContext';import { Text } from '@/components/AppText';-import { hasNativeLoginButtons, LoginNativeButton } from '@/components/LoginNativeButton';+import { MainWindowActionButton } from '@/components/MobilePrimitives';+import { mobileInteractionStyles } from '@/components/mobileInteractionStyles';+import { MobileUserAvatar } from '@/components/MobileUserAvatar';import { formatRemoteError } from '@/device-link/remoteStatus';import { computeContextSheetSnapHeights, type ContextSheetSnap } from '@/session/contextSheetModel';import { SheetModal } from '@/session/SheetModal';@@ -102,30 +103,17 @@ export function AccountSwitcherSheet({});};- const footer = hasNativeLoginButtons ? (- <LoginNativeButton label={t('devices.list.accounts.add')} height={48} fontSize={typeScale.body}- disabled={switchingKey !== null} onPress={() => confirmBoundary(onAddAccount)}- testID="accountSwitcher.addAccount" showLabel artworkSize={iconSize.md}>- <UserPlus color={colors.textPrimary} size={iconSize.md} strokeWidth={iconStroke.regular} />- </LoginNativeButton>- ) : (- <Pressable- accessibilityRole="button"- disabled={switchingKey !== null}- onPress={() => confirmBoundary(onAddAccount)}- style={({ pressed }) => [- styles.addButton,- pressed && styles.pressed,- ]}- testID="accountSwitcher.addAccount"- >- <UserPlus- color={colors.textPrimary}- size={iconSize.md}- strokeWidth={iconStroke.regular}- />- <Text style={styles.addLabel}>{t('devices.list.accounts.add')}</Text>- </Pressable>+ // 「添加账号」是普通次级操作,用共享按钮;登录专用的品牌按钮只留给登录画布。+ const footer = (+ <MainWindowActionButton+ action={{+ disabled: switchingKey !== null,+ label: t('devices.list.accounts.add'),+ onPress: () => confirmBoundary(onAddAccount),+ testID: 'accountSwitcher.addAccount',+ }}+ style={styles.addButton}+ />);return (@@ -143,48 +131,21 @@ export function AccountSwitcherSheet({><View style={styles.list}>{auth.savedAccounts.map((account) => {- const { imageUrl, isOrg, subtitle, title } =+ const { imageUrl, subtitle, title } =presentSavedAccount(account);const switching = switchingKey === account.accountKey;- if (hasNativeLoginButtons) return <LoginNativeButton key={account.accountKey}- label={title} subtitle={subtitle ?? undefined} height={64} fontSize={typeScale.body}- accessibilityLabel={subtitle ? `${title}, ${subtitle}` : title}- onPress={() => switchTo(account.accountKey)} variant="text" showLabel artworkSize={44}- disabled={account.isCurrent || switchingKey !== null} busy={switching}- selected={account.isCurrent} testID={`accountSwitcher.account.${account.membershipId}`}>- <View style={styles.avatar}>- {imageUrl ? <Image source={{ uri: imageUrl }} style={styles.avatarImage} />- : isOrg ? <Building2 color={colors.textSecondary} size={iconSize.md} strokeWidth={iconStroke.regular} />- : <UserRound color={colors.textSecondary} size={iconSize.md} strokeWidth={iconStroke.regular} />}- </View>- </LoginNativeButton>;return (<PressableaccessibilityLabel={subtitle ? `${title}, ${subtitle}` : title}accessibilityRole="button"+ accessibilityState={{ busy: switching || undefined, disabled: account.isCurrent || switchingKey !== null, selected: account.isCurrent }}disabled={account.isCurrent || switchingKey !== null}key={account.accountKey}onPress={() => switchTo(account.accountKey)}style={({ pressed }) => [styles.row, pressed && styles.pressed]}testID={`accountSwitcher.account.${account.membershipId}`}>- <View style={styles.avatar}>- {imageUrl ? (- <Image source={{ uri: imageUrl }} style={styles.avatarImage} />- ) : isOrg ? (- <Building2- color={colors.textSecondary}- size={iconSize.md}- strokeWidth={iconStroke.regular}- />- ) : (- <UserRound- color={colors.textSecondary}- size={iconSize.md}- strokeWidth={iconStroke.regular}- />- )}- </View>+ <MobileUserAvatar imageUrl={imageUrl} name={title} /><View style={styles.texts}><Text numberOfLines={1} style={styles.title}>{title}</Text>{subtitle ? (@@ -246,19 +207,7 @@ const makeStyles = (colors: ThemeColors) =>paddingHorizontal: spacing.md,paddingVertical: spacing.sm,},- avatar: {- alignItems: 'center',- backgroundColor: colors.surfaceElevated,- borderColor: colors.border,- borderRadius: radius.pill,- borderWidth: StyleSheet.hairlineWidth,- height: 44,- justifyContent: 'center',- overflow: 'hidden',- width: 44,- },- avatarImage: { height: 44, width: 44 },- texts: { flex: 1, gap: 2, minWidth: 0 },+ texts: { flex: 1, gap: spacing.xs, minWidth: 0 },title: {color: colors.textPrimary,fontSize: typeScale.body,@@ -271,28 +220,17 @@ const makeStyles = (colors: ThemeColors) =>lineHeight: lineHeight.caption,},addButton: {- alignItems: 'center',- borderRadius: radius.container,- flexDirection: 'row',- gap: spacing.sm,- justifyContent: 'center',- minHeight: 48,marginHorizontal: spacing.lg,},- addLabel: {- color: colors.textPrimary,- fontSize: typeScale.body,- lineHeight: lineHeight.body,- fontWeight: fontWeight.medium,- },loading: { paddingVertical: spacing.xl },+ // 报错说明文字走黑白系 errorText;红色只留给状态点与破坏性按钮。error: {- color: colors.statusError,+ color: colors.errorText,fontSize: typeScale.footnote,lineHeight: lineHeight.caption,paddingHorizontal: spacing.md,paddingVertical: spacing.sm,textAlign: 'center',},- pressed: { opacity: 0.72 },+ pressed: mobileInteractionStyles.pressed,});diff --git a/apps/mobile/src/session/AuthorizationMessageCard.tsx b/apps/mobile/src/session/AuthorizationMessageCard.tsxindex f6e6c3766d..4693ee98d7 100644--- a/apps/mobile/src/session/AuthorizationMessageCard.tsx+++ b/apps/mobile/src/session/AuthorizationMessageCard.tsx@@ -36,5 +36,5 @@ export function AuthorizationMessageCard({ message }: { message: NormalizedRemot}const makeStyles = (colors: ThemeColors) => StyleSheet.create({wrapper: { marginVertical: spacing.sm, gap: spacing.xs },- error: { color: colors.statusError, fontSize: typeScale.footnote, lineHeight: lineHeight.caption },+ error: { color: colors.errorText, fontSize: typeScale.footnote, lineHeight: lineHeight.caption },});diff --git a/apps/mobile/src/session/CompanionAutomationNativeView.ios.tsx b/apps/mobile/src/session/CompanionAutomationNativeView.ios.tsxindex 54f8bea342..91937871bb 100644--- a/apps/mobile/src/session/CompanionAutomationNativeView.ios.tsx+++ b/apps/mobile/src/session/CompanionAutomationNativeView.ios.tsx@@ -1,6 +1,6 @@import { Fragment, useState } from 'react';import { Button, DisclosureGroup, HStack, Image, Picker, ProgressView, Spacer, Text, TextField, Toggle, VStack, useNativeState } from '@expo/ui/swift-ui';-import { accessibilityLabel, buttonStyle, contentShape, disabled, font, foregroundStyle, frame, keyboardType, lineLimit, pickerStyle, shapes, tag, textInputAutocapitalization, textSelection } from '@expo/ui/swift-ui/modifiers';+import { accessibilityLabel, buttonStyle, contentShape, disabled, font, foregroundStyle, frame, keyboardType, lineLimit, pickerStyle, shapes, tag, textInputAutocapitalization, textSelection, tint } from '@expo/ui/swift-ui/modifiers';import { useTranslation } from 'react-i18next';import { randomUUID } from 'expo-crypto';import { iconSize, spacing, useTheme } from '@/theme';@@ -75,7 +75,7 @@ export function CompanionAutomationNativeView(p: CompanionAutomationNativeViewPrconst { t, i18n } = useTranslation();const { colors } = useTheme();const tr = (key: string) => t(`devices.companions.automation.${key}`);- const note = (text: string, error = false) => <Section><Text modifiers={[font({ textStyle: 'footnote' }), foregroundStyle(error ? colors.statusError : colors.textSecondary), textSelection(error)]}>{text}</Text></Section>;+ const note = (text: string, error = false) => <Section><Text modifiers={[font({ textStyle: 'footnote' }), foregroundStyle(error ? colors.errorText : colors.textSecondary), textSelection(error)]}>{text}</Text></Section>;const updateTrigger = (index: number, value: RoutineTrigger) => p.onChange(draft => draft && ({ ...draft, triggers: draft.triggers.map((item, i) => i === index ? value : item) }));const triggerText = (trigger: Record<string, unknown>) => trigger.kind === 'interval'? t('devices.companions.automation.everyMinutes', { count: Number(trigger.intervalMs) / 60_000 })@@ -104,11 +104,11 @@ export function CompanionAutomationNativeView(p: CompanionAutomationNativeViewPr</> : detail ? <>{draft && detail.editable ? <Fragment key={`${p.selected}:${p.draftGeneration}`}><Section title={tr('name')}><Field label={tr('name')} value={draft.name} onChange={name => p.onChange(d => d && ({ ...d, name }))} busy={p.busy} />- <Toggle label={tr('enabled')} isOn={draft.enabled} onIsOnChange={enabled => p.onChange(d => d && ({ ...d, enabled }))} modifiers={[disabled(p.busy)]} />+ <Toggle label={tr('enabled')} isOn={draft.enabled} onIsOnChange={enabled => p.onChange(d => d && ({ ...d, enabled }))} modifiers={[disabled(p.busy), tint(colors.inputCaret)]} /></Section><Section title={tr('instructions')}><Field label={tr('instructions')} value={draft.prompt} onChange={prompt => p.onChange(d => d && ({ ...d, prompt }))} busy={p.busy} multiline /></Section>{p.detail?.supportsPreRunCheck ? <Section><DisclosureGroup label={tr('advanced')} isExpanded={advancedOpen} onIsExpandedChange={setAdvancedOpen}>- <Toggle label={tr('quiet')} isOn={draft.silentWhenIdle ?? false} onIsOnChange={silentWhenIdle => p.onChange(d => d && ({ ...d, silentWhenIdle }))} modifiers={[disabled(p.busy)]} />+ <Toggle label={tr('quiet')} isOn={draft.silentWhenIdle ?? false} onIsOnChange={silentWhenIdle => p.onChange(d => d && ({ ...d, silentWhenIdle }))} modifiers={[disabled(p.busy), tint(colors.inputCaret)]} /><Text modifiers={[font({ textStyle: 'footnote' }), foregroundStyle(colors.textSecondary)]}>{tr('quietHint')}</Text><FieldRow label={tr('checkCommand')} value={draft.preRunHook?.command ?? ''} onChange={command => p.onChange(d => d && ({ ...d, preRunHook: command ? { ...d.preRunHook, command } : null }))} busy={p.busy} multiline literal /><Text modifiers={[font({ textStyle: 'footnote' }), foregroundStyle(colors.textSecondary)]}>{tr('checkHint')}</Text>@@ -138,7 +138,7 @@ export function CompanionAutomationNativeView(p: CompanionAutomationNativeViewPr{getRoutineActionId(p.resource, 'routine-run') ? <Section><Action label={tr(p.dirty ? 'saveAndRun' : 'run')} onPress={() => p.onAct('routine-run')} blocked={p.busy || p.loading || !p.online || detail.history.some(r => r.status === 'running' || r.status === 'queued')} /></Section> : null}<Section title={tr('history')}>{detail.history.length ? detail.history.map(run => <VStack key={run.id} alignment="leading" spacing={spacing.sm}><Text>{tr(run.status)}</Text><Text modifiers={[font({ textStyle: 'caption' }), foregroundStyle(colors.textSecondary)]}>{new Date(run.createdAt).toLocaleString(i18n.language)}</Text>- {run.resultText ? <Text modifiers={[textSelection(true)]}>{run.resultText}</Text> : null}{run.error ? <Text modifiers={[foregroundStyle(colors.statusError), textSelection(true)]}>{run.error}</Text> : null}+ {run.resultText ? <Text modifiers={[textSelection(true)]}>{run.resultText}</Text> : null}{run.error ? <Text modifiers={[foregroundStyle(colors.errorText), textSelection(true)]}>{run.error}</Text> : null}</VStack>) : <Text modifiers={[foregroundStyle(colors.textSecondary)]}>{tr('noRuns')}</Text>}</Section>{getRoutineActionId(p.resource, 'routine-delete') ? <Section><Action label={tr('delete')} onPress={p.onDelete} blocked={p.busy || p.loading || p.dirty || !p.online} destructive /></Section> : null}</> : null}diff --git a/apps/mobile/src/session/CompanionAutomationSheet.tsx b/apps/mobile/src/session/CompanionAutomationSheet.tsxindex 15f60b7c10..6da9f9a96c 100644--- a/apps/mobile/src/session/CompanionAutomationSheet.tsx+++ b/apps/mobile/src/session/CompanionAutomationSheet.tsx@@ -1,6 +1,6 @@import { iconSize } from '@/theme';import { useCallback, useEffect, useMemo, useRef, useState } from 'react';-import { ActivityIndicator, Alert, AppState, Platform, Pressable, StyleSheet, Switch, View } from 'react-native';+import { ActivityIndicator, Alert, AppState, Platform, Pressable, StyleSheet, View } from 'react-native';import { ChevronRight, Clock3, Plus } from 'lucide-react-native';import { useTranslation } from 'react-i18next';import { randomUUID } from 'expo-crypto';@@ -10,9 +10,10 @@ import { useAuth } from '@/auth/AuthContext';import { useDeviceLink } from '@/device-link/DeviceLinkContext';import { startFocusedTopicSubscription } from '@/device-link/focusedTopicSubscription';import { getRemoteResource, invokeRemoteResourceAction } from '@/device-link/remoteResources';+import { NativeSwitch } from '@/platform/chrome/NativeSwitch';import { CompanionChoice } from './CompanionChoice';import { useTheme, useThemedStyles, type ThemeColors } from '@/theme';-import { fontWeight, radius, spacing, typeScale, lineHeight } from '@/theme/tokens';+import { fontWeight, iconStroke, radius, spacing, typeScale, lineHeight } from '@/theme/tokens';import { CompanionSheet } from './CompanionSheet';import { CompanionAutomationNativeView } from './CompanionAutomationNativeView';import { useRoutineCronFields } from './useRoutineCronFields';@@ -213,7 +214,7 @@ export function CompanionAutomationSheet({ visible, onClose, collectionId, botId<Clock3 size={iconSize.lg} color={colors.textSecondary} /><View style={styles.flex}><Text numberOfLines={1} style={styles.label}>{item.name}</Text><Text numberOfLines={1} style={styles.secondary}>{item.activity ? tr(item.activity) : !item.enabled ? tr('paused') : item.triggers.map(triggerText).join(' · ')}</Text></View>- <ChevronRight size={iconSize.sm} color={colors.textTertiary} />+ <ChevronRight size={iconSize.lg} color={colors.textTertiary} strokeWidth={iconStroke.regular} /></Pressable>);const field = (label: string, value: string, onChangeText: (value: string) => void, multiline = false) => (@@ -242,11 +243,11 @@ export function CompanionAutomationSheet({ visible, onClose, collectionId, botId</> : detail ? <>{draft && detail.editable ? <>{field(tr('name'), draft.name, (name) => setDraft({ ...draft, name }))}- <View style={styles.row}><Text style={[styles.label, styles.flex]}>{tr('enabled')}</Text><Switch accessibilityLabel={tr('enabled')} disabled={busy} value={draft.enabled} onValueChange={(enabled) => setDraft({ ...draft, enabled })} trackColor={{ true: colors.textSecondary }} /></View>+ <View style={styles.row}><Text style={[styles.label, styles.flex]}>{tr('enabled')}</Text><NativeSwitch accessibilityLabel={tr('enabled')} disabled={busy} value={draft.enabled} onValueChange={(enabled) => setDraft({ ...draft, enabled })} seedColor={colors.inputCaret} /></View>{field(tr('instructions'), draft.prompt, (prompt) => setDraft({ ...draft, prompt }), true)}{detail?.supportsPreRunCheck ? <Pressable accessibilityRole="button" accessibilityState={{ expanded: advancedOpen }} onPress={() => setAdvancedOpen(!advancedOpen)} style={styles.row}><Text style={styles.label}>{tr('advanced')}</Text></Pressable> : null}{detail?.supportsPreRunCheck && advancedOpen ? <View style={styles.group}>- <View style={styles.row}><Text style={[styles.label, styles.flex]}>{tr('quiet')}</Text><Switch accessibilityLabel={tr('quiet')} disabled={busy} value={draft.silentWhenIdle ?? false} onValueChange={(silentWhenIdle) => setDraft({ ...draft, silentWhenIdle })} trackColor={{ true: colors.textSecondary }} /></View>+ <View style={styles.row}><Text style={[styles.label, styles.flex]}>{tr('quiet')}</Text><NativeSwitch accessibilityLabel={tr('quiet')} disabled={busy} value={draft.silentWhenIdle ?? false} onValueChange={(silentWhenIdle) => setDraft({ ...draft, silentWhenIdle })} seedColor={colors.inputCaret} /></View><Text style={styles.secondary}>{tr('quietHint')}</Text>{field(tr('checkCommand'), draft.preRunHook?.command ?? '', (command) => setDraft({ ...draft, preRunHook: command ? { ...draft.preRunHook, command } : null }), true)}<Text style={styles.secondary}>{tr('checkHint')}</Text>@@ -315,5 +316,5 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({input: { minHeight: 44, padding: spacing.md, color: colors.textPrimary, backgroundColor: colors.surfaceElevated, borderWidth: StyleSheet.hairlineWidth, borderColor: colors.border, borderRadius: radius.pill, fontSize: typeScale.body },clockInput: { width: 64, textAlign: 'center' },multiline: { minHeight: 112, textAlignVertical: 'top', borderRadius: radius.control }, empty: { margin: spacing.lg, fontSize: typeScale.bodySmall, lineHeight: lineHeight.bodySmall, color: colors.textSecondary },- error: { color: colors.statusError, fontSize: typeScale.footnote, lineHeight: lineHeight.caption }, disabled: { opacity: 0.45 },+ error: { color: colors.errorText, fontSize: typeScale.footnote, lineHeight: lineHeight.caption }, disabled: { opacity: 0.45 },});diff --git a/apps/mobile/src/session/CompanionBackButton.ios.tsx b/apps/mobile/src/session/CompanionBackButton.ios.tsxnew file mode 100644index 0000000000..bcfc226f75--- /dev/null+++ b/apps/mobile/src/session/CompanionBackButton.ios.tsx@@ -0,0 +1,6 @@+import { NativeChromeBackButton } from '@/platform/chrome/NativeChromeBackButton.ios';++/** Same native back control as the task header (system chevron, chrome size). */+export function CompanionBackButton({ label, onPress }: { label: string; onPress(): void }) {+ return <NativeChromeBackButton testID="companion.back" label={label} onPress={onPress} />;+}diff --git a/apps/mobile/src/session/CompanionBackButton.tsx b/apps/mobile/src/session/CompanionBackButton.tsxnew file mode 100644index 0000000000..4600a6d30d--- /dev/null+++ b/apps/mobile/src/session/CompanionBackButton.tsx@@ -0,0 +1,11 @@+import { ChevronLeft } from 'lucide-react-native';+import { iconSize, iconStroke, useTheme } from '@/theme';+import { HomeHeaderGlassButton } from './HomeHeaderGlassButton';++/** Non-iOS fallback matching ScreenBackButton's icon metrics. */+export function CompanionBackButton({ label, onPress }: { label: string; onPress(): void }) {+ const { colors } = useTheme();+ return <HomeHeaderGlassButton testID="companion.back" accessibilityLabel={label} onPress={onPress}>+ <ChevronLeft size={iconSize.action} strokeWidth={iconStroke.regular} color={colors.textPrimary} />+ </HomeHeaderGlassButton>;+}diff --git a/apps/mobile/src/session/CompanionChoice.tsx b/apps/mobile/src/session/CompanionChoice.tsxindex e2517eaeeb..8e34a4c71b 100644--- a/apps/mobile/src/session/CompanionChoice.tsx+++ b/apps/mobile/src/session/CompanionChoice.tsx@@ -5,6 +5,11 @@ import { Check, ChevronDown } from 'lucide-react-native';import { Text } from '@/components/AppText';import { NativePullDownMenu, usesNativePullDownMenu } from '@/platform/chrome/NativePullDownMenu';import { spacing, useTheme } from '@/theme';+import { fontWeight, lineHeight, typeScale } from '@/theme/tokens';++// §3 roles: the row title / option is 16/22 medium; the current value on the right is 16/22 regular secondary.+const titleText = { fontSize: typeScale.body, lineHeight: lineHeight.body, fontWeight: fontWeight.medium } as const;+const valueText = { fontSize: typeScale.body, lineHeight: lineHeight.body, fontWeight: fontWeight.regular } as const;export function CompanionChoice({ label, value, options, onChange, disabled }: {label: string; value: string; options: { value: string; label: string }[]; onChange(value: string): void; disabled: boolean;}) {@@ -12,9 +17,9 @@ export function CompanionChoice({ label, value, options, onChange, disabled }: {const select = (value: string) => { if (!disabled) { setExpanded(false); onChange(value); } };return <View><NativePullDownMenu actions={options.map(option => ({ id: option.value, title: option.label, state: option.value === value ? 'on' : 'off', disabled }))} onAction={select}><Pressable accessibilityRole="button" accessibilityLabel={label} disabled={disabled} style={{ minHeight: 44, flexDirection: 'row', alignItems: 'center', gap: spacing.sm }} onPress={() => { if (!usesNativePullDownMenu()) setExpanded(!expanded); }}>- <Text style={{ color: colors.textPrimary }}>{label}</Text><Text style={{ flex: 1, textAlign: 'right', color: colors.textSecondary }} numberOfLines={1}>{options.find(option => option.value === value)?.label ?? value}</Text><ChevronDown size={iconSize.md} color={colors.textSecondary} />+ <Text style={{ ...titleText, color: colors.textPrimary }}>{label}</Text><Text style={{ ...valueText, flex: 1, textAlign: 'right', color: colors.textSecondary }} numberOfLines={1}>{options.find(option => option.value === value)?.label ?? value}</Text><ChevronDown size={iconSize.md} color={colors.textSecondary} /></Pressable></NativePullDownMenu>{expanded && !usesNativePullDownMenu() ? options.map(option => <Pressable key={option.value} accessibilityRole="radio" accessibilityState={{ checked: value === option.value }} disabled={disabled} onPress={() => select(option.value)} style={{ minHeight: 44, flexDirection: 'row', alignItems: 'center', gap: spacing.sm }}>- <Text style={{ color: colors.textPrimary, flex: 1 }}>{option.label}</Text>{option.value === value ? <Check size={iconSize.lg} color={colors.textPrimary} /> : null}+ <Text style={{ ...titleText, color: colors.textPrimary, flex: 1 }}>{option.label}</Text>{option.value === value ? <Check size={iconSize.lg} color={colors.textPrimary} /> : null}</Pressable>) : null}</View>;}diff --git a/apps/mobile/src/session/CompanionHeader.tsx b/apps/mobile/src/session/CompanionHeader.tsxindex 78df2d93b8..e1bbfae94b 100644--- a/apps/mobile/src/session/CompanionHeader.tsx+++ b/apps/mobile/src/session/CompanionHeader.tsx@@ -8,6 +8,8 @@ import { Text } from '@/components/AppText';import { RemoteCompanionAvatar } from '@/components/RemoteCompanionAvatar';import { fontWeight, iconSize, iconStroke, lineHeight, spacing, typeScale, useTheme, useThemedStyles, type ThemeColors } from '@/theme';import { HomeHeaderGlassButton } from './HomeHeaderGlassButton';+import { CompanionBackButton } from './CompanionBackButton';+import { useSystemNavigationBack } from '@/platform/chrome/SystemNavigationBack';import { TeammatePicker } from './TeammatePicker';import { CompanionCreateSheet, CompanionProfileSheet } from './CompanionProfileSheet';import { CompanionAutomationSheet } from './CompanionAutomationSheet';@@ -17,15 +19,20 @@ const AVATAR_SIZE = 32;export function CompanionHeader(props: {resource: RemoteResource; deviceId: string; deviceName: string; online: boolean; controlsReady?: boolean; onSearch(): void; onOpenNavigation(): void;+ /** Back to where the chat was opened from (the partner list). */+ onBack?(): void;}) {const { accountGeneration } = useAuth();return <CompanionHeaderContent key={accountGeneration} {...props} />;}-function CompanionHeaderContent({ resource, deviceId, deviceName, online, controlsReady = true, onSearch, onOpenNavigation }: Parameters<typeof CompanionHeader>[0]) {+function CompanionHeaderContent({ resource, deviceId, deviceName, online, controlsReady = true, onSearch, onOpenNavigation, onBack }: Parameters<typeof CompanionHeader>[0]) {const { t, i18n } = useTranslation();const { colors } = useTheme();const styles = useThemedStyles(makeStyles);const navigation = useTeammateNavigation();+ // Duo's vertical system bar already carries a back item: keep the sidebar+ // button there instead of showing two backs.+ const systemBack = useSystemNavigationBack();const [picker, setPicker] = useState(false);const [profile, setProfile] = useState(false);const [automation, setAutomation] = useState(false);@@ -36,9 +43,11 @@ function CompanionHeaderContent({ resource, deviceId, deviceName, online, controconst afterProfile = (action: () => void) => { pending.current = action; setProfile(false); };return <><View style={styles.header} testID="companion.header">- <HomeHeaderGlassButton testID="companion.navigation" accessibilityLabel={t('devices.companions.openNavigation')} onPress={() => { Keyboard.dismiss(); onOpenNavigation(); }}>- <PanelLeft size={iconSize.lg} strokeWidth={iconStroke.regular} color={colors.textPrimary} />- </HomeHeaderGlassButton>+ {onBack && !systemBack+ ? <CompanionBackButton label={t('shared.back')} onPress={() => { Keyboard.dismiss(); onBack(); }} />+ : <HomeHeaderGlassButton testID="companion.navigation" accessibilityLabel={t('devices.companions.openNavigation')} onPress={() => { Keyboard.dismiss(); onOpenNavigation(); }}>+ <PanelLeft size={iconSize.lg} strokeWidth={iconStroke.regular} color={colors.textPrimary} />+ </HomeHeaderGlassButton>}<Pressable style={styles.identity} accessibilityRole="button" accessibilityLabel={name} accessibilityHint={t('devices.companions.title')} onPress={() => setPicker(true)} testID="companion.picker"><RemoteCompanionAvatar avatar={resource.display.avatar} name={name} deviceId={deviceId} online={online} size={AVATAR_SIZE} /><Text numberOfLines={1} style={styles.name}>{name}</Text>diff --git a/apps/mobile/src/session/CompanionMemoryPage.tsx b/apps/mobile/src/session/CompanionMemoryPage.tsxindex 061e83b7e7..790326bdff 100644--- a/apps/mobile/src/session/CompanionMemoryPage.tsx+++ b/apps/mobile/src/session/CompanionMemoryPage.tsx@@ -3,6 +3,7 @@ import { useTranslation } from 'react-i18next';import { resolveRemoteText } from '@cindy/device-link';import { Text, TextInput } from '@/components/AppText';import { MainWindowActionButton } from '@/components/MobilePrimitives';+import { mobileInteractionStyles } from '@/components/mobileInteractionStyles';import { fontWeight, lineHeight, radius, spacing, typeScale, useTheme, useThemedStyles, type ThemeColors } from '@/theme';import { COMPANION_MEMORY_TITLE_MAX, companionMemoryDate, companionMemoryFieldLabel, type CompanionMemoryState } from './useCompanionMemory';@@ -37,14 +38,14 @@ export function CompanionMemoryPage({ memory: m, online, botName, memoryEnabled: !m.listLoaded ? (online ? note(t('devices.resources.loading')) : null): m.groups.length ? m.groups.map(group => <View key={group.id} style={styles.stack} accessibilityLabel={group.title}><Text accessibilityRole="header" style={styles.groupTitle}>{group.title}<Text style={styles.count}>{` ${group.count}`}</Text></Text>- <View style={[styles.group, !memoryEnabled && styles.dimmed]}>{group.entries.map((entry, index) =>+ <View style={styles.group}>{group.entries.map((entry, index) =><Pressable key={entry.resourceId} accessibilityRole="button" accessibilityLabel={entry.title} onPress={() => m.open(entry.resourceId)}- style={({ pressed }) => [styles.row, index > 0 && styles.separator, pressed && styles.pressed]} testID={`companionMemory.${entry.id}`}>+ style={({ pressed }) => [styles.row, index > 0 && styles.separator, pressed && mobileInteractionStyles.pressed]} testID={`companionMemory.${entry.id}`}><View style={styles.rowHeader}>- <Text numberOfLines={2} style={styles.rowTitle}>{entry.title}</Text>+ <Text numberOfLines={2} style={[styles.rowTitle, !memoryEnabled && styles.dimmedTitle]}>{entry.title}</Text><Text style={styles.date}>{date(entry.timestamp)}</Text></View>- {entry.preview ? <Text numberOfLines={2} style={styles.preview}>{entry.preview}</Text> : null}+ {entry.preview ? <Text numberOfLines={2} style={[styles.preview, !memoryEnabled && styles.dimmedPreview]}>{entry.preview}</Text> : null}</Pressable>)}</View></View>)@@ -116,12 +117,14 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({body: { fontSize: typeScale.body, lineHeight: lineHeight.bodyRelaxed, color: colors.textPrimary },groupTitle: { fontSize: typeScale.footnote, lineHeight: lineHeight.caption, color: colors.textTertiary, fontWeight: fontWeight.semibold, paddingHorizontal: spacing.xs },count: { color: colors.textTertiary, fontWeight: fontWeight.regular },- group: { backgroundColor: colors.surfaceElevated, borderRadius: radius.container, overflow: 'hidden' },- dimmed: { opacity: 0.6 },+ // Raised surface: a 1px border carries the layer on the light ivory page (mobile guide §2).+ group: { backgroundColor: colors.surfaceElevated, borderRadius: radius.container, borderWidth: StyleSheet.hairlineWidth, borderColor: colors.border, overflow: 'hidden' },+ // Memory switched off: step each line down one semantic text tone instead of fading the whole card.+ dimmedTitle: { color: colors.textSecondary },+ dimmedPreview: { color: colors.textTertiary },notice: { padding: spacing.lg, gap: spacing.sm },row: { minHeight: 44, paddingHorizontal: spacing.lg, paddingVertical: spacing.md, gap: spacing.xs },separator: { borderTopWidth: StyleSheet.hairlineWidth, borderTopColor: colors.border },- pressed: { opacity: 0.72 },rowHeader: { flexDirection: 'row', alignItems: 'flex-start', gap: spacing.md },rowTitle: { flex: 1, fontSize: typeScale.bodySmall, lineHeight: lineHeight.bodySmall, color: colors.textPrimary, fontWeight: fontWeight.medium },date: { fontSize: typeScale.micro, lineHeight: lineHeight.bodySmall, color: colors.textTertiary },diff --git a/apps/mobile/src/session/CompanionMessageActions.tsx b/apps/mobile/src/session/CompanionMessageActions.tsxindex 2da4b55f21..8448e707ce 100644--- a/apps/mobile/src/session/CompanionMessageActions.tsx+++ b/apps/mobile/src/session/CompanionMessageActions.tsx@@ -6,6 +6,10 @@ import { useTranslation } from 'react-i18next';import { Text } from '@/components/AppText';import { NativePullDownMenu, usesNativePullDownMenu, type NativePullDownAction } from '@/platform/chrome/NativePullDownMenu';import { useTheme, spacing } from '@/theme';+import { fontWeight, lineHeight, typeScale } from '@/theme/tokens';++/** §3 menu-item role: 16/22 medium. */+const menuItemText = { fontSize: typeScale.body, lineHeight: lineHeight.body, fontWeight: fontWeight.medium } as const;import { CompanionSheet } from './CompanionSheet';/** Compact companion controls; the existing task handlers still own every operation. */@@ -28,7 +32,7 @@ export function CompanionMessageActions({ user, copied, copying, disabled, onCop</NativePullDownMenu><CompanionSheet visible={open} title="" onClose={() => { pending.current = null; setOpen(false); }} onClosed={() => { const id = pending.current; pending.current = null; if (id) onAction(id); }}>{actions.map(action => <Pressable key={action.id} disabled={action.disabled} accessibilityRole="button" style={{ minHeight: 44, justifyContent: 'center', paddingHorizontal: spacing.md }} onPress={() => { pending.current = action.id; setOpen(false); }}>- <Text style={{ color: action.destructive ? colors.destructive : action.disabled ? colors.textSecondary : colors.textPrimary }}>{action.title}</Text>+ <Text style={{ ...menuItemText, color: action.destructive ? colors.destructive : action.disabled ? colors.textSecondary : colors.textPrimary }}>{action.title}</Text></Pressable>)}</CompanionSheet></View>;diff --git a/apps/mobile/src/session/CompanionMessageCard.tsx b/apps/mobile/src/session/CompanionMessageCard.tsxindex d85a8c713d..9cb4c0bebe 100644--- a/apps/mobile/src/session/CompanionMessageCard.tsx+++ b/apps/mobile/src/session/CompanionMessageCard.tsx@@ -1,6 +1,7 @@import { CompanionTaskResultCard } from './CompanionTaskResultCard';import { Component, useEffect, useState, useSyncExternalStore, type ReactNode } from 'react';-import { useLocalSearchParams, useRouter } from 'expo-router';+import { useLocalSearchParams } from 'expo-router';+import { useGuardedPush } from '@/utils/useGuardedPush';import { Linking, Pressable, StyleSheet, View, type LayoutChangeEvent } from 'react-native';import {FileText,@@ -121,7 +122,7 @@ function CompanionMessageCardContent({ message, renderMarkdown }: {/** Desktop BotDirectMessageCard: a separator pill with the peer's portrait, opening the read-only thread. */function CompanionPrivateTrace({ deviceId, meta }: { deviceId: string; meta: BotDirectMessageMeta }) {const { t, i18n } = useTranslation();- const router = useRouter();+ const push = useGuardedPush();const { user } = useAuth();const { status, getPresenceAvailability } = useDeviceLink();const styles = useThemedStyles(makeStyles);@@ -139,7 +140,7 @@ function CompanionPrivateTrace({ deviceId, meta }: { deviceId: string; meta: BotaccessibilityRole="button"style={styles.traceTouchTarget}onPress={() =>- router.push({+ push({pathname: '/companions/direct/[threadId]',params: {deviceId,@@ -176,7 +177,7 @@ function CompanionTaskCard({meta: BotCollaborationMeta;}) {const { t } = useTranslation();- const router = useRouter();+ const push = useGuardedPush();const { invoke } = useDeviceLink();const styles = useThemedStyles(makeStyles);const { colors } = useTheme();@@ -402,7 +403,7 @@ function CompanionTaskCard({accessibilityRole="button"style={styles.touchTarget}onPress={() =>- router.push({+ push({pathname: '/sessions/[sessionId]',params: { deviceId, sessionId: childSessionId },})@@ -515,9 +516,9 @@ const makeStyles = (colors: ThemeColors) =>action: {minHeight: 32,minWidth: 104,- paddingHorizontal: 12,- paddingVertical: 5,- gap: 6,+ paddingHorizontal: spacing.md,+ paddingVertical: spacing.xs,+ gap: spacing.xs,flexDirection: 'row',alignItems: 'center',justifyContent: 'center',diff --git a/apps/mobile/src/session/CompanionModelChain.tsx b/apps/mobile/src/session/CompanionModelChain.tsxindex b6cea32206..5d6b5c786c 100644--- a/apps/mobile/src/session/CompanionModelChain.tsx+++ b/apps/mobile/src/session/CompanionModelChain.tsx@@ -3,7 +3,7 @@ import { buildMobileModelSections } from './providerModelSections';import { mobileProviderAccountTitle } from './mobileModelRowPresentation';import { iconSize, lineHeight } from '@/theme';import { useState } from 'react';-import { Pressable, StyleSheet, Switch, View } from 'react-native';+import { Pressable, StyleSheet, View } from 'react-native';import { ChevronDown, ChevronRight, ChevronUp, MinusCircle, Plus, ArrowUp } from 'lucide-react-native';import { useTranslation } from 'react-i18next';import { Text } from '@/components/AppText';@@ -11,6 +11,8 @@ import { useDeviceProviders } from '@/device-link/useDeviceProviders';import { useMobileMakerTransport } from '@/device-link/useMobileMakerTransport';import { useAuth } from '@/auth/AuthContext';import { spacing, typeScale, useTheme } from '@/theme';+import { fontWeight, iconStroke, lineHeight as lineHeights, typeScale as typeScales } from '@/theme/tokens';+import { NativeSwitch } from '@/platform/chrome/NativeSwitch';import { ModelPickerSheet } from './ModelPickerSheet';import { normalizeMobileAgentCapabilities } from './agentCapabilities';import type { MobileModelConfiguration } from './unifiedMobileModels';@@ -41,7 +43,7 @@ export function CompanionModelChain({ deviceId, values, onChange, onPick, disablconst source = provider ? mobileProviderAccountTitle(provider) : route.providerId;return <View key={`${route.harness}:${route.providerId}:${route.model}`} style={styles.row}><Pressable accessibilityRole="button" disabled={disabled || following} onPress={() => onPick(index)} style={[styles.row, { flex: 1 }]}>- <Text style={{ color: colors.textSecondary }}>{index + 1}</Text><View style={{ flex: 1 }}><Text style={{ color: colors.textPrimary, fontSize: typeScale.body, lineHeight: lineHeight.body }}>{model?.name ?? route.model}</Text><Text style={{ color: colors.textSecondary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption }}>{[source, route.harness === 'claude' ? 'Claude Code' : route.harness === 'codex' ? 'Codex' : 'Pi', route.effort ? t(`models.options.effortLevels.${route.effort}`, { defaultValue: route.effort }) : '', route.fastMode ? 'Fast' : ''].filter(Boolean).join(' · ')}</Text></View><ChevronRight size={iconSize.md} color={colors.textSecondary} />+ <Text style={{ ...styles.value, color: colors.textSecondary }}>{index + 1}</Text><View style={{ flex: 1 }}><Text style={{ ...styles.title, color: colors.textPrimary }}>{model?.name ?? route.model}</Text><Text style={{ color: colors.textSecondary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption }}>{[source, route.harness === 'claude' ? 'Claude Code' : route.harness === 'codex' ? 'Codex' : 'Pi', route.effort ? t(`models.options.effortLevels.${route.effort}`, { defaultValue: route.effort }) : '', route.fastMode ? 'Fast' : ''].filter(Boolean).join(' · ')}</Text></View><ChevronRight size={iconSize.lg} color={colors.textTertiary} strokeWidth={iconStroke.regular} /></Pressable>{/* Desktop BotModelChainEditor: the first model stays primary (change it with the picker);backups reorder among themselves and can be removed. */}@@ -49,9 +51,9 @@ export function CompanionModelChain({ deviceId, values, onChange, onPick, disabl{!following && index > 0 ? <Pressable accessibilityRole="button" accessibilityLabel={t('devices.companionProfile.removeModel')} disabled={disabled} style={styles.hit} onPress={() => update(chain.filter((_, i) => index !== i))}><MinusCircle size={iconSize.lg} color={colors.textSecondary} /></Pressable> : null}</View>;};- const addRow = !following && chain.length < 5 ? <Pressable accessibilityRole="button" disabled={disabled} style={styles.row} onPress={() => onPick(chain.length)}><Plus size={iconSize.action} color={colors.textPrimary} /><Text style={{ color: colors.textPrimary }}>{t('devices.companionProfile.addModel')}</Text></Pressable> : null;+ const addRow = !following && chain.length < 5 ? <Pressable accessibilityRole="button" disabled={disabled} style={styles.row} onPress={() => onPick(chain.length)}><Plus size={iconSize.action} color={colors.textPrimary} /><Text style={{ ...styles.title, color: colors.textPrimary }}>{t('devices.companionProfile.addModel')}</Text></Pressable> : null;return <View style={{ gap: spacing.sm }}>- <View style={styles.row}><Text style={{ color: colors.textPrimary, flex: 1 }}>{t('devices.companionProfile.modelFollowsDefault')}</Text><Switch accessibilityLabel={t('devices.companionProfile.modelFollowsDefault')} value={following} disabled={disabled} onValueChange={value => onChange({ ...values, followsDefault: value })} /></View>+ <View style={styles.row}><Text style={{ ...styles.title, color: colors.textPrimary, flex: 1 }}>{t('devices.companionProfile.modelFollowsDefault')}</Text><NativeSwitch accessibilityLabel={t('devices.companionProfile.modelFollowsDefault')} value={following} disabled={disabled} onValueChange={value => onChange({ ...values, followsDefault: value })} seedColor={colors.inputCaret} /></View>{chain.length ? routeRow(chain[0], 0) : addRow}{chain.length ? <>{/* The backup chain stays folded inside this editor, as on Desktop. */}@@ -80,4 +82,7 @@ export function CompanionModelPicker({ visible, deviceId, route, onClose, onClosloadCapabilities: async agent => { const value = normalizeMobileAgentCapabilities(await maker.getCapabilities(agent)); if (!value) throw new Error('Capabilities unavailable'); return value; }, onSelect: select }}onSelectFlatModel={() => {}} onSelectProviderRow={() => {}} permissionOptions={[]} activePermissionMode="ask" onSelectPermissionMode={() => {}} hidePermissionTrigger keyboardAvoidingBehavior="padding" />;}-const styles = StyleSheet.create({ row: { flexDirection: 'row', alignItems: 'center', gap: spacing.sm, minHeight: 44 }, hit: { width: 44, height: 44, alignItems: 'center', justifyContent: 'center' } });+// §3 roles: row titles / options 16/22 medium, the ordinal beside them 16/22 regular secondary.+const styles = StyleSheet.create({ row: { flexDirection: 'row', alignItems: 'center', gap: spacing.sm, minHeight: 44 }, hit: { width: 44, height: 44, alignItems: 'center', justifyContent: 'center' },+ title: { fontSize: typeScales.body, lineHeight: lineHeights.body, fontWeight: fontWeight.medium },+ value: { fontSize: typeScales.body, lineHeight: lineHeights.body, fontWeight: fontWeight.regular } });diff --git a/apps/mobile/src/session/CompanionNavigationDrawer.tsx b/apps/mobile/src/session/CompanionNavigationDrawer.tsxindex bd6f8911db..2fd718dfe0 100644--- a/apps/mobile/src/session/CompanionNavigationDrawer.tsx+++ b/apps/mobile/src/session/CompanionNavigationDrawer.tsx@@ -1,5 +1,6 @@import { useCallback, useEffect, useRef, useState, useSyncExternalStore } from 'react';import { Alert } from 'react-native';+import { useRouter } from 'expo-router';import { useTranslation } from 'react-i18next';import { useAuth } from '@/auth/AuthContext';import { formatRemoteError } from '@/device-link/remoteStatus';@@ -15,27 +16,30 @@ export function CompanionNavigationDrawer({ open, onClose, onSearch }: { open: bconst { t } = useTranslation();const navigation = useTeammateNavigation();const push = useGuardedPush();+ const router = useRouter();const [accounts, setAccounts] = useState(false);const [loggingOut, setLoggingOut] = useState(false);const pending = useRef<(() => void) | null>(null);const current = useRef<number | null>(auth.accountGeneration); current.current = auth.accountGeneration;useEffect(() => () => { current.current = null; pending.current = null; }, []);const hasRunningTasks = useSyncExternalStore(- useCallback(listener => accounts ? remoteSessionStore.subscribe(listener) : () => {}, [accounts]),- useCallback(() => accounts && remoteSessionStore.getSessions().some(session => remoteSessionStore.isSessionRunning(session.id)), [accounts]),+ // 账号切换与抽屉里的退出确认共用;两者都关着时不订阅。+ useCallback(listener => accounts || open ? remoteSessionStore.subscribe(listener) : () => {}, [accounts, open]),+ useCallback(() => (accounts || open) && remoteSessionStore.getSessions().some(session => remoteSessionStore.isSessionRunning(session.id)), [accounts, open]),);const afterClose = (action: () => void) => { const owner = auth.accountGeneration; pending.current = () => { if (current.current === owner) action(); }; onClose(); };const finish = () => { const action = pending.current; pending.current = null; action?.(); };return <>- <HomeChromeDrawer open={open} user={auth.user} loggingOut={loggingOut} mode="teammates"+ <HomeChromeDrawer open={open} user={auth.user} loggingOut={loggingOut} hasRunningTasks={hasRunningTasks} mode="teammates"onClose={() => { pending.current = null; onClose(); }} onClosed={finish}onModeChange={mode => afterClose(() => { void navigation.chooseMode(mode); })}onOpenSearch={() => afterClose(onSearch)} onOpenDevices={() => afterClose(() => push('/devices/manage'))}onOpenSettings={() => afterClose(() => push('/settings'))} onOpenAccounts={() => afterClose(() => setAccounts(true))}+ // 抽屉内部已 confirmLogout;成功后与设置页一致直接回登录页。onLogout={() => {if (loggingOut) return;setLoggingOut(true); const owner = auth.accountGeneration;- void auth.logout().catch(cause => { if (current.current === owner) Alert.alert(t('devices.list.alert.actionFailed'), formatRemoteError(cause)); })+ void auth.logout().then(() => { router.replace('/login'); }, cause => { if (current.current === owner) Alert.alert(t('devices.list.alert.actionFailed'), formatRemoteError(cause)); }).finally(() => { if (current.current === owner) setLoggingOut(false); });}} /><AccountSwitcherSheet visible={accounts} hasRunningTasks={hasRunningTasks} onClose={() => { pending.current = null; setAccounts(false); }} onClosed={finish}diff --git a/apps/mobile/src/session/CompanionProfileNativeView.ios.tsx b/apps/mobile/src/session/CompanionProfileNativeView.ios.tsxindex d8e3e7c848..d5b3ecf023 100644--- a/apps/mobile/src/session/CompanionProfileNativeView.ios.tsx+++ b/apps/mobile/src/session/CompanionProfileNativeView.ios.tsx@@ -1,7 +1,7 @@import { iconSize, spacing } from '@/theme';import { Fragment, useEffect } from 'react';import { Button, HStack, Image, Picker, ProgressView, RNHostView, Spacer, Text, TextField, Toggle, useNativeState } from '@expo/ui/swift-ui';-import { accessibilityLabel, alignmentGuide, buttonStyle, contentShape, shapes, disabled, font, foregroundStyle, frame, lineLimit, listRowInsets, pickerStyle, tag } from '@expo/ui/swift-ui/modifiers';+import { accessibilityLabel, alignmentGuide, buttonStyle, contentShape, shapes, disabled, font, foregroundStyle, frame, lineLimit, listRowInsets, pickerStyle, tag, tint } from '@expo/ui/swift-ui/modifiers';import { useTranslation } from 'react-i18next';import { resolveRemoteText, type RemoteActionField } from '@cindy/device-link';import { View } from 'react-native';@@ -16,13 +16,14 @@ import { CompanionNativeContent } from './CompanionNativeContent.ios';export function CompanionNativeField({ field, values, onChange, busy }: { field: RemoteActionField; values: ProfileValues; onChange(values: ProfileValues): void; busy: boolean }) {const { i18n } = useTranslation();+ const { colors } = useTheme();const label = resolveRemoteText(field.label, i18n.language);const value = typeof values[field.id] === 'string' ? values[field.id] as string : '';const text = useNativeState(value);useEffect(() => { if (text.get() !== value) text.set(value); }, [value, text]);const update = (value: string | boolean) => onChange({ ...values, [field.id]: value });if (field.id === 'avatarImageBase64') return <Section title={label}><CompanionNativeContent><CompanionPortraitPicker value={value} onChange={update} disabled={busy} /></CompanionNativeContent></Section>;- if (field.kind === 'toggle') return <Toggle label={label} isOn={values[field.id] === true} onIsOnChange={update} modifiers={[disabled(busy)]} />;+ if (field.kind === 'toggle') return <Toggle label={label} isOn={values[field.id] === true} onIsOnChange={update} modifiers={[disabled(busy), tint(colors.inputCaret)]} />;if (field.kind === 'select') return <Picker label={label} selection={value} onSelectionChange={next => update(String(next))} modifiers={[pickerStyle('menu'), disabled(busy)]}>{(field.options ?? []).map(option => <Text key={option.value} modifiers={[tag(option.value)]}>{resolveRemoteText(option.label, i18n.language)}</Text>)}</Picker>;diff --git a/apps/mobile/src/session/CompanionProfileSheet.tsx b/apps/mobile/src/session/CompanionProfileSheet.tsxindex a86b19ceff..ffb17166a9 100644--- a/apps/mobile/src/session/CompanionProfileSheet.tsx+++ b/apps/mobile/src/session/CompanionProfileSheet.tsx@@ -1,21 +1,21 @@import { useCallback, useEffect, useMemo, useRef, useState } from 'react';import { useRouter } from 'expo-router';import { randomUUID } from 'expo-crypto';-import { Alert, Image, Platform, Pressable, ScrollView, StyleSheet, Switch, View } from 'react-native';+import { Alert, Image, Platform, Pressable, ScrollView, StyleSheet, View } from 'react-native';import { useTranslation } from 'react-i18next';import { Brain, Check, ChevronRight, Clock3, FileText, MessageCircle, Search, Settings2, Sparkles, UserRound } from 'lucide-react-native';import { resolveRemoteText, type RemoteResource, type RemoteResourceRef, type RemoteText } from '@cindy/device-link';import { useAuth } from '@/auth/AuthContext';import { Text, TextInput } from '@/components/AppText';import { MainWindowActionButton } from '@/components/MobilePrimitives';-import { NativePullDownMenu, usesNativePullDownMenu } from '@/platform/chrome';+import { NativePullDownMenu, NativeSwitch, usesNativePullDownMenu } from '@/platform/chrome';import { RemoteCompanionAvatar } from '@/components/RemoteCompanionAvatar';import { useDeviceLink } from '@/device-link/DeviceLinkContext';import { invokeRemoteResourceAction } from '@/device-link/remoteResources';import { readRemoteCollectionCache } from '@/device-link/remoteResourceAvailability';import { CompanionSettingsRow as ContextSheetRow } from './CompanionSettingsRow';import { CompanionSheet } from './CompanionSheet';-import { fontWeight, iconSize, lineHeight, radius, spacing, typeScale, useTheme, useThemedStyles, type ThemeColors } from '@/theme';+import { fontWeight, iconSize, iconStroke, lineHeight, radius, spacing, typeScale, useTheme, useThemedStyles, type ThemeColors } from '@/theme';import { CompanionModelChain, CompanionModelPicker, readCompanionModelChain } from './CompanionModelChain';import { CompanionCreateNativeView } from './CompanionCreateNativeView';import { CompanionPortraitPicker, randomCompanionPortrait } from './CompanionPortraitPicker';@@ -337,7 +337,7 @@ function CompanionProfileSheetContent(props: CompanionProfileSheetProps) {<Pressable accessibilityRole="button" accessibilityLabel={t('devices.companionProfile.profile')} onPress={() => open('profile')} style={styles.identity}><RemoteCompanionAvatar avatar={data?.resource.display.avatar ?? resource?.display.avatar} deviceId={deviceId} name={name} online={online} size={AVATAR_SIZE} /><View style={styles.identityText}><Text style={styles.name}>{name}</Text><Text numberOfLines={2} style={styles.note}>{label(data?.resource.display.subtitle ?? resource?.display.subtitle ?? '')}</Text></View>- <ChevronRight color={colors.textSecondary} size={iconSize.md} />+ <ChevronRight color={colors.textTertiary} size={iconSize.lg} strokeWidth={iconStroke.regular} /></Pressable><View style={styles.group}>{row('memory', Brain)}{row('models', Settings2)}{row('skills', Sparkles)}{row('artifacts', FileText)}</View><View style={styles.group}>@@ -501,7 +501,7 @@ function CompanionProfileForm({ panel, values, onChange, disabled }: { panel: Prreturn <View key={field.id} style={styles.field}><Text style={styles.heading}>{label}</Text>{field.id === 'avatarImageBase64' ? <CompanionPortraitPicker value={String(values[field.id] ?? '')} onChange={change} disabled={disabled} /> : field.id === 'portrait' && panel.portraits ? <View style={styles.choices}>{panel.portraits.map(portrait => <Pressable key={portrait.value} accessibilityRole="button" accessibilityLabel={`${label} ${Number(portrait.value) + 1}`} accessibilityState={{ selected: values[field.id] === portrait.value, disabled }} disabled={disabled} onPress={() => change(portrait.value)} style={[styles.portrait, values[field.id] === portrait.value && { borderColor: colors.textPrimary }]}><Image source={{ uri: portrait.uri }} style={styles.portraitImage} /></Pressable>)}</View>- : field.kind === 'toggle' ? <Switch accessibilityLabel={label} value={values[field.id] === true} onValueChange={change} disabled={fieldDisabled} trackColor={{ false: colors.border, true: colors.cta }} />+ : field.kind === 'toggle' ? <NativeSwitch accessibilityLabel={label} value={values[field.id] === true} onValueChange={change} disabled={fieldDisabled} seedColor={colors.inputCaret} />: field.kind === 'select' ? <View><NativePullDownMenu actions={options.map((option, index) => ({id: String(index), title: resolveRemoteText(option.label, i18n.language), disabled: optionDisabled(option),state: values[field.id] === option.value ? 'on' : 'off',@@ -510,7 +510,7 @@ function CompanionProfileForm({ panel, values, onChange, disabled }: { panel: PraccessibilityState={{ disabled: fieldDisabled, expanded: openSelect === field.id }} style={[styles.input, styles.select]}onPress={() => { if (!usesNativePullDownMenu()) { setOpenSelect(openSelect === field.id ? null : field.id); setSelectQuery(''); } }}><Text numberOfLines={2} style={styles.selectText}>{resolveRemoteText(options.find(option => option.value === values[field.id])?.label ?? '', i18n.language)}</Text>- <ChevronRight size={iconSize.md} color={colors.textSecondary} />+ <ChevronRight size={iconSize.lg} color={colors.textTertiary} strokeWidth={iconStroke.regular} /></Pressable></NativePullDownMenu>{!fieldDisabled && openSelect === field.id ? <View style={styles.group}>@@ -535,7 +535,8 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({note: { fontSize: typeScale.footnote, lineHeight: lineHeight.caption, color: colors.textSecondary },body: { fontSize: typeScale.body, lineHeight: lineHeight.body, color: colors.textPrimary },heading: { fontSize: typeScale.body, lineHeight: lineHeight.body, color: colors.textPrimary, fontWeight: fontWeight.medium },- group: { backgroundColor: colors.surfaceElevated, borderRadius: radius.container, overflow: 'hidden' },+ // Raised surface: a 1px border carries the layer on the light ivory page (mobile guide §2).+ group: { backgroundColor: colors.surfaceElevated, borderRadius: radius.container, borderWidth: StyleSheet.hairlineWidth, borderColor: colors.border, overflow: 'hidden' },field: { gap: spacing.sm },select: { flexDirection: 'row', alignItems: 'center', gap: spacing.md },selectText: { flex: 1, fontSize: typeScale.body, lineHeight: lineHeight.body, color: colors.textPrimary },diff --git a/apps/mobile/src/session/CompanionTaskResultCard.tsx b/apps/mobile/src/session/CompanionTaskResultCard.tsxindex 91ea52daf4..7c2f1a45af 100644--- a/apps/mobile/src/session/CompanionTaskResultCard.tsx+++ b/apps/mobile/src/session/CompanionTaskResultCard.tsx@@ -1,13 +1,13 @@import { useContext, useEffect, useMemo, useState, type ReactNode } from 'react';import { Pressable, View, StyleSheet } from 'react-native';-import { useRouter } from 'expo-router';import { useTranslation } from 'react-i18next';import { FileText } from 'lucide-react-native';import type { BotCollaborationMeta } from '@cindy/maker-shared/botCollaboration';import { Text } from '@/components/AppText';import { mobileInteractionStyles } from '@/components/mobileInteractionStyles';+import { useGuardedPush } from '@/utils/useGuardedPush';import { useTheme, useThemedStyles, type ThemeColors } from '@/theme';-import { iconSize, lineHeight, radius, spacing, typeScale } from '@/theme/tokens';+import { fontWeight, iconSize, lineHeight, radius, spacing, typeScale } from '@/theme/tokens';import { ChatFilePathContext, type ChatFilePathContextValue, type ChatFilePathTarget } from '@/session/chatFilePathContext';import { useDeviceLink } from '@/device-link/DeviceLinkContext';import type { RemotePathStatResult } from '@/device-link/mobileMakerTransport';@@ -29,7 +29,7 @@ function ResultFileAction({deviceId: string;}) {const { openLink, invoke } = useDeviceLink();- const router = useRouter();+ const push = useGuardedPush();const { colors } = useTheme();const styles = useThemedStyles(makeStyles);const [cacheGen, setCacheGen] = useState(0);@@ -56,7 +56,7 @@ function ResultFileAction({{icon}<Text selectable numberOfLines={1} style={[styles.fileLabel, styles.pending]}>{label}</Text></View>;return <Pressable accessibilityRole="link" style={({ pressed }) => [styles.file, pressed && mobileInteractionStyles.pressed]}- onPress={() => router.push({ pathname: '/files/preview/[sessionId]', params: {+ onPress={() => push({ pathname: '/files/preview/[sessionId]', params: {sessionId: childSessionId, deviceId, absPath,} })}>{icon}<Text numberOfLines={1} style={[styles.fileLabel, styles.link]}>{label}</Text>@@ -67,7 +67,7 @@ function ResultFileAction({function useResultFileContext(deviceId: string, childSessionId: string | null | undefined, workdir: string | undefined) {const parent = useContext(ChatFilePathContext);const { openLink, invoke } = useDeviceLink();- const router = useRouter();+ const push = useGuardedPush();return useMemo<ChatFilePathContextValue | null>(() => {if (!deviceId || !childSessionId || !workdir) return null;return {@@ -81,10 +81,10 @@ function useResultFileContext(deviceId: string, childSessionId: string | null |onOpenPath: (target) => {if (target.kind === 'directory') {if (target.relPath === null) return;- router.push({ pathname: '/files/[sessionId]', params: { sessionId: childSessionId, deviceId, relPath: target.relPath } });+ push({ pathname: '/files/[sessionId]', params: { sessionId: childSessionId, deviceId, relPath: target.relPath } });return;}- router.push({ pathname: '/files/preview/[sessionId]', params: {+ push({ pathname: '/files/preview/[sessionId]', params: {sessionId: childSessionId, deviceId,...(target.relPath !== null ? { relPath: target.relPath } : { absPath: target.absPath }),...(target.line !== undefined ? { line: String(target.line) } : {}),@@ -95,7 +95,7 @@ function useResultFileContext(deviceId: string, childSessionId: string | null |onLongPressPath: (target: ChatFilePathTarget) => parent.onLongPressPath?.({ ...target, scope: { sessionId: childSessionId, workdir } }),} : {}),};- }, [childSessionId, deviceId, invoke, openLink, parent, router, workdir]);+ }, [childSessionId, deviceId, invoke, openLink, parent, push, workdir]);}/** A frozen execution receipt (Desktop BotSessionTaskResultCard); expanding never restarts or fetches the task. */@@ -145,7 +145,8 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({card: { marginVertical: spacing.sm, borderWidth: StyleSheet.hairlineWidth, borderColor: colors.border,backgroundColor: colors.surfaceElevated, borderRadius: radius.container, overflow: 'hidden' },summary: { minHeight: 44, flexDirection: 'row', alignItems: 'center', gap: spacing.sm, paddingHorizontal: spacing.md, paddingVertical: spacing.sm },- title: { flex: 1, minWidth: 0, fontSize: typeScale.body, lineHeight: lineHeight.body, color: colors.textPrimary },+ // §3 row/card title role: 16/22 medium.+ title: { flex: 1, minWidth: 0, fontSize: typeScale.body, lineHeight: lineHeight.body, fontWeight: fontWeight.medium, color: colors.textPrimary },secondary: { flexShrink: 0, fontSize: typeScale.footnote, lineHeight: lineHeight.caption, color: colors.textSecondary },view: { flexShrink: 0, fontSize: typeScale.footnote, lineHeight: lineHeight.caption, color: colors.textPrimary },body: { fontSize: typeScale.body, lineHeight: lineHeight.body, color: colors.textPrimary },diff --git a/apps/mobile/src/session/ComposerAttachmentTray.tsx b/apps/mobile/src/session/ComposerAttachmentTray.tsxindex 01f10efbbe..fb90fe55ff 100644--- a/apps/mobile/src/session/ComposerAttachmentTray.tsx+++ b/apps/mobile/src/session/ComposerAttachmentTray.tsx@@ -18,7 +18,6 @@ import { Text } from '@/components/AppText';import type { RemoteSerializedAttachment } from '@/session/types';import type { PendingLocalAttachmentUpload } from '@/session/mobileLocalAttachmentUpload';import { attachmentDisplayLabel, pendingUploadDisplayLabel } from '@/session/attachments';-import { ANNOTATION_OUTLINE_COLOR, ANNOTATION_STROKE_COLOR } from '@/session/imageAnnotationModel';import { fontWeight, iconSize, iconStroke, lineHeight, radius, spacing, typeScale, useTheme, useThemedStyles, type ThemeColors } from '@/theme';/** 输入卡内的缩略图为正方形(产品决策,不用横长方)。 */@@ -82,10 +81,11 @@ export function ComposerAttachmentTray({<Image contentFit="cover" source={{ uri: preview }} style={styles.thumbImage} transition={0} />{attachment.annotated ? (// 圈点标注角标:提示这张是带手绘标注的烧录图,点开可继续编辑/撤销。- // 微徽标几何(designTokenDiscipline 登记);icon 用标注体系描边白,- // 恒红底上跨主题恒定,与桌面标注视觉同族。+ // 微徽标几何(designTokenDiscipline 登记)。输入框 chrome 不在 Lightbox 标注+ // 豁免内:底色走徽标红 statusError,画笔走恒白前景 swipeActionText+ // (ctaText 在深色模式反相为近黑,不适合恒红底)。<View style={styles.thumbAnnotatedBadge} testID={`${testIDPrefix}.attachmentAnnotatedBadge`}>- <Pen color={ANNOTATION_OUTLINE_COLOR} size={10} strokeWidth={2.5} />+ <Pen color={colors.swipeActionText} size={10} strokeWidth={2.5} /></View>) : null}</Pressable>@@ -327,10 +327,10 @@ function makeTrayStyles(colors: ThemeColors) {lineHeight: lineHeight.micro,fontWeight: fontWeight.semibold,},- // 标注角标:左下角红底画笔(标注红为语义豁免色,跨主题恒定,引语义常量)。+ // 标注角标:左下角红底画笔(状态指示徽标红,跨主题恒定)。thumbAnnotatedBadge: {alignItems: 'center' as const,- backgroundColor: ANNOTATION_STROKE_COLOR,+ backgroundColor: colors.statusError,borderRadius: radius.pill,bottom: 4,height: 18,diff --git a/apps/mobile/src/session/ComposerDockKeyboardFollow.tsx b/apps/mobile/src/session/ComposerDockKeyboardFollow.tsxnew file mode 100644index 0000000000..cbafd11b4a--- /dev/null+++ b/apps/mobile/src/session/ComposerDockKeyboardFollow.tsx@@ -0,0 +1,46 @@+import type { ComponentProps, ReactNode } from 'react';+import { Platform, View } from 'react-native';+import Reanimated, { useAnimatedKeyboard, useAnimatedStyle } from 'react-native-reanimated';++/**+ * iOS existing task / partner chat: the composer and+ * the message viewport follow the keyboard on the UI thread every frame,+ * instead of jumping to the end position when the keyboard event arrives+ * (RN LayoutAnimation does not run for these views in this build).+ *+ * The composer bottom is max(restingBottom, keyboard + gap): it stays at the+ * new-task button's edge until the keyboard reaches it, then rides with a fixed+ * gap. Only iOS mounts the keyboard tracker; the choice is a platform+ * constant, so hooks never change between renders and toggling `active`+ * never remounts the composer.+ */+const TRACKS = Platform.OS === 'ios';++type ViewProps = ComponentProps<typeof View>;++/** Lifts its subtree by transform (no per-frame layout for the composer). */+export function DockKeyboardLift({ active, restingBottom, keyboardGap, style, children, ...props }: ViewProps & {+ active: boolean; restingBottom: number; keyboardGap: number; children?: ReactNode;+}) {+ if (!TRACKS) return <View {...props} style={style}>{children}</View>;+ return <TrackingLift {...props} active={active} restingBottom={restingBottom} keyboardGap={keyboardGap} style={style}>{children}</TrackingLift>;+}+function TrackingLift({ active, restingBottom, keyboardGap, style, children, ...props }: ViewProps & {+ active: boolean; restingBottom: number; keyboardGap: number; children?: ReactNode;+}) {+ const keyboard = useAnimatedKeyboard();+ const lift = useAnimatedStyle(() => ({+ transform: [{ translateY: active ? -Math.max(0, keyboard.height.value + keyboardGap - restingBottom) : 0 }],+ }), [active, keyboardGap, restingBottom]);+ return <Reanimated.View {...props} style={[style, lift]}>{children}</Reanimated.View>;+}++/** Shrinks the message viewport with the keyboard, in step with the lift above. */+export function DockKeyboardViewportSpacer({ active }: { active: boolean }) {+ return TRACKS ? <TrackingSpacer active={active} /> : null;+}+function TrackingSpacer({ active }: { active: boolean }) {+ const keyboard = useAnimatedKeyboard();+ const style = useAnimatedStyle(() => ({ height: active ? keyboard.height.value : 0 }), [active]);+ return <Reanimated.View pointerEvents="none" style={style} />;+}diff --git a/apps/mobile/src/session/ComposerDockKeyboardSpacer.tsx b/apps/mobile/src/session/ComposerDockKeyboardSpacer.tsxnew file mode 100644index 0000000000..fbe2e9dac9--- /dev/null+++ b/apps/mobile/src/session/ComposerDockKeyboardSpacer.tsx@@ -0,0 +1,14 @@+import Reanimated, { useAnimatedKeyboard, useAnimatedStyle } from 'react-native-reanimated';++/**+ * iOS new task: the space under the composer, tracked on the UI+ * thread every keyboard frame. The composer stays at the new-task button's bottom edge+ * until the keyboard reaches it, then rides the keyboard with a fixed gap,+ * instead of jumping to its final place when the keyboard event arrives.+ * Mounted only on the iOS composer dock; other layouts keep the shared keyboard state.+ */+export function ComposerDockKeyboardSpacer({ restingBottom, keyboardGap }: { restingBottom: number; keyboardGap: number }) {+ const keyboard = useAnimatedKeyboard();+ const style = useAnimatedStyle(() => ({ height: Math.max(restingBottom, keyboard.height.value + keyboardGap) }));+ return <Reanimated.View pointerEvents="none" style={style} />;+}diff --git a/apps/mobile/src/session/ComposerFrame.ios.tsx b/apps/mobile/src/session/ComposerFrame.ios.tsxindex 2b429b32e5..37c44eb7d2 100644--- a/apps/mobile/src/session/ComposerFrame.ios.tsx+++ b/apps/mobile/src/session/ComposerFrame.ios.tsx@@ -2,13 +2,20 @@ import { GlassView, isLiquidGlassAvailable } from 'expo-glass-effect';import { View } from 'react-native';import { useTheme } from '@/theme';import type { ComposerFrameProps } from './ComposerFrame';+import { requireNativeView, requireOptionalNativeModule } from 'expo';+import { StyleSheet } from 'react-native';+import { composerGeometry } from './composerGeometry';++const MorphTarget = requireOptionalNativeModule('CindyTabBar') ? requireNativeView<{+ transitionId: string; expandToken: string; cornerRadius: number; onComplete(): void; style: object; pointerEvents: 'none';+}>('CindyTabBar', 'CindyComposerMorphTarget') : null;export const nativeComposerFrameAvailable = isLiquidGlassAvailable();/** UIKit glass contains the controls directly, preserving UITextView touch/focus routing. */-export function ComposerFrame({ expanded: _expanded, unframed, style, ...contentProps }: ComposerFrameProps) {+export function ComposerFrame({ expanded: _expanded, unframed, style, children, entryTransitionId, onEntryTransitionComplete, expandToken, ...contentProps }: ComposerFrameProps) {const { mode } = useTheme();- if (unframed || !nativeComposerFrameAvailable) return <View {...contentProps} style={style} />;+ if (unframed || !nativeComposerFrameAvailable) return <View {...contentProps} style={style}>{children}</View>;return (<GlassView{...contentProps}@@ -16,7 +23,13 @@ export function ComposerFrame({ expanded: _expanded, unframed, style, ...contentglassEffectStyle="regular"isInteractive={false}// Native glass geometry matches the existing expanded composer contour.- style={[style, { borderRadius: 30 }]}- />+ style={[style, { borderRadius: composerGeometry.cornerRadius }]}+ >+ {children}+ {(entryTransitionId || expandToken != null) && MorphTarget ? <MorphTarget transitionId={entryTransitionId ?? ''}+ expandToken={expandToken ?? ''}+ cornerRadius={composerGeometry.cornerRadius}+ onComplete={() => onEntryTransitionComplete?.()} pointerEvents="none" style={StyleSheet.absoluteFill} /> : null}+ </GlassView>);}diff --git a/apps/mobile/src/session/ComposerFrame.tsx b/apps/mobile/src/session/ComposerFrame.tsxindex de55c2ce0e..0106a8bf65 100644--- a/apps/mobile/src/session/ComposerFrame.tsx+++ b/apps/mobile/src/session/ComposerFrame.tsx@@ -4,10 +4,14 @@ export interface ComposerFrameProps extends ViewProps {expanded: boolean;/** An ancestor already owns the surface; retain only the content layout. */unframed?: boolean;+ entryTransitionId?: string;+ onEntryTransitionComplete?(): void;+ /** Changes when the compact pill opens; the native frame animates that growth. */+ expandToken?: string;}export const nativeComposerFrameAvailable = false;-export function ComposerFrame({ expanded: _expanded, unframed: _unframed, ...props }: ComposerFrameProps) {+export function ComposerFrame({ expanded: _expanded, unframed: _unframed, entryTransitionId: _entry, onEntryTransitionComplete: _complete, expandToken: _expand, ...props }: ComposerFrameProps) {return <View {...props} />;}diff --git a/apps/mobile/src/session/ComposerMorphSource.ios.tsx b/apps/mobile/src/session/ComposerMorphSource.ios.tsxnew file mode 100644index 0000000000..eff5c65453--- /dev/null+++ b/apps/mobile/src/session/ComposerMorphSource.ios.tsx@@ -0,0 +1,29 @@+import { requireNativeView, requireOptionalNativeModule } from 'expo';+import { useCallback, useRef, type ReactNode } from 'react';+import { View, type StyleProp, type ViewStyle } from 'react-native';+import type { ComposerMorphOrigin } from './composerGeometry';+import { rememberComposerGeometry } from './composerMorph';++type NativeProps = {+ actionDisabled: boolean; style?: StyleProp<ViewStyle>; children?: ReactNode;+ onAction(event: { nativeEvent: { origin?: ComposerMorphOrigin } }): void;+ onGeometry(event: { nativeEvent: ComposerMorphOrigin }): void;+};+const NativeSource = requireOptionalNativeModule('CindyTabBar')+ ? requireNativeView<NativeProps>('CindyTabBar', 'CindyComposerMorphSource') : null;++/**+ * Hosts the floating new-task button. Native takes the touch: the circle starts+ * stretching into the composer pill on touch-down, opens on touch-up inside and+ * springs back on a slide-off. `onAction` receives the handoff origin; the+ * button's own onPress stays for VoiceOver activation (no morph).+ */+export function ComposerMorphSource({ disabled, onAction, style, children }: {+ disabled: boolean; onAction(origin?: ComposerMorphOrigin): void; style?: StyleProp<ViewStyle>; children: ReactNode;+}) {+ const action = useRef(onAction); action.current = onAction;+ const handleAction = useCallback((event: { nativeEvent: { origin?: ComposerMorphOrigin } }) => action.current(event.nativeEvent.origin), []);+ const handleGeometry = useCallback((event: { nativeEvent: ComposerMorphOrigin }) => rememberComposerGeometry(event.nativeEvent), []);+ if (!NativeSource) return <View style={style}>{children}</View>;+ return <NativeSource actionDisabled={disabled} onAction={handleAction} onGeometry={handleGeometry} style={style}>{children}</NativeSource>;+}diff --git a/apps/mobile/src/session/ComposerMorphSource.tsx b/apps/mobile/src/session/ComposerMorphSource.tsxnew file mode 100644index 0000000000..21c10a3a58--- /dev/null+++ b/apps/mobile/src/session/ComposerMorphSource.tsx@@ -0,0 +1,10 @@+import type { ReactNode } from 'react';+import { View, type StyleProp, type ViewStyle } from 'react-native';+import type { ComposerMorphOrigin } from './composerGeometry';++/** Non-iOS: no native morph; the button's own onPress opens the page. */+export function ComposerMorphSource({ style, children }: {+ disabled: boolean; onAction(origin?: ComposerMorphOrigin): void; style?: StyleProp<ViewStyle>; children: ReactNode;+}) {+ return <View style={style}>{children}</View>;+}diff --git a/apps/mobile/src/session/ContextSheet.tsx b/apps/mobile/src/session/ContextSheet.tsxindex 8e8a8de930..8606ee1846 100644--- a/apps/mobile/src/session/ContextSheet.tsx+++ b/apps/mobile/src/session/ContextSheet.tsx@@ -19,11 +19,13 @@ import {useWindowDimensions,} from 'react-native';import { Text } from '@/components/AppText';+import { MainWindowActionButton } from '@/components/MobilePrimitives';+import { mobileInteractionStyles } from '@/components/mobileInteractionStyles';import { useSafeAreaInsets } from 'react-native-safe-area-context';import { computeContextSheetSnapHeights, type ContextSheetSnap } from '@/session/contextSheetModel';import { SheetModal } from '@/session/SheetModal';import { SheetSurface } from '@/session/SheetSurface';-import { fontWeight, iconSize, iconStroke, lineHeight, radius, spacing, typeScale, useTheme, useThemedStyles, type ThemeColors } from '@/theme';+import { fontWeight, iconSize, iconStroke, lineHeight, spacing, typeScale, useTheme, useThemedStyles, type ThemeColors } from '@/theme';export interface ContextSheetProps {visible: boolean;@@ -54,7 +56,6 @@ export function ContextSheet({testID,}: ContextSheetProps) {const styles = useThemedStyles(makeContextSheetStyles);- const { colors } = useTheme();const { t } = useTranslation();const { height: windowHeight } = useWindowDimensions();const insets = useSafeAreaInsets();@@ -97,7 +98,7 @@ export function ContextSheet({>{media}{children}- {error ? <Text style={{ color: colors.errorText }}>{error}</Text> : null}+ {error ? <Text style={styles.errorText}>{error}</Text> : null}</SheetSurface></SheetModal>);@@ -197,7 +198,7 @@ export interface ContextSheetFooterButtonProps {testID?: string;}-/** footer 槽用的主操作按钮(黑底 pill,对照 Cursor「Add N」)。 */+/** footer 槽用的主操作按钮:共享主按钮(cta 实心 pill;加载只转圈)。 */export function ContextSheetFooterButton({label,onPress,@@ -205,28 +206,10 @@ export function ContextSheetFooterButton({disabled,testID,}: ContextSheetFooterButtonProps) {- const styles = useThemedStyles(makeContextSheetStyles);- const { colors } = useTheme();return (- <Pressable- accessibilityLabel={label}- accessibilityRole="button"- accessibilityState={{ disabled: disabled || busy }}- disabled={disabled || busy}- onPress={onPress}- style={({ pressed }) => [- styles.footerButton,- disabled && styles.footerButtonDisabled,- pressed && styles.footerButtonPressed,- ]}- testID={testID}- >- {busy ? (- <ActivityIndicator color={colors.ctaText} size="small" />- ) : (- <Text style={styles.footerButtonLabel}>{label}</Text>- )}- </Pressable>+ <MainWindowActionButton+ action={{ busy, disabled, label, onPress, testID, tone: 'primary' }}+ />);}@@ -236,24 +219,12 @@ function makeContextSheetStyles(colors: ThemeColors) {return {// Modal 外壳样式(背板/内容层/键盘规避)已随 SheetModal 抽出;// sheet 表面样式(sheet/dragZone/grabber/header/滚动区/footer 容器)已随 SheetSurface 抽出。- footerButton: {- alignItems: 'center' as const,- backgroundColor: colors.cta,- borderRadius: radius.pill,- height: 50,- justifyContent: 'center' as const,- },- footerButtonDisabled: {- opacity: 0.4,- },- footerButtonPressed: {- opacity: 0.7,- },- footerButtonLabel: {- color: colors.ctaText,- fontSize: typeScale.body,- lineHeight: lineHeight.body,- fontWeight: fontWeight.medium,+ // 说明、提示、报错(成句的话):footnote 13/18 400。+ errorText: {+ color: colors.errorText,+ fontSize: typeScale.footnote,+ lineHeight: lineHeight.caption,+ fontWeight: fontWeight.regular,},group: {paddingTop: spacing.lg,@@ -273,9 +244,7 @@ function makeContextSheetStyles(colors: ThemeColors) {minHeight: ROW_HEIGHT,justifyContent: 'space-between' as const,},- rowPressed: {- opacity: 0.6,- },+ rowPressed: mobileInteractionStyles.pressed,rowDisabled: {opacity: 0.4,},diff --git a/apps/mobile/src/session/ContextSheetGoalView.ios.tsx b/apps/mobile/src/session/ContextSheetGoalView.ios.tsxindex e68e7673b4..38cc2f5ac5 100644--- a/apps/mobile/src/session/ContextSheetGoalView.ios.tsx+++ b/apps/mobile/src/session/ContextSheetGoalView.ios.tsx@@ -84,7 +84,7 @@ export function ContextSheetGoalView(props: ContextSheetGoalViewProps) {const action = (label: string, onPress: () => void, testID: string, destructive = false) =><Button onPress={onPress} testID={testID} modifiers={[buttonStyle('plain'), disable(busy),- ...(destructive ? [foregroundStyle(colors.statusRecording)] : []),+ ...(destructive ? [foregroundStyle(colors.destructive)] : []),]}><Text modifiers={[frame({ maxWidth: Infinity, minHeight: 44, alignment: 'leading' }), contentShape(shapes.rectangle())]}>{label}</Text></Button>;return <><Section title={goalStatusLabel(goal.status, goal.lastReason)}>diff --git a/apps/mobile/src/session/ContextSheetGoalView.tsx b/apps/mobile/src/session/ContextSheetGoalView.tsxindex 13bc8acaa6..8b04b79f03 100644--- a/apps/mobile/src/session/ContextSheetGoalView.tsx+++ b/apps/mobile/src/session/ContextSheetGoalView.tsx@@ -12,12 +12,13 @@ import { useState } from 'react';import { useTranslation } from 'react-i18next';import { ChevronDown, ChevronRight } from 'lucide-react-native';import {- ActivityIndicator,Pressable,StyleSheet,View,} from 'react-native';import { Text, TextInput } from '@/components/AppText';+import { MainWindowActionButton, MainWindowOptionButton } from '@/components/MobilePrimitives';+import { mobileInteractionStyles } from '@/components/mobileInteractionStyles';import type {MobileGoalLimitsInput,MobileGoalStatus,@@ -207,26 +208,18 @@ export function ContextSheetGoalCreateForm({</>) : null}{error ? <Text style={styles.errorText}>{error}</Text> : null}- <Pressable- accessibilityHint={disabled ? disabledHint : undefined}- accessibilityLabel={t('interaction.contextSheet.startGoal')}- accessibilityRole="button"- accessibilityState={{ disabled: busy || disabled || !objective.trim() }}- disabled={busy || disabled || !objective.trim()}- onPress={submit}- style={({ pressed }) => [- styles.ctaButton,- (busy || disabled || !objective.trim()) && styles.ctaButtonDisabled,- pressed && styles.pressed,- ]}- testID="contextSheet.goalStartButton"- >- {busy ? (- <ActivityIndicator color={colors.ctaText} size="small" />- ) : (- <Text style={styles.ctaLabel}>{t('interaction.contextSheet.startGoal')}</Text>- )}- </Pressable>+ <MainWindowActionButton+ action={{+ accessibilityHint: disabled ? disabledHint : undefined,+ busy,+ disabled: disabled || !objective.trim(),+ label: t('interaction.contextSheet.startGoal'),+ onPress: submit,+ testID: 'contextSheet.goalStartButton',+ tone: 'primary',+ }}+ style={styles.ctaButton}+ /></View>);}@@ -249,7 +242,6 @@ function GoalStatusView({testID?: string;}) {const styles = useThemedStyles(makeGoalStyles);- const { colors } = useTheme();const { t } = useTranslation();const canPause = goal.status === 'active';const canResume = goal.status === 'paused' || goal.status === 'blocked' || goal.status === 'usageLimited';@@ -282,47 +274,41 @@ function GoalStatusView({) : null}<GoalActionButtonbusy={busy}+ destructivelabel={t('interaction.contextSheet.clearGoal')}onPress={onClearGoal}testID="contextSheet.goalClearButton"- textColor={colors.statusRecording}/></View></View>);}+/** 状态视图的次要 / 破坏性操作:共享按钮(破坏性走 danger 档 destructive 字色)。 */function GoalActionButton({busy,+ destructive = false,label,onPress,testID,- textColor,}: {busy: boolean;+ destructive?: boolean;label: string;onPress: () => void;testID?: string;- textColor?: string;}) {- const styles = useThemedStyles(makeGoalStyles);+ // busy 期间只禁用、不在每个按钮上转圈:状态视图没有「哪个按钮在忙」的归属信息。return (- <Pressable- accessibilityLabel={label}- accessibilityRole="button"- accessibilityState={{ disabled: busy }}- disabled={busy}- onPress={onPress}- style={({ pressed }) => [styles.actionButton, pressed && styles.pressed, busy && styles.ctaButtonDisabled]}- testID={testID}- >- <Text style={[styles.actionButtonText, textColor ? { color: textColor } : null]}>{label}</Text>- </Pressable>+ <MainWindowActionButton+ action={{ disabled: busy, label, onPress, testID, tone: destructive ? 'danger' : 'secondary' }}+ grow+ />);}/**- * 单项上限的 pill 单选组(预设 + 「不限」)。手机端用 pill 组替代桌面的下拉——+ * 单项上限的 pill 单选组(预设 + 「不限」),选项复用共享 MainWindowOptionButton(选中只换色)。手机端用 pill 组替代桌面的下拉——* bottom sheet 里嵌套下拉手感差;当前值不在预设里(历史自定义)时前置保留(对齐桌面)。*/function LimitOptionsRow({@@ -348,7 +334,7 @@ function LimitOptionsRow({return (<View style={styles.limitOptionsRow} testID={testID}><Text style={styles.limitLabel}>{label}</Text>- <View style={styles.limitPillRow}>+ <View accessibilityLabel={label} accessibilityRole="radiogroup" style={styles.limitPillRow}>{options.map((preset) => (<LimitPilldisabled={disabled}@@ -380,22 +366,16 @@ function LimitPill({onPress: () => void;disabled?: boolean;}) {- const styles = useThemedStyles(makeGoalStyles);+ // 单选预设不切换视图,语义是 radio 而非 tab;命中区由共享组件 hitSlop 补足 44pt。return (- <Pressable- accessibilityLabel={label}- accessibilityRole="button"- accessibilityState={{ disabled, selected }}+ <MainWindowOptionButton+ accessibilityRole="radio"+ accessibilityState={{ checked: selected }}disabled={disabled}+ label={label}onPress={onPress}- style={({ pressed }) => [- styles.limitPill,- selected && styles.limitPillSelected,- pressed && styles.pressed,- ]}- >- <Text style={[styles.limitPillText, selected && styles.limitPillTextSelected]}>{label}</Text>- </Pressable>+ selected={selected}+ />);}@@ -454,26 +434,6 @@ function makeGoalStyles(colors: ThemeColors) {gap: spacing.sm,paddingTop: spacing.sm,},- limitPill: {- alignItems: 'center' as const,- backgroundColor: colors.surfaceChip,- borderRadius: radius.pill,- height: 30,- justifyContent: 'center' as const,- paddingHorizontal: spacing.md,- },- limitPillSelected: {- backgroundColor: colors.cta,- },- limitPillText: {- color: colors.textPrimary,- fontSize: typeScale.footnote,- lineHeight: lineHeight.caption,- fontWeight: fontWeight.medium,- },- limitPillTextSelected: {- color: colors.ctaText,- },hintText: {color: colors.textTertiary,fontSize: typeScale.footnote,@@ -487,25 +447,9 @@ function makeGoalStyles(colors: ThemeColors) {paddingTop: spacing.md,},ctaButton: {- alignItems: 'center' as const,- backgroundColor: colors.cta,- borderRadius: radius.pill,- height: 50,- justifyContent: 'center' as const,marginTop: spacing.xl,},- ctaButtonDisabled: {- opacity: 0.4,- },- ctaLabel: {- color: colors.ctaText,- fontSize: typeScale.body,- lineHeight: lineHeight.body,- fontWeight: fontWeight.medium,- },- pressed: {- opacity: 0.7,- },+ pressed: mobileInteractionStyles.pressed,statusHeader: {alignItems: 'center' as const,flexDirection: 'row' as const,@@ -546,19 +490,5 @@ function makeGoalStyles(colors: ThemeColors) {gap: spacing.md,paddingTop: spacing.xl,},- actionButton: {- alignItems: 'center' as const,- backgroundColor: colors.surfaceChip,- borderRadius: radius.pill,- flex: 1,- height: 44,- justifyContent: 'center' as const,- },- actionButtonText: {- color: colors.textPrimary,- fontSize: typeScale.footnote,- lineHeight: lineHeight.caption,- fontWeight: fontWeight.medium,- },};}diff --git a/apps/mobile/src/session/ConversationSearchFilterSheet.tsx b/apps/mobile/src/session/ConversationSearchFilterSheet.tsxindex d22801592d..931610f631 100644--- a/apps/mobile/src/session/ConversationSearchFilterSheet.tsx+++ b/apps/mobile/src/session/ConversationSearchFilterSheet.tsx@@ -9,6 +9,7 @@ import { useTranslation } from 'react-i18next';import { Text } from '@/components/AppText';import { HomeGlassMenuPanel, HomeMenuScrim } from '@/session/HomeGlassMenuPanel';import { useModalFadeLifecycle } from '@/session/useModalFadeLifecycle';+import { useHomeMenuFadeTiming } from '@/session/homeMenuFadeTiming';import {nextConversationSearchProjectSelection,type ConversationSearchProjectOption,@@ -70,9 +71,9 @@ export function ConversationSearchFilterSheet({const { height: screenHeight } = useWindowDimensions();const insets = useSafeAreaInsets();const scrollMaxHeight = Math.max(200, screenHeight - topOffset - insets.bottom - 24);+ const menuFadeTiming = useHomeMenuFadeTiming();const { mounted, progress, onShowStartIn } = useModalFadeLifecycle(visible, {- inMs: 140,- outMs: 110,+ ...menuFadeTiming,});const selectedProjects = projectSelection === 'all' ? null : new Set(projectSelection);const showProjectDevice = new Set(projects.map((project) => project.deviceId)).size > 1;diff --git a/apps/mobile/src/session/FailedScheduleNotice.tsx b/apps/mobile/src/session/FailedScheduleNotice.tsxindex 3f1fc5dceb..f95334e03d 100644--- a/apps/mobile/src/session/FailedScheduleNotice.tsx+++ b/apps/mobile/src/session/FailedScheduleNotice.tsx@@ -5,6 +5,7 @@ import { useEffect, useState } from 'react';import { Pressable, StyleSheet, View } from 'react-native';import { useTranslation } from 'react-i18next';import { Text } from '@/components/AppText';+import { mobileInteractionStyles } from '@/components/mobileInteractionStyles';import { useTheme, useThemedStyles, type ThemeColors } from '@/theme';import { iconSize, iconStroke, lineHeight, radius, spacing, typeScale } from '@/theme/tokens';@@ -51,5 +52,5 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({borderWidth: StyleSheet.hairlineWidth, borderRadius: radius.container },text: { flex: 1, color: colors.errorText, fontSize: typeScale.footnote, lineHeight: lineHeight.caption, paddingVertical: spacing.sm },close: { width: 44, height: 44, alignItems: 'center', justifyContent: 'center', borderRadius: radius.pill },- pressed: { opacity: 0.7 },+ pressed: mobileInteractionStyles.pressed,});diff --git a/apps/mobile/src/session/FileBrowserSegmentedControl.tsx b/apps/mobile/src/session/FileBrowserSegmentedControl.tsxnew file mode 100644index 0000000000..e01a38d608--- /dev/null+++ b/apps/mobile/src/session/FileBrowserSegmentedControl.tsx@@ -0,0 +1,89 @@+import SegmentedControl from '@expo/ui/community/segmented-control';+import { Platform, StyleSheet, View, type StyleProp, type ViewStyle } from 'react-native';+import { MainWindowOptionButton } from '@/components/MobilePrimitives';+import { useTheme, useThemedStyles, type ThemeColors } from '@/theme';+import { radius, spacing } from '@/theme/tokens';++export interface FileBrowserSegmentOption<T extends string> {+ value: T;+ label: string;+ accessibilityLabel?: string;+ testID?: string;+}++/**+ * 文件浏览 / 预览页的二选一切换(搜索范围、渲染 / 源码)。+ * 与远程桌面同一平台惯例:iOS 用系统分段控件,其它端用共享分段选项+ * (胶囊外框 + tab 角色 + 选中态,选中只换色不加粗)。两端命中高度都是 44。+ */+export function FileBrowserSegmentedControl<T extends string>({+ accessibilityLabel,+ onChange,+ options,+ style,+ testID,+ value,+}: {+ accessibilityLabel: string;+ onChange(next: T): void;+ options: readonly FileBrowserSegmentOption<T>[];+ style?: StyleProp<ViewStyle>;+ testID?: string;+ value: T;+}) {+ const styles = useThemedStyles(makeStyles);+ const { mode } = useTheme();+ const selectedIndex = options.findIndex((option) => option.value === value);++ if (Platform.OS === 'ios') {+ return (+ <View accessibilityLabel={accessibilityLabel} style={style} testID={testID}>+ <SegmentedControl+ appearance={mode}+ onChange={({ nativeEvent }) => {+ const next = options[nativeEvent.selectedSegmentIndex];+ if (next && next.value !== value) onChange(next.value);+ }}+ selectedIndex={selectedIndex}+ style={styles.native}+ values={options.map((option) => option.label)}+ />+ </View>+ );+ }++ return (+ <View+ accessibilityLabel={accessibilityLabel}+ accessibilityRole="tablist"+ style={[styles.track, style]}+ testID={testID}+ >+ {options.map((option) => (+ <MainWindowOptionButton+ accessibilityLabel={option.accessibilityLabel ?? option.label}+ accessibilityRole="tab"+ density="default"+ key={option.value}+ label={option.label}+ onPress={() => onChange(option.value)}+ selected={option.value === value}+ style={styles.option}+ testID={option.testID}+ variant="segmented"+ />+ ))}+ </View>+ );+}++const makeStyles = (colors: ThemeColors) => StyleSheet.create({+ native: { height: 44 },+ track: {+ backgroundColor: colors.surfaceChip,+ borderRadius: radius.pill,+ flexDirection: 'row',+ padding: spacing.xs,+ },+ option: { flex: 1, minHeight: 44 },+});diff --git a/apps/mobile/src/session/HomeChromeDrawer.tsx b/apps/mobile/src/session/HomeChromeDrawer.tsxindex b24d3c449d..609169ab7d 100644--- a/apps/mobile/src/session/HomeChromeDrawer.tsx+++ b/apps/mobile/src/session/HomeChromeDrawer.tsx@@ -8,10 +8,11 @@* 新窗口里要自带 GestureHandlerRootView,左滑关闭才有效。* Android 无系统顶栏,继续树内 overlay。动画遵循 reduce-motion。*/-import { LogOut, Monitor, Search, Settings, UsersRound } from 'lucide-react-native';+import { Building2, LogOut, Monitor, Search, Settings, UsersRound } from 'lucide-react-native';import { useCallback, useEffect, useMemo, useRef, useState } from 'react';import {AccessibilityInfo,+ ActivityIndicator,BackHandler,findNodeHandle,Image,@@ -22,8 +23,10 @@ import {useWindowDimensions,} from "react-native";import Animated, {+ cancelAnimation,Easing,runOnJS,+ runOnUI,useAnimatedStyle,useSharedValue,withTiming,@@ -32,6 +35,8 @@ import { FullWindowOverlay } from "react-native-screens";import { useSafeAreaInsets } from "react-native-safe-area-context";import { useTranslation } from "react-i18next";import { Text } from "@/components/AppText";+import { mobileInteractionStyles } from "@/components/mobileInteractionStyles";+import { MobileUserAvatar } from "@/components/MobileUserAvatar";import {Gesture,GestureDetector,@@ -51,6 +56,7 @@ import {typeScale,} from "@/theme/tokens";+import { confirmLogout } from './confirmLogout';import { HomeModeSwitch } from './HomeModeSwitch';import type { HomeMode } from './homeViewPreferenceStore';@@ -69,6 +75,7 @@ export function HomeChromeDrawer({onOpenSharedSession,onOpenSettings,onLogout,+ hasRunningTasks = false,loggingOut = false,mode = 'tasks',onModeChange,@@ -84,7 +91,10 @@ export function HomeChromeDrawer({onOpenDevices(): void;onOpenSharedSession?(): void;onOpenSettings(): void;+ /** 确认后才调用:抽屉内部先弹 confirmLogout,调用方不要再重复确认。 */onLogout(): void;+ /** 退出确认文案用:有运行中任务时额外说明任务会继续在电脑上运行。 */+ hasRunningTasks?: boolean;loggingOut?: boolean;mode?: HomeMode;onModeChange?(mode: HomeMode): void;@@ -111,16 +121,18 @@ export function HomeChromeDrawer({);const [mounted, setMounted] = useState(open);- const mountedRef = useRef(mounted);- mountedRef.current = mounted;+ const [panelReady, setPanelReady] = useState(false);const openRef = useRef(open);openRef.current = open;- const progress = useSharedValue(open ? 1 : 0);- const dragX = useSharedValue(0);+ const progress = useSharedValue(0);+ const dragStartProgress = useSharedValue(0);+ const dragging = useSharedValue(false);+ const targetOpen = useSharedValue(open);const finishClose = useCallback(() => {if (openRef.current) return;setMounted(false);+ setPanelReady(false);}, []);const onClosedRef = useRef(onClosed);onClosedRef.current = onClosed;@@ -143,55 +155,36 @@ export function HomeChromeDrawer({}, [open]);useEffect(() => {- const animate = reduceMotion === false;- if (open) {+ if (open && !mounted) {setMounted(true);- const effective = Math.max(- 0,- Math.min(1, progress.value + dragX.value / panelWidth),- );- progress.value = effective;- dragX.value = 0;- progress.value = animate- ? withTiming(1, {- duration: motionDuration.enter,- easing: Easing.bezier(...motionEasing.out),- })- : 1;- return;- }- if (!mountedRef.current) return;- const effective = Math.max(- 0,- Math.min(1, progress.value + dragX.value / panelWidth),- );- progress.value = effective;- dragX.value = 0;- if (!animate || closeInstant) {- progress.value = 0;- finishClose();return;}- progress.value = withTiming(- 0,- {- duration: motionDuration.exit,- easing: Easing.bezier(...motionEasing.in),- },- (finished) => {- "worklet";- if (finished) runOnJS(finishClose)();- },- );- }, [- closeInstant,- dragX,- finishClose,- open,- panelWidth,- progress,- reduceMotion,- ]);+ if (!mounted) return;+ // Wait for FullWindowOverlay to lay out before starting the first frame.+ if (open && !panelReady) return;+ runOnUI((opening: boolean, animate: boolean, instant: boolean) => {+ "worklet";+ targetOpen.value = opening;+ cancelAnimation(progress);+ if (!animate || (!opening && instant)) {+ progress.value = opening ? 1 : 0;+ if (!opening) runOnJS(finishClose)();+ return;+ }+ progress.value = withTiming(+ opening ? 1 : 0,+ {+ duration: opening ? motionDuration.enter : motionDuration.exit,+ easing: opening+ ? Easing.bezier(...motionEasing.out)+ : Easing.bezier(...motionEasing.in),+ },+ (finished) => {+ if (finished && !opening) runOnJS(finishClose)();+ },+ );+ })(open, reduceMotion === false, closeInstant);+ }, [closeInstant, finishClose, mounted, open, panelReady, progress, reduceMotion, targetOpen]);useEffect(() => {if (!open) return;@@ -209,43 +202,57 @@ export function HomeChromeDrawer({const panGesture = useMemo(() =>Gesture.Pan()+ .enabled(open).activeOffsetX(-16).failOffsetX(16).failOffsetY([-16, 16])+ .onStart(() => {+ "worklet";+ cancelAnimation(progress);+ dragging.value = true;+ dragStartProgress.value = progress.value;+ }).onUpdate((event) => {"worklet";- dragX.value = Math.min(0, event.translationX);+ progress.value = Math.max(0, Math.min(1,+ dragStartProgress.value + event.translationX / panelWidth,+ ));}).onEnd((event) => {"worklet";const shouldClose =- event.translationX < -panelWidth * DRAWER_CLOSE_DISTANCE_RATIO ||+ progress.value < 1 - DRAWER_CLOSE_DISTANCE_RATIO ||event.velocityX < DRAWER_CLOSE_VELOCITY;if (shouldClose) {runOnJS(closeFromGesture)();} else {- dragX.value = withTiming(0, {+ progress.value = reduceMotion === false ? withTiming(1, {duration: motionDuration.fast,easing: Easing.bezier(...motionEasing.move),- });+ }) : 1;}+ })+ .onFinalize((_event, success) => {+ "worklet";+ const wasDragging = dragging.value;+ dragging.value = false;+ if (success || !wasDragging || !targetOpen.value) return;+ // Interrupted gestures must not strand the panel halfway open.+ progress.value = reduceMotion === false ? withTiming(1, {+ duration: motionDuration.fast,+ easing: Easing.bezier(...motionEasing.move),+ }) : 1;}),- [closeFromGesture, dragX, panelWidth],+ [closeFromGesture, dragging, dragStartProgress, open, panelWidth, progress, reduceMotion, targetOpen],);const scrimStyle = useAnimatedStyle(() => ({- opacity: Math.max(- 0,- Math.min(1, progress.value + dragX.value / panelWidth),- ),+ opacity: progress.value,}));const panelStyle = useAnimatedStyle(() => ({transform: [{- translateX: Math.max(- -panelWidth,- Math.min(0, (progress.value - 1) * panelWidth + dragX.value),- ),+ translateX: (progress.value - 1) * panelWidth,},],}));@@ -256,14 +263,12 @@ export function HomeChromeDrawer({const accountName = user?.name.trim() || user?.email?.trim() || t('settings.header.notSignedIn');const isOrg = user?.membershipKind === 'org';- const accountTitle = isOrg ? user?.orgName?.trim() || accountName : accountName;- const accountSubtitle = isOrg- ? accountName- : user?.email?.trim() && user.email.trim() !== accountName- ? user.email.trim()- : null;- const accountImage = isOrg ? user?.orgLogoUrl : user?.avatar;- const avatarLabel = (accountTitle.trim()[0] ?? '?').toUpperCase();+ const accountEmail = user?.email?.trim();+ const orgName = isOrg ? user?.orgName?.trim() : null;+ const requestLogout = () => {+ if (loggingOut) return;+ confirmLogout(t, hasRunningTasks, onLogout);+ };if (!mounted) return null;@@ -287,124 +292,137 @@ export function HomeChromeDrawer({<Animated.Viewstyle={[styles.panel,- {- paddingBottom: insets.bottom,- paddingLeft: insets.left,- paddingTop: insets.top + spacing.xl,- width: panelWidth,- },+ { width: panelWidth },panelStyle,]}testID="home.chromeMenu.panel"+ onLayout={() => setPanelReady(true)}>- <View style={styles.accountRow} testID="home.chromeDrawer.account">- <View style={styles.avatar}>- {accountImage ? (- <Image source={{ uri: accountImage }} style={styles.avatarImage} />- ) : (- <Text style={styles.avatarText}>{avatarLabel}</Text>- )}+ <View style={[styles.panelContent, {+ paddingBottom: insets.bottom,+ paddingLeft: insets.left,+ paddingTop: insets.top + spacing.xl,+ }]}>+ <View style={styles.accountRow} testID="home.chromeDrawer.account">+ {/* Default letter avatar; the organisation logo is only the small icon below. */}+ <MobileUserAvatar name={accountName} />+ <View style={styles.accountTexts}>+ <Text numberOfLines={1} style={styles.accountName}>{accountName}</Text>+ {accountEmail && accountEmail !== accountName ? (+ <Text numberOfLines={1} style={styles.accountEmail}>{accountEmail}</Text>+ ) : null}+ {orgName ? (+ <View style={styles.organizationRow}>+ {user?.orgLogoUrl ? (+ <Image source={{ uri: user.orgLogoUrl }} style={styles.organizationLogo} />+ ) : (+ <Building2 color={colors.textTertiary} size={iconSize.sm} strokeWidth={iconStroke.regular} />+ )}+ <Text numberOfLines={1} style={styles.organizationName}>{orgName}</Text>+ </View>+ ) : null}+ </View></View>- <View style={styles.accountTexts}>- <Text numberOfLines={1} style={styles.accountName}>{accountTitle}</Text>- {accountSubtitle ? (- <Text numberOfLines={1} style={styles.accountEmail}>{accountSubtitle}</Text>- ) : null}- </View>- </View>- <View style={styles.divider} />- {onModeChange ? <HomeModeSwitch mode={mode} onModeChange={onModeChange} /> : null}+ <View style={styles.divider} />+ {onModeChange ? <HomeModeSwitch mode={mode} onModeChange={onModeChange} /> : null}- <Pressable- accessibilityLabel={t("devices.list.a11y.openSearch")}- accessibilityRole="button"- onPress={onOpenSearch}- style={({ pressed }) => [styles.menuRow, pressed && styles.pressed]}- testID="home.chromeDrawer.search"- >- <Search- color={colors.textSecondary}- size={iconSize.md}- strokeWidth={iconStroke.regular}- />- <Text numberOfLines={1} style={styles.menuLabel}>- {t("devices.list.menu.search")}- </Text>- </Pressable>+ <Pressable+ accessibilityLabel={t("devices.list.a11y.openSearch")}+ accessibilityRole="button"+ onPress={onOpenSearch}+ style={({ pressed }) => [styles.menuRow, pressed && styles.pressed]}+ testID="home.chromeDrawer.search"+ >+ <Search+ color={colors.textSecondary}+ size={iconSize.md}+ strokeWidth={iconStroke.regular}+ />+ <Text numberOfLines={1} style={styles.menuLabel}>+ {t("devices.list.menu.search")}+ </Text>+ </Pressable>- <Pressable- accessibilityLabel={t('devices.management.title')}- accessibilityRole="button"- onPress={onOpenDevices}- style={({ pressed }) => [styles.menuRow, pressed && styles.pressed]}- testID="home.chromeDrawer.devices"- >- <Monitor color={colors.textSecondary} size={iconSize.md} strokeWidth={iconStroke.regular} />- <Text numberOfLines={1} style={styles.menuLabel}>{t('devices.management.title')}</Text>- </Pressable>+ <Pressable+ accessibilityLabel={t('devices.management.title')}+ accessibilityRole="button"+ onPress={onOpenDevices}+ style={({ pressed }) => [styles.menuRow, pressed && styles.pressed]}+ testID="home.chromeDrawer.devices"+ >+ <Monitor color={colors.textSecondary} size={iconSize.md} strokeWidth={iconStroke.regular} />+ <Text numberOfLines={1} style={styles.menuLabel}>{t('devices.management.title')}</Text>+ </Pressable>- {onOpenSharedSession && <Pressable- accessibilityLabel={t('sharedTask.join')}- accessibilityRole="button"- onPress={onOpenSharedSession}- style={({ pressed }) => [styles.menuRow, pressed && styles.pressed]}- >- <UsersRound color={colors.textSecondary} size={iconSize.md} strokeWidth={iconStroke.regular} />- <Text numberOfLines={1} style={styles.menuLabel}>{t('sharedTask.join')}</Text>- </Pressable>}+ {onOpenSharedSession && <Pressable+ accessibilityLabel={t('sharedTask.join')}+ accessibilityRole="button"+ onPress={onOpenSharedSession}+ style={({ pressed }) => [styles.menuRow, pressed && styles.pressed]}+ >+ <UsersRound color={colors.textSecondary} size={iconSize.md} strokeWidth={iconStroke.regular} />+ <Text numberOfLines={1} style={styles.menuLabel}>{t('sharedTask.join')}</Text>+ </Pressable>}- <Pressable- accessibilityLabel={t("devices.list.a11y.openSettings")}- accessibilityRole="button"- onPress={openSettingsImmediately}- ref={settingsButtonRef}- style={({ pressed }) => [styles.menuRow, pressed && styles.pressed]}- testID="devices.settingsButton"- >- <Settings- color={colors.textSecondary}- size={iconSize.md}- strokeWidth={iconStroke.regular}- />- <Text numberOfLines={1} style={styles.menuLabel}>- {t("devices.list.menu.settings")}- </Text>- </Pressable>+ <Pressable+ accessibilityLabel={t("devices.list.a11y.openSettings")}+ accessibilityRole="button"+ onPress={openSettingsImmediately}+ ref={settingsButtonRef}+ style={({ pressed }) => [styles.menuRow, pressed && styles.pressed]}+ testID="devices.settingsButton"+ >+ <Settings+ color={colors.textSecondary}+ size={iconSize.md}+ strokeWidth={iconStroke.regular}+ />+ <Text numberOfLines={1} style={styles.menuLabel}>+ {t("devices.list.menu.settings")}+ </Text>+ </Pressable>- <Pressable- accessibilityLabel={t('devices.list.accounts.title')}- accessibilityRole="button"- onPress={onOpenAccounts}- style={({ pressed }) => [styles.menuRow, pressed && styles.pressed]}- testID="home.chromeDrawer.accounts"- >- <UsersRound color={colors.textSecondary} size={iconSize.md} strokeWidth={iconStroke.regular} />- <Text numberOfLines={1} style={styles.menuLabel}>{t('devices.list.accounts.title')}</Text>- </Pressable>+ <Pressable+ accessibilityLabel={t('devices.list.accounts.title')}+ accessibilityRole="button"+ onPress={onOpenAccounts}+ style={({ pressed }) => [styles.menuRow, pressed && styles.pressed]}+ testID="home.chromeDrawer.accounts"+ >+ <UsersRound color={colors.textSecondary} size={iconSize.md} strokeWidth={iconStroke.regular} />+ <Text numberOfLines={1} style={styles.menuLabel}>{t('devices.list.accounts.title')}</Text>+ </Pressable>- <View style={styles.menuDivider} />+ <View style={styles.menuDivider} />- <Pressable- accessibilityLabel={loggingOut- ? t('settings.account.loggingOutAccessibility')- : t('settings.account.logout')}- accessibilityRole="button"- accessibilityState={{ busy: loggingOut || undefined, disabled: loggingOut || undefined }}- disabled={loggingOut}- onPress={onLogout}- style={({ pressed }) => [- styles.menuRow,- pressed && styles.pressed,- loggingOut && styles.disabled,- ]}- testID="home.chromeDrawer.logout"- >- <LogOut color={colors.destructive} size={iconSize.md} strokeWidth={iconStroke.regular} />- <Text numberOfLines={1} style={[styles.menuLabel, styles.dangerMenuLabel]}>- {loggingOut ? t('settings.account.loggingOut') : t('settings.account.logout')}- </Text>- </Pressable>+ <Pressable+ accessibilityLabel={loggingOut+ ? t('settings.account.loggingOutAccessibility')+ : t('settings.account.logout')}+ accessibilityRole="button"+ accessibilityState={{ busy: loggingOut || undefined, disabled: loggingOut || undefined }}+ disabled={loggingOut}+ onPress={requestLogout}+ style={({ pressed }) => [+ styles.menuRow,+ pressed && styles.pressed,+ ]}+ testID="home.chromeDrawer.logout"+ >+ {/* 退出中只显示转圈(标签保留给读屏),不换成「正在退出」文字。 */}+ {loggingOut ? (+ <ActivityIndicator color={colors.destructive} size="small" />+ ) : (+ <>+ <LogOut color={colors.destructive} size={iconSize.md} strokeWidth={iconStroke.regular} />+ <Text numberOfLines={1} style={[styles.menuLabel, styles.dangerMenuLabel]}>+ {t('settings.account.logout')}+ </Text>+ </>+ )}+ </Pressable>+ </View></Animated.View></GestureDetector></View>@@ -438,14 +456,22 @@ const makeStyles = (colors: ThemeColors) =>flex: 1,},panel: {- backgroundColor: colors.surface,- borderRightColor: colors.border,- borderRightWidth: StyleSheet.hairlineWidth,+ backgroundColor: colors.surfaceElevated,+ borderTopRightRadius: radius.container,+ borderBottomRightRadius: radius.container,+ // Owner-approved floating-layer exception, confined to this navigation drawer.+ boxShadow: [{ offsetX: spacing.xs, offsetY: 0, blurRadius: spacing.xl, color: colors.homeDrawerShadow }],bottom: 0,left: 0,position: "absolute",top: 0,},+ panelContent: {+ flex: 1,+ borderTopRightRadius: radius.container,+ borderBottomRightRadius: radius.container,+ overflow: "hidden",+ },accountRow: {alignItems: "center",flexDirection: "row",@@ -454,43 +480,39 @@ const makeStyles = (colors: ThemeColors) =>paddingHorizontal: spacing.lg,paddingVertical: spacing.md,},- avatar: {- alignItems: "center",- backgroundColor: colors.surfaceElevated,- borderColor: colors.border,- borderRadius: radius.pill,- borderWidth: StyleSheet.hairlineWidth,- height: 44,- justifyContent: "center",- overflow: "hidden",- width: 44,- },- avatarImage: {- height: 44,- width: 44,- },- avatarText: {- color: colors.textPrimary,- fontSize: typeScale.subtitle,- lineHeight: lineHeight.subtitle,- fontWeight: fontWeight.medium,- },accountTexts: {flex: 1,- gap: 2,+ gap: spacing.xs,minWidth: 0,},accountName: {color: colors.textPrimary,- fontSize: typeScale.body,- fontWeight: fontWeight.medium,- lineHeight: lineHeight.body,+ fontSize: typeScale.title,+ fontWeight: fontWeight.semibold,+ lineHeight: lineHeight.title,},accountEmail: {color: colors.textSecondary,fontSize: typeScale.footnote,lineHeight: lineHeight.caption,},+ organizationRow: {+ flexDirection: "row",+ alignItems: "center",+ gap: spacing.xs,+ },+ organizationLogo: {+ width: iconSize.sm,+ height: iconSize.sm,+ borderRadius: radius.pill,+ },+ organizationName: {+ flexShrink: 1,+ color: colors.textTertiary,+ fontSize: typeScale.caption,+ fontWeight: fontWeight.regular,+ lineHeight: lineHeight.caption,+ },divider: {backgroundColor: colors.border,height: StyleSheet.hairlineWidth,@@ -522,10 +544,5 @@ const makeStyles = (colors: ThemeColors) =>dangerMenuLabel: {color: colors.destructive,},- disabled: {- opacity: 0.48,- },- pressed: {- opacity: 0.72,- },+ pressed: mobileInteractionStyles.pressed,});diff --git a/apps/mobile/src/session/HomeListVisuals.tsx b/apps/mobile/src/session/HomeListVisuals.tsxindex 317e3d4fa1..e3b24abe93 100644--- a/apps/mobile/src/session/HomeListVisuals.tsx+++ b/apps/mobile/src/session/HomeListVisuals.tsx@@ -2,11 +2,17 @@ import { useEffect, useRef, type ReactNode } from 'react';import { Animated, Easing, StyleSheet, View } from 'react-native';import { Archive, UsersRound, RadioTower, Pencil } from 'lucide-react-native';import { MobileVendorIcon } from '@/components/MobileVendorIcon';+import { useReduceMotionEnabled } from '@/hooks/useReduceMotion';import { useTheme, useThemedStyles, type ThemeColors } from '@/theme';import { spacing, typeScale, lineHeight, fontWeight, iconSize, iconStroke } from '@/theme/tokens';import type { RemoteSessionListItem } from './sessionList';const HOME_SESSION_ROW_HEIGHT = 78;const HOME_SESSION_SINGLE_LINE_ROW_HEIGHT = 60;+/**+ * 任务行长按唤起选项的时长(ms)。首页、设备页任务列表都经 HomeSessionRow 消费,+ * 新增任务行长按入口一律引用这里,不要回落到 RN Pressable 默认 500ms。+ */+export const SESSION_ROW_LONG_PRESS_MS = 400;/** Shared by the full home list and its persistent, narrow task pane. */export function SessionStatusMark({item,@@ -56,27 +62,37 @@ export function SessionStatusMark({);}+/**+ * 运行中呼吸:常驻循环的状态信号,不是交互过渡,不套 motionDuration 交互档位。+ * 与 MobileVendorIcon 的 RUNNING_BREATH_* 同值,两处行内标志呼吸节奏保持一致;+ * 减弱动态效果(含首帧未知)下静止在全不透明。+ */+const RUNNING_BREATH_HALF_CYCLE_MS = 750;+const RUNNING_BREATH_MIN_OPACITY = 0.3;+function SessionStatusPulse({ children, running }: { children: ReactNode; running: boolean }) {- const opacity = useRef(new Animated.Value(running ? 0.3 : 1)).current;+ const reduceMotion = useReduceMotionEnabled();+ const animate = running && reduceMotion === false;+ const opacity = useRef(new Animated.Value(animate ? RUNNING_BREATH_MIN_OPACITY : 1)).current;useEffect(() => {opacity.stopAnimation();- if (!running) {+ if (!animate) {opacity.setValue(1);return;}- opacity.setValue(0.3);+ opacity.setValue(RUNNING_BREATH_MIN_OPACITY);const loop = Animated.loop(Animated.sequence([Animated.timing(opacity, {- duration: 750,+ duration: RUNNING_BREATH_HALF_CYCLE_MS,easing: Easing.inOut(Easing.ease),toValue: 1,useNativeDriver: true,}),Animated.timing(opacity, {- duration: 750,+ duration: RUNNING_BREATH_HALF_CYCLE_MS,easing: Easing.inOut(Easing.ease),- toValue: 0.3,+ toValue: RUNNING_BREATH_MIN_OPACITY,useNativeDriver: true,}),]),@@ -85,7 +101,7 @@ function SessionStatusPulse({ children, running }: { children: ReactNode; runninreturn () => {loop.stop();};- }, [opacity, running]);+ }, [animate, opacity]);return <Animated.View style={{ opacity }}>{children}</Animated.View>;}@@ -209,7 +225,7 @@ export const homeListStyles = (colors: ThemeColors) => StyleSheet.create({alignItems: 'center',backgroundColor: colors.surface,flexDirection: 'row',- gap: 8,+ gap: spacing.sm,minHeight: 56,paddingLeft: spacing.md,paddingRight: spacing.lg,diff --git a/apps/mobile/src/session/HomeNewTaskButton.tsx b/apps/mobile/src/session/HomeNewTaskButton.tsxindex d8f541c35d..cc097833c8 100644--- a/apps/mobile/src/session/HomeNewTaskButton.tsx+++ b/apps/mobile/src/session/HomeNewTaskButton.tsx@@ -1,22 +1,39 @@-import { View } from 'react-native';import { SquarePen } from 'lucide-react-native';import { useTranslation } from 'react-i18next';import { iconSize, iconStroke, useTheme } from '@/theme';import { HomeHeaderGlassButton } from './HomeHeaderGlassButton';+import { ComposerMorphSource } from './ComposerMorphSource';+import { useLiquidGlassAvailable } from './useLiquidGlassAvailable';+import { composerGeometry, type ComposerMorphOrigin } from './composerGeometry';-const HOME_NEW_TASK_SIZE = 55;+/** The circle and the compact composer pill are the same height, so the morph only stretches sideways. */+export const HOME_NEW_TASK_SIZE = composerGeometry.pillHeight;-/** Shared home/detail floating action: keep the circle, artwork and placement together. */-export function HomeNewTaskButton({ onPress, bottomInset, disabled = false }: {- onPress(): void; bottomInset: number; disabled?: boolean;+/**+ * Shared home/detail floating action. It sits on the composer's resting line+ * (right edge = composer right inset, bottom = composer bottom), so on iOS the+ * circle stretches straight into the new task's composer pill.+ */+export function HomeNewTaskButton({ onPress, bottomInset, disabled = false, morph = false }: {+ onPress(origin?: ComposerMorphOrigin): void; bottomInset: number; disabled?: boolean;+ /** Only callers whose onPress hands the origin to the new-task route may morph. */+ morph?: boolean;}) {const { colors } = useTheme();const { t } = useTranslation();- return <View style={{ position: 'absolute', right: 20, bottom: 45 + bottomInset, width: HOME_NEW_TASK_SIZE, height: HOME_NEW_TASK_SIZE }}>+ // Liquid Glass: the untinted system glass circle (like the header buttons and+ // the composer pill it grows into). Without it, keep the solid filled circle,+ // since a plain chrome button has no surface of its own.+ const glass = useLiquidGlassAvailable();+ // Without morph the native shield stays out of the way and the button presses normally.+ return <ComposerMorphSource disabled={disabled || !morph} onAction={onPress} style={{+ position: 'absolute', right: composerGeometry.horizontalInset, bottom: bottomInset + composerGeometry.restingGap,+ width: HOME_NEW_TASK_SIZE, height: HOME_NEW_TASK_SIZE,+ }}><HomeHeaderGlassButton accessibilityLabel={t('devices.list.a11y.newRemoteConversation')}- onPress={onPress} disabled={disabled} prominent size={HOME_NEW_TASK_SIZE} artworkSize={iconSize.xxl}+ onPress={() => onPress()} disabled={disabled} prominent={!glass} size={HOME_NEW_TASK_SIZE} artworkSize={iconSize.xxl}testID="home.newChatButton">- <SquarePen color={colors.ctaText} size={iconSize.xxl} strokeWidth={iconStroke.regular} />+ <SquarePen color={glass ? colors.textPrimary : colors.ctaText} size={iconSize.xxl} strokeWidth={iconStroke.regular} /></HomeHeaderGlassButton>- </View>;+ </ComposerMorphSource>;}diff --git a/apps/mobile/src/session/HomeSearchBar.tsx b/apps/mobile/src/session/HomeSearchBar.tsxindex 03e4b289e7..1ce5fd2c49 100644--- a/apps/mobile/src/session/HomeSearchBar.tsx+++ b/apps/mobile/src/session/HomeSearchBar.tsx@@ -6,6 +6,7 @@ import { Search, SlidersHorizontal, X } from "lucide-react-native";import { Pressable, StyleSheet, View } from "react-native";import { useTranslation } from "react-i18next";import { TextInput } from "@/components/AppText";+import { mobileInteractionStyles } from "@/components/mobileInteractionStyles";import {NativePullDownMenu,type NativePullDownAction,@@ -158,10 +159,11 @@ const makeStyles = (colors: ThemeColors) =>paddingLeft: spacing.lg,paddingRight: spacing.xs,},+ // §3「次级正文 · 搜索框」15;单行输入框不设行高(iOS 占位字 / 光标偏位)。input: {color: colors.textPrimary,flex: 1,- fontSize: typeScale.body,+ fontSize: typeScale.bodySmall,minWidth: 0,paddingVertical: spacing.sm,},@@ -181,7 +183,5 @@ const makeStyles = (colors: ThemeColors) =>top: 7,width: 6,},- pressed: {- opacity: 0.72,- },+ pressed: mobileInteractionStyles.pressed,});diff --git a/apps/mobile/src/session/HomeSurface.tsx b/apps/mobile/src/session/HomeSurface.tsxindex e279a5f873..042010a565 100644--- a/apps/mobile/src/session/HomeSurface.tsx+++ b/apps/mobile/src/session/HomeSurface.tsx@@ -5,15 +5,17 @@ import { ResidentHomeList, useResidentHomeList } from './ResidentHomeList';import { HomeNewTaskButton } from './HomeNewTaskButton';import { useRetainedHomeState, getHomeViewSession } from './homeViewSession';import { rememberRecentTask } from './recentTasks';-import { homeListStyles, SessionStatusMark } from '@/session/HomeListVisuals';+import { homeListStyles, SESSION_ROW_LONG_PRESS_MS, SessionStatusMark } from '@/session/HomeListVisuals';import { useHeaderHeight } from "expo-router/react-navigation";import { SessionHeaderNativeBlur } from "@/session/SessionHeaderNativeControls";+import { rememberComposerEntry } from './composerMorph';+import type { ComposerMorphOrigin } from './composerGeometry';import { RemoteTaskSuggestions } from '@/session/RemoteTaskSuggestions';import { isTaskSuggestionsSyncPending, useRemoteTaskSuggestionsPresentation } from '@/session/useRemoteTaskSuggestionsPresentation';import { countHomeSuggestionSessions, remoteTaskSuggestionsMode, type RemoteTaskSuggestionId } from '@/session/remoteTaskSuggestionsModel';import { cacheRemoteResourceHome, readRemoteResourceSnapshot } from '@/device-link/remoteResourceCache';import { canBrowseMobileHomeDevice } from '@/session/mobileHome';-import { useFocusEffect, useIsFocused } from 'expo-router';+import { useFocusEffect, useIsFocused, useRouter } from 'expo-router';import { createContext, useContext, Fragment, memo, useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, type MutableRefObject, type ReactNode } from 'react';import {ActivityIndicator,@@ -69,7 +71,9 @@ import type { TFunction } from 'i18next';import { useAuth } from '@/auth/AuthContext';import { configureCollapseAnimation } from '@/utils/collapseAnimation';import { useGuardedPush } from '@/utils/useGuardedPush';+import { useHomeMenuFadeTiming } from '@/session/homeMenuFadeTiming';import {+ MainWindowActionButton,MainWindowActionGroup,MainWindowEmptyState,StatusDot,@@ -261,7 +265,9 @@ import { useSessionListActions } from '@/session/useSessionListActions';import { useModalFadeLifecycle } from '@/session/useModalFadeLifecycle';import type { RemoteSession } from '@/session/types';import { useTheme, useThemedStyles, type ThemeColors } from '@/theme';-import { fontWeight, iconSize, iconStroke, lineHeight, radius, spacing, typeScale } from '@/theme/tokens';+import { fontWeight, iconSize, iconStroke, lineHeight, motionDuration, navigationChrome, radius, spacing, typeScale } from '@/theme/tokens';+import { mobileInteractionStyles } from '@/components/mobileInteractionStyles';+import { useReduceMotionEnabled } from '@/hooks/useReduceMotion';const LIST_LIMIT = 200;// Keep the device-link channel responsive while All Sessions hydrates several@@ -284,6 +290,16 @@ const HOME_SESSION_SINGLE_LINE_ROW_HEIGHT = 60;const CINDY_LIST_GUTTER = 20;const CINDY_LIST_FAB_BOTTOM = 45;const HOME_HEADER_MIN_HEIGHT = 48;+/**+ * 新建钮不在系统栏时的列表底部滚动余量:给右下浮动新建钮让出最后一行。+ * 新建钮坐在输入框静止底线上(安全区 + 8,55 圆钮,顶边约安全区 + 63),+ * 沿用历史取值 83,最后一行与圆钮之间留约 20pt。+ */+const LEGACY_HOME_LIST_BOTTOM_RESERVE = 83;+/** 项目块「查看全部」行的左缩进(历史取值,与项目内任务文字列大致对齐,保持布局不变)。 */+const HOME_PROJECT_VIEW_ALL_INSET = 48;+/** 连接提示条同步按钮的视觉尺寸;命中区用 hitSlop 补到 navigationChrome.target(44)。 */+const CONNECTION_ICON_BUTTON_SIZE = 28;const AnimatedPressable = Animated.createAnimatedComponent(Pressable);function estimateHomeSessionRowHeight(item: RemoteSessionListItem): number {@@ -417,6 +433,7 @@ function HomeScreenContent({ active = true, onModeChange, width, onDismiss, newSconst push = useGuardedPush();const navigationHost = useRef({ runNavigation, onSelectSession });navigationHost.current = { runNavigation, onSelectSession };+ const router = useRouter();const guardedPush = useCallback((href: Parameters<typeof push>[0]) => {const run = navigationHost.current.runNavigation;if (run) run(() => push(href)); else push(href);@@ -2046,7 +2063,7 @@ function HomeScreenContent({ active = true, onModeChange, width, onDismiss, newSguardedPush(href);}, [guardedPush, priorityContext, rememberTask, swipeRegistry, t]);- const openNewSession = useCallback((project?: MobileHomeProjectGroup, suggestion?: RemoteTaskSuggestionId, explicitDeviceId?: string) => {+ const openNewSession = useCallback((project?: MobileHomeProjectGroup, suggestion?: RemoteTaskSuggestionId, explicitDeviceId?: string, origin?: ComposerMorphOrigin) => {const deviceId = project?.deviceId ?? explicitDeviceId ?? home.primaryDevice?.deviceId;const deviceName = project?.deviceName ?? newSessionDeviceOptions.find((device) => device.deviceId === deviceId)?.name ?? home.primaryDevice?.label ?? deviceId ?? '';if (!deviceId) {@@ -2059,6 +2076,7 @@ function HomeScreenContent({ active = true, onModeChange, width, onDismiss, newSdeviceId,deviceName,deviceOptions: serializeNewSessionDeviceOptions(newSessionDeviceOptions),+ ...(origin ? { composerMorph: rememberComposerEntry(origin) } : {}),...(suggestion ? { suggestion } : {}),...(project?.workingDir ? { workingDir: project.workingDir } : {}),// 列表正筛选某台电脑时,新建默认跟随这台电脑(显式指定,盖过"上次选择"的@@ -2084,12 +2102,14 @@ function HomeScreenContent({ active = true, onModeChange, width, onDismiss, newSsetLoggingOut(true);try {await auth.logout();+ // Same landing as settings and the partner entries, without relying on the outer auth redirect.+ router.replace('/login');} catch (error) {Alert.alert(t('devices.list.alert.actionFailed'), formatRemoteError(error));} finally {setLoggingOut(false);}- }, [auth, loggingOut, t]);+ }, [auth, loggingOut, router, t]);const toggleProject = useCallback((key: string) => {configureCollapseAnimation();@@ -2663,6 +2683,7 @@ function HomeScreenContent({ active = true, onModeChange, width, onDismiss, newSprogressViewOffset={residentList.enabled ? 0 : chromeHeight}refreshing={refreshing}onRefresh={() => void loadHome({ visible: true })}+ tintColor={colors.textSecondary}/>}scrollEnabled={projectDrag === null}@@ -2670,11 +2691,13 @@ function HomeScreenContent({ active = true, onModeChange, width, onDismiss, newScontentContainerStyle={[styles.listContent,{- paddingBottom: (newSessionInSystemBar ? spacing.sm : 83) + insets.bottom,+ paddingBottom: (newSessionInSystemBar ? spacing.sm : LEGACY_HOME_LIST_BOTTOM_RESERVE) + insets.bottom,paddingTop: residentList.enabled ? 0 : chromeHeight,},]}onScroll={onListScroll}+ keyboardShouldPersistTaps="handled"+ keyboardDismissMode="on-drag"scrollEventThrottle={16}onScrollBeginDrag={() => {scrollRestored.current = true;@@ -2785,8 +2808,9 @@ function HomeScreenContent({ active = true, onModeChange, width, onDismiss, newS{newSessionInSystemBar || showRemoteGuide || taskSuggestionsPending || taskSuggestionsMode === 'empty' ? null : (// 无可控电脑时不提供入口;完整空态已有主按钮,避免重复显示新建 CTA。- <HomeNewTaskButton bottomInset={insets.bottom} disabled={newSessionDisabled}- onPress={() => openNewSession()} />+ // iOS: the circle stretches into the new task's composer pill (origin → morph handoff).+ <HomeNewTaskButton bottomInset={insets.bottom} disabled={newSessionDisabled} morph+ onPress={(origin) => openNewSession(undefined, undefined, undefined, origin)} />)}</>);@@ -2915,6 +2939,8 @@ function HomeScreenContent({ active = true, onModeChange, width, onDismiss, newSaccessibilityRole="button"accessibilityState={{ busy: refreshing || undefined, disabled: refreshing }}disabled={refreshing}+ // 视觉 28pt,hitSlop 把命中区补到 44pt(§5 触控目标)。+ hitSlop={(navigationChrome.target - CONNECTION_ICON_BUTTON_SIZE) / 2}onPress={() => void loadHome({ visible: true })}style={({ pressed }) => [styles.connectionIconButton,@@ -3036,6 +3062,8 @@ function HomeScreenContent({ active = true, onModeChange, width, onDismiss, newSsetChromeMenuCloseInstant(true);setChromeMenuOpen(false);}}+ // 抽屉内部先确认(confirmLogout)再调 onLogout,这里不重复确认。+ hasRunningTasks={runningSessionIds.size > 0}onLogout={() => void logout()}open={chromeMenuOpen}user={user}@@ -3150,12 +3178,12 @@ function DeviceMenuModal({const insets = useSafeAreaInsets();// 范围菜单只列设备;设置入口已挪到左上角 / 右上角。const scopeScrollMaxHeight = Math.max(160, screenHeight - topOffset - insets.bottom - 24);- // §14.4:展开用 ≤150ms 纯透明度过渡(不做位移/缩放),关闭淡出后再卸载 Modal。+ // §14.4 轻浮层:fast 入场 / instant 退场纯透明度过渡(减弱动态效果直接显示),关闭淡出后再卸载 Modal。+ const menuFadeTiming = useHomeMenuFadeTiming();// mounted/progress/进场时机(onShow)/onClosed 延迟触发(等 Modal 真正卸载的 commit// 完成,避免 iOS present-during-dismiss 吞掉第二个弹窗)统一走 useModalFadeLifecycle。const { mounted, progress, onShowStartIn } = useModalFadeLifecycle(visible, {- inMs: 140,- outMs: 110,+ ...menuFadeTiming,onClosed,});const allFilter = filters.find((item) => item.deviceId === null) ?? null;@@ -3248,9 +3276,9 @@ function HomeDisplaySettingsModal({const { height: screenHeight } = useWindowDimensions();const insets = useSafeAreaInsets();const scrollMaxHeight = Math.max(200, screenHeight - topOffset - insets.bottom - 24);+ const menuFadeTiming = useHomeMenuFadeTiming();const { mounted, progress, onShowStartIn } = useModalFadeLifecycle(visible, {- inMs: 140,- outMs: 110,+ ...menuFadeTiming,});return (<HomeMenuScrim@@ -3412,6 +3440,8 @@ function RevokedAccessTip({const { colors } = useTheme();const { t } = useTranslation();return (+ // 说明型提示:只有右上角 × 与「重试访问」,没有「取消」按钮,按 DESIGN.md 关闭规则可点背景关闭;+ // 重试在父级持有状态,关闭提示不会中断进行中的重试。<Modal animationType="fade" transparent visible={deviceName != null} onRequestClose={onClose}><Pressable style={styles.revokedTipBackdrop} onPress={onClose} testID="home.revokedTip.backdrop">{/* Inner press swallow keeps taps on the card from dismissing via the backdrop. */}@@ -3434,21 +3464,16 @@ function RevokedAccessTip({<Text style={styles.revokedTipBody}>{t('devices.list.revoked.body', { deviceName: deviceName ?? t('devices.list.thisComputer') })}</Text>- <Pressable- accessibilityLabel={t('devices.list.revoked.retry')}- accessibilityRole="button"- accessibilityState={{ busy: retrying, disabled: retrying }}- disabled={retrying}- onPress={onRetry}- style={({ pressed }) => [styles.revokedTipRetry, pressed && styles.pressed, retrying && styles.disabled]}- testID="home.revokedTip.retry"- >- {retrying ? (- <ActivityIndicator color={colors.ctaText} size="small" />- ) : (- <Text style={styles.revokedTipRetryText}>{t('devices.list.revoked.retry')}</Text>- )}- </Pressable>+ <MainWindowActionButton+ action={{+ busy: retrying,+ label: t('devices.list.revoked.retry'),+ onPress: onRetry,+ testID: 'home.revokedTip.retry',+ tone: 'primary',+ }}+ style={styles.revokedTipRetry}+ /></Pressable></Pressable></Modal>@@ -4142,7 +4167,7 @@ function HomeSessionRowInner({accessibilityRole="button"accessibilityLabel={accessibilityLabel}accessibilityState={group ? { expanded: groupExpanded, selected: selected || active } : { selected: selected || active }}- delayLongPress={400}+ delayLongPress={SESSION_ROW_LONG_PRESS_MS}onLongPress={!selectionMode && !group && swipe && conversationSearchAllowsLocalWrites(item)? () => {@@ -4444,20 +4469,25 @@ function SessionRightSpinner({ testID }: { testID?: string }) {const { colors } = useTheme();const { t } = useTranslation();const spin = useRef(new Animated.Value(0)).current;+ // 常驻循环:减弱动态效果(含首帧未知)下静止,只显示静态图标。+ const reduceMotion = useReduceMotionEnabled();useEffect(() => {+ if (reduceMotion !== false) return;const loop = Animated.loop(Animated.timing(spin, {- duration: 1000,+ duration: motionDuration.spinnerCycle,easing: Easing.linear,toValue: 1,useNativeDriver: true,+ isInteraction: false,}),);loop.start();return () => {loop.stop();+ spin.setValue(0);};- }, [spin]);+ }, [reduceMotion, spin]);const rotate = spin.interpolate({ inputRange: [0, 1], outputRange: ['0deg', '360deg'] });return (<Animated.View@@ -4562,7 +4592,7 @@ function pruneHomeDeviceConnectionStates(const makeStyles = (colors: ThemeColors) => StyleSheet.create({...homeListStyles(colors),safeArea: { flex: 1, backgroundColor: colors.surface },- pressed: { opacity: 0.72 },+ pressed: mobileInteractionStyles.pressed,disabled: { opacity: 0.45 },homeChrome: {left: 0,@@ -4655,9 +4685,9 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({connectionIconButton: {alignItems: 'center',borderRadius: radius.pill,- height: 28,+ height: CONNECTION_ICON_BUTTON_SIZE,justifyContent: 'center',- width: 28,+ width: CONNECTION_ICON_BUTTON_SIZE,},deviceConnectionFailedRing: {borderColor: colors.errorBorder,@@ -4785,19 +4815,8 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({lineHeight: lineHeight.body,},revokedTipRetry: {- alignItems: 'center',- backgroundColor: colors.cta,- borderRadius: radius.pill,- height: 44,- justifyContent: 'center',marginTop: spacing.sm,},- revokedTipRetryText: {- color: colors.ctaText,- fontSize: typeScale.body,- lineHeight: lineHeight.body,- fontWeight: fontWeight.medium,- },homeList: {backgroundColor: colors.surface,flex: 1,@@ -4805,7 +4824,7 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({listContent: {backgroundColor: colors.surface,flexGrow: 1,- paddingBottom: 83,+ paddingBottom: LEGACY_HOME_LIST_BOTTOM_RESERVE,paddingTop: 0,},// 置顶区收尾线:回 XD-Maker 原版 hairline(换肤卡片化曾置 0,通栏回退一并恢复)。@@ -4847,7 +4866,7 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({borderRadius: radius.container,borderWidth: StyleSheet.hairlineWidth,flexDirection: 'row',- gap: 8,+ gap: spacing.sm,paddingLeft: spacing.md,paddingRight: spacing.lg,position: 'absolute',@@ -4868,8 +4887,8 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({alignItems: 'center',flexDirection: 'row',gap: spacing.sm,- minHeight: 54,- paddingLeft: 48,+ minHeight: HOME_AUTOMATION_VIEW_ALL_ROW_HEIGHT,+ paddingLeft: HOME_PROJECT_VIEW_ALL_INSET,paddingRight: spacing.lg,},projectViewAllText: {diff --git a/apps/mobile/src/session/HtmlWebsiteBrowser.tsx b/apps/mobile/src/session/HtmlWebsiteBrowser.tsxindex 2afdb71864..464fc77081 100644--- a/apps/mobile/src/session/HtmlWebsiteBrowser.tsx+++ b/apps/mobile/src/session/HtmlWebsiteBrowser.tsx@@ -1,10 +1,11 @@-import { useEffect, useRef, useState } from 'react';+import { useCallback, useEffect, useRef, useState } from 'react';import { ActivityIndicator, Alert, Platform, Share, StyleSheet, View } from 'react-native';import { WebView, type WebViewNavigation } from 'react-native-webview';import * as Clipboard from 'expo-clipboard';import { useTranslation } from 'react-i18next';import { Text } from '@/components/AppText';import { useTheme } from '@/theme';+import { fontWeight, lineHeight, typeScale } from '@/theme/tokens';import { HtmlBrowserChrome } from './HtmlBrowserChrome';import type { HtmlBrowserChromeProps } from './HtmlBrowserChrome.types';import { normalizeBrowserAddress, allowWebsiteNavigation } from './browserAddress';@@ -13,6 +14,9 @@ import { browserViewportScrollScript, type BrowserInsets } from './htmlBrowserViexport interface WebsiteVisit { url: string; snapshotClosed: Promise<void> }+/** 「已复制网址」提示停留时长,与文件预览 / 文件浏览的复制提示一致。 */+const COPY_NOTICE_DISMISS_MS = 2500;+/** Separate native lifetime and ephemeral cookie store from the file preview. */export function HtmlWebsiteBrowser({ visit, insets, chrome, onReturn }: {visit: WebsiteVisit;@@ -33,6 +37,16 @@ export function HtmlWebsiteBrowser({ visit, insets, chrome, onReturn }: {const address = navigation?.url ?? source.uri;const live = useRef(true);const { viewRef, measure, script, viewportStyle, obscuredContentInsets } = useHtmlBrowserViewport(insets);+ const [notice, setNotice] = useState<string | null>(null);+ const noticeTimer = useRef<ReturnType<typeof setTimeout> | null>(null);+ useEffect(() => () => { if (noticeTimer.current) clearTimeout(noticeTimer.current); }, []);+ const copyAddress = useCallback(async () => {+ await Clipboard.setStringAsync(address);+ if (!live.current) return;+ setNotice(t('files.preview.browserCopiedAddress'));+ if (noticeTimer.current) clearTimeout(noticeTimer.current);+ noticeTimer.current = setTimeout(() => setNotice(null), COPY_NOTICE_DISMISS_MS);+ }, [address, t]);useEffect(() => {live.current = true;void visit.snapshotClosed.then(() => { if (live.current) setReady(true); }, () => { if (live.current) setFailed(true); });@@ -95,13 +109,13 @@ export function HtmlWebsiteBrowser({ visit, insets, chrome, onReturn }: {/>}{!ready && !failed && <View style={styles.center}><ActivityIndicator color={colors.textSecondary} /></View>}{failed && <View pointerEvents="none" style={[styles.center, { backgroundColor: colors.surface }]}>- <Text style={{ color: colors.textPrimary }}>{t('files.preview.browserWebsiteFailed')}</Text>+ <Text style={[styles.failedText, { color: colors.errorText }]}>{t('files.preview.browserWebsiteFailed')}</Text></View>}</View></View><HtmlBrowserChrome {...chrome}title={address} path={address} address={address} website- source={false} busy={false} loading={!failed && (!ready || !navigation || navigation.loading)}+ source={false} busy={false} notice={notice} loading={!failed && (!ready || !navigation || navigation.loading)}canGoBack canGoForward={navigation?.canGoForward === true}onNavigate={navigate}onBack={() => navigation?.canGoBack ? webView.current?.goBack() : onReturn()}@@ -111,7 +125,7 @@ export function HtmlWebsiteBrowser({ visit, insets, chrome, onReturn }: {else webView.current?.reload();}}onToggleSource={onReturn}- onCopyPath={() => { void Clipboard.setStringAsync(address); }}+ onCopyPath={() => { void copyAddress().catch(() => {}); }}onShare={() => { void Share.share(Platform.OS === 'ios' ? { url: address } : { message: address }).catch(() => {}); }}onAddToTask={() => {}}/>@@ -122,4 +136,6 @@ const styles = StyleSheet.create({fill: { flex: 1 },viewport: { flex: 1, overflow: 'hidden' },center: { ...StyleSheet.absoluteFill, alignItems: 'center', justifyContent: 'center' },+ // 报错说明(成句的话):footnote 13/18 400;字色 errorText 在调用处按主题注入。+ failedText: { fontSize: typeScale.footnote, lineHeight: lineHeight.caption, fontWeight: fontWeight.regular },});diff --git a/apps/mobile/src/session/InlineReferenceChip.tsx b/apps/mobile/src/session/InlineReferenceChip.tsxindex 486c3dc236..c7b0b3c923 100644--- a/apps/mobile/src/session/InlineReferenceChip.tsx+++ b/apps/mobile/src/session/InlineReferenceChip.tsx@@ -1,6 +1,7 @@import type { ReactNode } from 'react';import { Pressable, StyleSheet, View } from 'react-native';import { Text } from '@/components/AppText';+import { mobileInteractionStyles } from '@/components/mobileInteractionStyles';import { fontWeight, lineHeight, radius, spacing, typeScale, useThemedStyles, type ThemeColors } from '@/theme';/** Shared compact pill shell for composer-adjacent and sent-message references. */@@ -61,5 +62,5 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({fontWeight: fontWeight.regular,lineHeight: lineHeight.bodySmall,},- pressed: { opacity: 0.7 },+ pressed: mobileInteractionStyles.pressed,});diff --git a/apps/mobile/src/session/MessageRenderer.tsx b/apps/mobile/src/session/MessageRenderer.tsxindex e4908825c8..4aa0c28b44 100644--- a/apps/mobile/src/session/MessageRenderer.tsx+++ b/apps/mobile/src/session/MessageRenderer.tsx@@ -267,7 +267,6 @@ import {} from '@/session/messageContentLayout';import { buildMobileReadableViewportLayout } from '@/session/responsiveViewportLayout';import {- formatDuration,type MobileAgentTaskItem,type MobileMessageItem,type MobileMessageRenderItem,@@ -391,6 +390,7 @@ import type { RemoteTextFilePreviewResult } from '@/device-link/mobileMakerTransimport { fontWeight, lineHeight, radius, spacing, typeScale } from '@/theme/tokens';import { iconSize, iconStroke, monoFont, useTheme, useThemedStyles, type ThemeColors } from '@/theme';import { i18n } from '@/i18n';+import { formatLocalizedDuration } from '@/session/sessionDurationFormat';import { mobilePresentationLocalizer } from '@/i18n/presentationLocalizer';import { mobileToolRowWording } from '@/i18n/toolWording';@@ -3948,9 +3948,9 @@ function ThinkingCard({const title = item.redacted? t('message.renderer.thinkingHidden'): item.durationMs !== undefined- ? t('message.renderer.thinkingDone', { duration: formatDuration(item.durationMs) })+ ? t('message.renderer.thinkingDone', { duration: formatLocalizedDuration(item.durationMs) }): elapsedMs !== null- ? t('message.renderer.thinkingActive', { elapsed: formatDuration(elapsedMs) })+ ? t('message.renderer.thinkingActive', { elapsed: formatLocalizedDuration(elapsedMs) }): t('message.renderer.thinkingProcess');return (<FoldablePanel@@ -4378,7 +4378,7 @@ function buildAgentTaskMeta(model: AgentTaskCardModel): string[] {const parts: string[] = [AGENT_TASK_PROVIDER_LABEL[model.provider], agentTaskStatusLabel(model.status)];if (typeof model.totalTokens === 'number') parts.push(`${formatCompactTokens(model.totalTokens)} tokens`);if (typeof model.toolUses === 'number') parts.push(i18n.t('message.renderer.toolUseCount', { n: model.toolUses }));- if (typeof model.durationMs === 'number') parts.push(formatDuration(model.durationMs));+ if (typeof model.durationMs === 'number') parts.push(formatLocalizedDuration(model.durationMs));return parts;}@@ -4599,7 +4599,7 @@ function WorkGroupElapsed({ sinceIso }: { sinceIso: string | undefined }) {const elapsedMs = useLiveElapsedMs(true, sinceIso);return elapsedMs === null? null- : <Text style={styles.workGroupElapsed}>{formatDuration(elapsedMs)}</Text>;+ : <Text style={styles.workGroupElapsed}>{formatLocalizedDuration(elapsedMs)}</Text>;}const WorkToolActivityRow = memo(function WorkToolActivityRow({@@ -4720,7 +4720,7 @@ function SubagentCard({? t('message.renderer.subagentTyped', { type: item.header.subagentType }): t('message.renderer.subagent');const statusText = item.status === 'completed' && item.durationMs !== undefined- ? t('message.renderer.workedDuration', { duration: formatDuration(item.durationMs) })+ ? t('message.renderer.workedDuration', { duration: formatLocalizedDuration(item.durationMs) }): agentTaskStatusLabel(item.status);const subtitle = [item.header.description, statusText].filter(Boolean).join(' · ');return (@@ -7433,12 +7433,10 @@ function DiffPayloadBody({{canPreview ? (<PayloadActionButtonaccessibilityLabel={t('message.renderer.readCurrentRemoteFile')}- disabled={previewState.status === 'loading'}- label={previewState.status === 'loading'- ? t('message.renderer.reading')- : previewState.status === 'unavailable'- ? t('message.renderer.retryFilePreview')- : t('message.renderer.readCurrentFile')}+ busy={previewState.status === 'loading'}+ label={previewState.status === 'unavailable'+ ? t('message.renderer.retryFilePreview')+ : t('message.renderer.readCurrentFile')}layout={layout}onPress={openFilePreview}testID="message.diffFilePreviewLoadButton"@@ -7661,14 +7659,14 @@ function FilePayloadBody({</Text><PayloadPathActions layout={layout} path={sourcePath}>{onResolveRemoteMedia && isDesktopLocalMediaUrl(sourcePath) ? <PayloadActionButton- accessibilityLabel={t('files.browser.exportShare')} label={t(exporting ? 'files.browser.exporting' : 'files.browser.exportShare')}- layout={layout} disabled={exporting} onPress={() => { void exportFile(); }} testID="message.fileExportButton" /> : null}+ accessibilityLabel={t('files.browser.exportShare')} label={t('files.browser.exportShare')}+ layout={layout} busy={exporting} onPress={() => { void exportFile(); }} testID="message.fileExportButton" /> : null}{canPreview && previewState.status !== 'ready' ? (<PayloadActionButtonaccessibilityLabel={t('message.renderer.loadRemoteTextPreview')}- disabled={previewState.status === 'loading'}- label={previewState.status === 'loading' ? t('message.renderer.loading') : previewState.status === 'unavailable' ? t('message.renderer.retryPreview') : t('message.renderer.loadPreview')}+ busy={previewState.status === 'loading'}+ label={previewState.status === 'unavailable' ? t('message.renderer.retryPreview') : t('message.renderer.loadPreview')}layout={layout}onPress={loadPreview}testID="message.filePreviewLoadButton"@@ -7805,8 +7803,8 @@ function PayloadPathActions({{canCopy ? (<PayloadActionButtonaccessibilityLabel={t('message.renderer.copyRemoteFilePath')}- disabled={copyState === 'copying'}- label={copyState === 'copying' ? t('message.renderer.copyStateCopying') : t('message.renderer.copyPath')}+ busy={copyState === 'copying'}+ label={t('message.renderer.copyPath')}layout={layout}onPress={copyPath}testID="message.copyFilePathButton"@@ -7825,6 +7823,7 @@ function PayloadPathActions({function PayloadActionButton({accessibilityLabel,+ busy = false,disabled = false,label,layout,@@ -7832,6 +7831,8 @@ function PayloadActionButton({testID,}: {accessibilityLabel?: string;+ /** 进行中:按钮只转圈、不显示文字(宽高由 minWidth/minHeight 保持不跳)。 */+ busy?: boolean;disabled?: boolean;label: string;layout: PayloadBodyLayout;@@ -7839,13 +7840,15 @@ function PayloadActionButton({testID?: string;}) {const styles = useThemedStyles(makeStyles);+ const { colors } = useTheme();+ const interactionDisabled = disabled || busy;return (<PressableaccessibilityLabel={accessibilityLabel ?? label}accessibilityRole="button"- accessibilityState={{ disabled }}- disabled={disabled}- onPress={disabled ? undefined : onPress}+ accessibilityState={{ busy: busy || undefined, disabled: interactionDisabled }}+ disabled={interactionDisabled}+ onPress={interactionDisabled ? undefined : onPress}style={({ pressed }) => [styles.payloadOpenButton,{@@ -7853,11 +7856,15 @@ function PayloadActionButton({minWidth: layout.actionButtonMinWidth,},pressed && styles.pressed,- disabled && styles.disabled,+ disabled && !busy && styles.disabled,]}testID={testID}>- <Text style={styles.payloadOpenButtonText}>{label}</Text>+ {busy ? (+ <ActivityIndicator color={colors.textSecondary} size="small" />+ ) : (+ <Text style={styles.payloadOpenButtonText}>{label}</Text>+ )}</Pressable>);}@@ -8608,11 +8615,11 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({lineHeight: lineHeight.micro,fontWeight: fontWeight.medium,},+ // 分隔点:纯语义三级色,不再叠透明度「做淡」(§3 硬规则 1)。agentSwitchDot: {color: colors.textTertiary,fontSize: typeScale.micro,lineHeight: lineHeight.micro,- opacity: 0.5,},agentSwitchModel: {color: colors.textSecondary,@@ -9171,7 +9178,8 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({paddingVertical: spacing.md,},payloadHeaderText: { flex: 1, minWidth: 0 },- payloadTitle: { color: colors.textPrimary, fontSize: typeScale.title, fontWeight: fontWeight.medium, lineHeight: lineHeight.title },+ // 面板大标题:§3 20/25 · 600。+ payloadTitle: { color: colors.textPrimary, fontSize: typeScale.title, fontWeight: fontWeight.semibold, lineHeight: lineHeight.title },payloadGalleryCount: {color: colors.textSecondary,fontSize: typeScale.caption,diff --git a/apps/mobile/src/session/MobileAgentSwitcher.tsx b/apps/mobile/src/session/MobileAgentSwitcher.tsxindex 7384329241..675a2a2c8b 100644--- a/apps/mobile/src/session/MobileAgentSwitcher.tsx+++ b/apps/mobile/src/session/MobileAgentSwitcher.tsx@@ -8,6 +8,7 @@ import { Pressable, StyleSheet, View } from 'react-native';import { Text } from '@/components/AppText';import { MobileAgentMark } from '@/components/MobileAgentMark';+import { mobileInteractionStyles } from '@/components/mobileInteractionStyles';import { useTheme, useThemedStyles, type ThemeColors } from '@/theme';import { fontWeight, iconSize, lineHeight, radius, spacing, typeScale } from '@/theme/tokens';@@ -47,18 +48,16 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({segmentDisabled: {opacity: 0.5,},- segmentPressed: {- opacity: 0.72,- },+ segmentPressed: mobileInteractionStyles.pressed,+ // 分段选项:选中只换色,字重恒为 500(mobile-design-guide §3);浅色字不配粗字重,故未选中用 textSecondary。text: {- color: colors.textTertiary,+ color: colors.textSecondary,fontSize: typeScale.footnote,lineHeight: lineHeight.caption,- fontWeight: fontWeight.regular,+ fontWeight: fontWeight.medium,},textActive: {color: colors.ctaText,- fontWeight: fontWeight.medium,},});@@ -90,7 +89,7 @@ export function MobileAgentSwitcher({ disabled = false, onChange, value }: Mobil<View accessibilityRole="tablist" style={styles.track} testID="modelSheet.agentSwitcher">{AGENTS.map((agent) => {const active = agent.kind === value;- const color = active ? colors.ctaText : colors.textTertiary;+ const color = active ? colors.ctaText : colors.textSecondary;return (<PressableaccessibilityLabel={t('models.agentSwitch.browseAccessibility', { agent: agent.label })}diff --git a/apps/mobile/src/session/MobileChoicePickerList.tsx b/apps/mobile/src/session/MobileChoicePickerList.tsxindex a9223ad859..4bb4df84fb 100644--- a/apps/mobile/src/session/MobileChoicePickerList.tsx+++ b/apps/mobile/src/session/MobileChoicePickerList.tsx@@ -6,6 +6,7 @@import { Pressable, StyleSheet, type StyleProp, type ViewStyle } from 'react-native';import { useTranslation } from 'react-i18next';import { Text } from '@/components/AppText';+import { mobileInteractionStyles } from '@/components/mobileInteractionStyles';import { Check } from 'lucide-react-native';import type { MobileChoiceOption } from '@/session/agentCapabilities';@@ -71,7 +72,7 @@ export function MobileChoicePickerList({styles.optionRow,rowStyle,selected && styles.optionRowSelected,- pressed && { opacity: 0.65 },+ pressed && mobileInteractionStyles.pressed,]}testID={testID}>diff --git a/apps/mobile/src/session/MobileComposerInputRow.tsx b/apps/mobile/src/session/MobileComposerInputRow.tsxindex 23fb10d97b..6be496ca77 100644--- a/apps/mobile/src/session/MobileComposerInputRow.tsx+++ b/apps/mobile/src/session/MobileComposerInputRow.tsx@@ -2,6 +2,7 @@ import { ComposerFrame, nativeComposerFrameAvailable } from './ComposerFrame';import {Animated,Platform,+ Pressable,Easing,StyleSheet,View,@@ -22,7 +23,8 @@ import { Mic } from 'lucide-react-native';import { useCallback, useEffect, useRef, type ReactNode, type Ref } from 'react';import { useTranslation } from 'react-i18next';import { iconSize, iconStroke, useTheme, useThemedStyles, type ThemeColors } from '@/theme';-import { radius, spacing } from '@/theme/tokens';+import { motionDuration, motionEasing, radius, spacing } from '@/theme/tokens';+import { useReduceMotionEnabled } from '@/hooks/useReduceMotion';import {COMPOSER_SINGLE_LINE_HEIGHT,COMPOSER_TEXT_HORIZONTAL_PADDING,@@ -80,6 +82,14 @@ const isExpoGo =Constants.executionEnvironment === ExecutionEnvironment.StoreClient;export interface MobileComposerInputRowProps {+ entryTransitionId?: string;+ onEntryTransitionComplete?(): void;+ /** Compact (non-card) outer height; on the iOS composer dock it matches the new-task button. */+ collapsedHeight?: number;+ /** When set, a tap on the compact input calls this instead of focusing directly. */+ onCollapsedPress?(): void;+ /** See ComposerFrame; changes when onCollapsedPress opens the pill. */+ expandToken?: string;accessibilityHint?: string;accessibilityLabel: string;/**@@ -188,6 +198,11 @@ export interface MobileComposerInputRowProps {* button placement. Page-specific actions stay injected as slots.*/export function MobileComposerInputRow({+ entryTransitionId,+ onEntryTransitionComplete,+ collapsedHeight,+ onCollapsedPress,+ expandToken,accessibilityHint,accessibilityLabel,accessoryAbove,@@ -242,6 +257,12 @@ export function MobileComposerInputRow({// 但 mode/manual 与多行草稿判定仍会让 multilineShape 为 true;若据此关掉几何居中,// 收起态文字会继续走 iOS 6/0 光学偏移,对不齐新增的 34pt +。const geometricSingleLine = !cardLayout;+ // iOS composer dock pill: every end control sits concentric with the pill,+ // i.e. its visible circle is as far from the pill edge as from the top and+ // bottom. The leading attachment keeps its 44pt hit area (its visible 34pt+ // circle is centred in it), so the row's left padding gives back that slack.+ const concentricInset = geometricSingleLine && collapsedHeight != null+ ? Math.max(0, (collapsedHeight - MOBILE_COMPOSER_CONTROL_SIZE) / 2) : null;// RN 里显式 height 压过 minHeight:manual 定高(用户拖过高度)时 frameHeight 可能小于// inputFrameMinHeight,直接铺开会把听写停止命中区又压回不足 44pt。数值高度在这里// 先 clamp;拖拽中的 Animated 值无法在 JS 侧 clamp(会打断跟手),那一瞬保持动画值,@@ -297,12 +318,20 @@ export function MobileComposerInputRow({);return (<ComposerFrame+ entryTransitionId={entryTransitionId}+ onEntryTransitionComplete={onEntryTransitionComplete}+ expandToken={expandToken}expanded={cardLayout}unframed={frameOutside}style={[styles.row,compact && styles.rowCompact,geometricSingleLine && styles.rowCollapsedTouch,+ geometricSingleLine && collapsedHeight != null && { minHeight: collapsedHeight },+ concentricInset != null && {+ paddingLeft: Math.max(0, concentricInset - (MOBILE_COMPOSER_MIN_TOUCH_TARGET - MOBILE_COMPOSER_CONTROL_SIZE) / 2),+ paddingRight: concentricInset,+ },!geometricSingleLine && multilineShape && styles.rowMultiline,cardLayout && styles.rowCard,Platform.OS === 'ios' && cardLayout && styles.rowNativeCard,@@ -339,6 +368,11 @@ export function MobileComposerInputRow({</TextInputWrapper>) : textInputElement)}{inputOverlay}+ {!cardLayout && onCollapsedPress ? (+ // VoiceOver still reaches the input itself and focuses it directly.+ <Pressable accessible={false} importantForAccessibility="no-hide-descendants"+ onPress={onCollapsedPress} style={StyleSheet.absoluteFill} testID={testID ? `${testID}.collapsedOpen` : undefined} />+ ) : null}</Reanimated.View>{cardLayout ? null : trailing}</View>@@ -361,6 +395,13 @@ export function MobileComposerInputRow({cardLayout,floating: voicePlacement.floating,}),+ // Same concentric inset as the leading control; when floating it+ // steps left of the trailing send / create button.+ concentricInset != null && {+ right: voicePlacement.floating+ ? concentricInset + MOBILE_COMPOSER_CONTROL_SIZE + MOBILE_COMPOSER_TOOL_GAP+ : concentricInset,+ },]}>{floatingVoiceButton?.(floatingVoiceButtonStyle)}@@ -454,17 +495,23 @@ export function ComposerResizeGrabber({ onAdjust, panHandlers, gesture, visible,const { t } = useTranslation();const styles = useThemedStyles(makeMobileComposerInputRowStyles);const opacity = useRef(new Animated.Value(visible ? 1 : 0)).current;+ const reduceMotion = useReduceMotionEnabled();useEffect(() => {+ // 透明度状态切换档 motionDuration.fast(§14.4);出现用 out、消失用 in;减弱动态效果直接到位。+ if (reduceMotion !== false) {+ opacity.setValue(visible ? 1 : 0);+ return undefined;+ }const animation = Animated.timing(opacity, {- duration: 150,- easing: Easing.out(Easing.ease),+ duration: motionDuration.fast,+ easing: visible ? Easing.bezier(...motionEasing.out) : Easing.bezier(...motionEasing.in),toValue: visible ? 1 : 0,useNativeDriver: true,});animation.start();return () => animation.stop();- }, [opacity, visible]);+ }, [opacity, reduceMotion, visible]);return (<Animated.View@@ -495,25 +542,35 @@ export function ComposerResizeGrabber({ onAdjust, panHandlers, gesture, visible,);}+/** 语音波形:常驻「正在听」状态信号,非交互过渡,不套 motionDuration 交互档位。 */+const VOICE_WAVE_HALF_CYCLE_MS = 550;+const VOICE_WAVE_STAGGER_MS = 180;+export function VoiceMicWaveCaret({ color, testID, viewRef }: { color: string; testID?: string; viewRef?: Ref<View> }) {const styles = useThemedStyles(makeMobileComposerInputRowStyles);const bar1 = useRef(new Animated.Value(0)).current;const bar2 = useRef(new Animated.Value(0)).current;const bar3 = useRef(new Animated.Value(0)).current;+ const reduceMotion = useReduceMotionEnabled();useEffect(() => {const bars = [bar1, bar2, bar3] as const;+ // 常驻循环:减弱动态效果(含未查询到的首帧)下静止在满幅,侧短中长的静态波形。+ if (reduceMotion !== false) {+ bars.forEach((bar) => bar.setValue(1));+ return undefined;+ }const loops = bars.map((bar, index) => Animated.loop(Animated.sequence([- Animated.delay(index * 180),+ Animated.delay(index * VOICE_WAVE_STAGGER_MS),Animated.timing(bar, {- duration: 550,+ duration: VOICE_WAVE_HALF_CYCLE_MS,easing: Easing.inOut(Easing.ease),toValue: 1,useNativeDriver: true,}),Animated.timing(bar, {- duration: 550,+ duration: VOICE_WAVE_HALF_CYCLE_MS,easing: Easing.inOut(Easing.ease),toValue: 0,useNativeDriver: true,@@ -524,7 +581,7 @@ export function VoiceMicWaveCaret({ color, testID, viewRef }: { color: string; treturn () => {loops.forEach((loop) => loop.stop());};- }, [bar1, bar2, bar3]);+ }, [bar1, bar2, bar3, reduceMotion]);const animatedBarStyle = (bar: Animated.Value) => ({opacity: bar.interpolate({diff --git a/apps/mobile/src/session/MobileModelPickerList.tsx b/apps/mobile/src/session/MobileModelPickerList.tsxindex 11b8b07cc2..67f36f5cfe 100644--- a/apps/mobile/src/session/MobileModelPickerList.tsx+++ b/apps/mobile/src/session/MobileModelPickerList.tsx@@ -18,6 +18,7 @@import { Pressable, StyleSheet, View, type StyleProp, type ViewStyle } from 'react-native';import { useTranslation } from 'react-i18next';import { Text } from '@/components/AppText';+import { mobileInteractionStyles } from '@/components/mobileInteractionStyles';import { Check, SlidersHorizontal, Zap } from 'lucide-react-native';import type { MobileAgentCapabilities, MobileModelOption } from '@/session/agentCapabilities';@@ -277,7 +278,7 @@ export function MobileModelPickerList({rowStyle,selected && styles.optionRowSelected,rowDisabled && styles.optionRowDisabled,- pressed && { opacity: 0.65 },+ pressed && mobileInteractionStyles.pressed,]}testID={testID}>@@ -331,7 +332,7 @@ export function MobileModelPickerList({disabled={disabled}hitSlop={6}onPress={() => onOpenOptions({ providerId: row.provider.id, modelId: row.model.id })}- style={({ pressed }) => [styles.optionsButton, pressed && { opacity: 0.65 }]}+ style={({ pressed }) => [styles.optionsButton, pressed && mobileInteractionStyles.pressed]}testID={`${testID}.optionsButton`}><SlidersHorizontal color={colors.textTertiary} size={iconSize.md} strokeWidth={iconStroke.regular} />@@ -395,7 +396,7 @@ export function MobileModelPickerList({styles.optionRow,rowStyle,selected && styles.optionRowSelected,- pressed && { opacity: 0.65 },+ pressed && mobileInteractionStyles.pressed,]}testID={testID}>@@ -428,7 +429,7 @@ export function MobileModelPickerList({disabled={disabled}hitSlop={6}onPress={() => onOpenOptions({ providerId: null, modelId: option.id })}- style={({ pressed }) => [styles.optionsButton, pressed && { opacity: 0.65 }]}+ style={({ pressed }) => [styles.optionsButton, pressed && mobileInteractionStyles.pressed]}testID={`${testID}.optionsButton`}><SlidersHorizontal color={colors.textTertiary} size={iconSize.md} strokeWidth={iconStroke.regular} />diff --git a/apps/mobile/src/session/MobilePermissionPickerList.tsx b/apps/mobile/src/session/MobilePermissionPickerList.tsxindex fc851e0d05..ad190918b7 100644--- a/apps/mobile/src/session/MobilePermissionPickerList.tsx+++ b/apps/mobile/src/session/MobilePermissionPickerList.tsx@@ -8,6 +8,7 @@import { Pressable, StyleSheet, type StyleProp, type ViewStyle } from 'react-native';import { useTranslation } from 'react-i18next';import { Text } from '@/components/AppText';+import { mobileInteractionStyles } from '@/components/mobileInteractionStyles';import { Check } from 'lucide-react-native';import type { MobileChoiceOption } from '@/session/agentCapabilities';@@ -81,7 +82,7 @@ export function MobilePermissionPickerList({styles.optionRow,rowStyle,selected && styles.optionRowSelected,- pressed && { opacity: 0.65 },+ pressed && mobileInteractionStyles.pressed,]}testID={testID}>diff --git a/apps/mobile/src/session/ModelOptionsSheetView.ios.tsx b/apps/mobile/src/session/ModelOptionsSheetView.ios.tsxindex 3d81e954c7..eeeebaa1d9 100644--- a/apps/mobile/src/session/ModelOptionsSheetView.ios.tsx+++ b/apps/mobile/src/session/ModelOptionsSheetView.ios.tsx@@ -1,6 +1,7 @@import { ComposerNativeSection as Section } from './ComposerNativeSection';import { Text, Toggle } from '@expo/ui/swift-ui';-import { disabled } from "@expo/ui/swift-ui/modifiers";+import { disabled, tint } from "@expo/ui/swift-ui/modifiers";+import { useTheme } from "@/theme";import { useTranslation } from "react-i18next";import type { ModelOptionsSheetViewProps } from "./ModelOptionsSheetView";import { ComposerNativeRow } from "./ComposerNativeRow";@@ -15,6 +16,7 @@ import {} from "./modelPickerRows";export function ModelOptionsSheetView(p: ModelOptionsSheetViewProps) {const { t } = useTranslation();+ const { colors } = useTheme();useDraftModelMemoryVersion();useSessionModelMirrorVersion();const meta = buildRowMetaLine({@@ -78,7 +80,8 @@ export function ModelOptionsSheetView(p: ModelOptionsSheetViewProps) {value,);}}- modifiers={[disabled(!!p.disabled)]}+ // 表单 Toggle 显式用统一开关蓝,不继承 Host 的 textPrimary 黑白 seed。+ modifiers={[disabled(!!p.disabled), tint(colors.inputCaret)]}testID={`${p.testID}.fastToggle`}/></Section>diff --git a/apps/mobile/src/session/ModelOptionsSheetView.tsx b/apps/mobile/src/session/ModelOptionsSheetView.tsxindex a31f22c2a2..8efeab2a3b 100644--- a/apps/mobile/src/session/ModelOptionsSheetView.tsx+++ b/apps/mobile/src/session/ModelOptionsSheetView.tsx@@ -13,6 +13,7 @@ import { useTranslation } from "react-i18next";import { Text } from "@/components/AppText";import { Check } from "lucide-react-native";import { NativeSwitch } from "@/platform/chrome";+import { mobileInteractionStyles } from "@/components/mobileInteractionStyles";import type { MobileAgentCapabilities } from "@/session/agentCapabilities";import type { MobileModelPricingMap } from "@/device-link/mobileMakerTransport";@@ -263,7 +264,7 @@ export function ModelOptionsSheetView({accessibilityLabel={t("models.options.fastMode")}disabled={disabled}onValueChange={setFast}- seedColor={colors.cta}+ seedColor={colors.inputCaret}testID={`${testID}.fastToggle`}value={fastOn}/>@@ -292,7 +293,7 @@ export function ModelOptionsSheetView({style={({ pressed }) => [styles.effortOptionRow,effortSelected && styles.effortOptionRowSelected,- pressed && { opacity: 0.65 },+ pressed && mobileInteractionStyles.pressed,]}testID={`${testID}.effortOption`}>diff --git a/apps/mobile/src/session/ModelPickerSheet.tsx b/apps/mobile/src/session/ModelPickerSheet.tsxindex 71053404fb..e5a777a9e5 100644--- a/apps/mobile/src/session/ModelPickerSheet.tsx+++ b/apps/mobile/src/session/ModelPickerSheet.tsx@@ -10,6 +10,7 @@ import { useTranslation } from 'react-i18next';import { ChevronDown, Search } from 'lucide-react-native';import {Animated,+ Easing,Platform,Pressable,ScrollView,@@ -52,14 +53,16 @@ import {type ProviderModelRow,} from '@/session/providerModelSections';import { iconSize, iconStroke, useTheme, useThemedStyles, type ThemeColors } from '@/theme';-import { fontWeight, lineHeight, radius, spacing, typeScale } from '@/theme/tokens';+import { fontWeight, lineHeight, motionDuration, motionEasing, radius, spacing, typeScale } from '@/theme/tokens';+import { useReduceMotionEnabled } from '@/hooks/useReduceMotion';import {mobileAgentLabel,type MobileSessionAgentKind,} from '@/session/sessionAgentSwitch';-/** 二级 Surface 滑入/滑出时长(对齐 useContextSheetDrag 的 SNAP_ANIMATION_DURATION_MS)。 */-const SECONDARY_SLIDE_DURATION_MS = 180;+/** 二级 Surface 是重浮层:入场 enter / 退场 exit(DESIGN.md §14.4);减弱动态效果直接到位。 */+const SECONDARY_SLIDE_IN_EASING = Easing.bezier(...motionEasing.out);+const SECONDARY_SLIDE_OUT_EASING = Easing.bezier(...motionEasing.in);/** provider-aware 模式下传给列表的空 flat 集(身份稳定,防无谓重渲)。 */const EMPTY_FLAT_OPTIONS: readonly MobileModelOption[] = [];@@ -248,6 +251,8 @@ function LegacyModelPickerSheet({const noResults = hasQuery && providerRows.length === 0 && effectiveFlatOptions.length === 0;// —— 二级视图开合(translateY 滑入滑出,动画期间锁重复触发) ——+ const reduceMotion = useReduceMotionEnabled();+ const animateSecondary = reduceMotion === false;const openSecondary = useCallback((next: ModelPickerSheetView) => {if (Platform.OS === 'ios') { setView(next); return; }@@ -257,14 +262,15 @@ function LegacyModelPickerSheet({setView(next);secondaryTranslate.setValue(windowHeight);Animated.timing(secondaryTranslate, {- duration: SECONDARY_SLIDE_DURATION_MS,+ duration: animateSecondary ? motionDuration.enter : 0,+ easing: SECONDARY_SLIDE_IN_EASING,toValue: 0,useNativeDriver: true,}).start(() => {secondaryAnimatingRef.current = false;});},- [secondaryTranslate, windowHeight],+ [animateSecondary, secondaryTranslate, windowHeight],);// 行内配置图标 → 二级「模型选项」:useCallback 稳定引用,避免每次 render 都给// MobileModelPickerList 递新函数(破坏其下行组件的 memo 短路)。@@ -278,14 +284,15 @@ function LegacyModelPickerSheet({if (secondaryAnimatingRef.current) return;secondaryAnimatingRef.current = true;Animated.timing(secondaryTranslate, {- duration: SECONDARY_SLIDE_DURATION_MS,+ duration: animateSecondary ? motionDuration.exit : 0,+ easing: SECONDARY_SLIDE_OUT_EASING,toValue: windowHeight,useNativeDriver: true,}).start(() => {secondaryAnimatingRef.current = false;setView({ kind: 'models' });});- }, [secondaryTranslate, windowHeight]);+ }, [animateSecondary, secondaryTranslate, windowHeight]);// Android 返回键 / iOS 关闭手势:两段式(二级先回一级,一级才关浮窗)。const handleRequestClose = useCallback(() => {diff --git a/apps/mobile/src/session/NewTaskSelectionSheet.ios.tsx b/apps/mobile/src/session/NewTaskSelectionSheet.ios.tsxindex 9276fcc267..a702a488a4 100644--- a/apps/mobile/src/session/NewTaskSelectionSheet.ios.tsx+++ b/apps/mobile/src/session/NewTaskSelectionSheet.ios.tsx@@ -1,5 +1,5 @@import { Button, Image, Picker, ProgressView, Text, Toggle } from '@expo/ui/swift-ui';-import { disabled, font, foregroundStyle, frame, pickerStyle, tag } from '@expo/ui/swift-ui/modifiers';+import { disabled, font, foregroundStyle, frame, pickerStyle, tag, tint } from '@expo/ui/swift-ui/modifiers';import { useTranslation } from 'react-i18next';import { iconSize, useTheme } from '@/theme';import { ComposerSheet } from './ComposerSheet';@@ -72,7 +72,7 @@ export function NewTaskSelectionSheet(p: NewTaskSelectionSheetProps) {{p.drives.map(drive => <Text key={drive.path} modifiers={[tag(drive.path)]}>{drive.name}</Text>)}</Picker> : null}<Toggle label={newSessionText('showHiddenDirectories')} isOn={p.showHidden}- onIsOnChange={p.onShowHidden} modifiers={[disabled(p.busy)]} testID="newSession.remoteBrowseShowHidden" />+ onIsOnChange={p.onShowHidden} modifiers={[disabled(p.busy), tint(colors.inputCaret)]} testID="newSession.remoteBrowseShowHidden" /></Section>{p.loading ? <Section><ProgressView /></Section> : null}{p.error ? <Section><Text modifiers={[foregroundStyle(colors.errorText)]}>{p.error}</Text></Section> : null}diff --git a/apps/mobile/src/session/PluginInvocationHeader.tsx b/apps/mobile/src/session/PluginInvocationHeader.tsxindex 1690fae681..727a797f9f 100644--- a/apps/mobile/src/session/PluginInvocationHeader.tsx+++ b/apps/mobile/src/session/PluginInvocationHeader.tsx@@ -58,7 +58,7 @@ function PluginInvocationRow({ plugin, running, deviceId, sessionId, showComplet</Animated.View><View>{iconUrl ? <Image source={{ uri: iconUrl }} style={{ width: 18, height: 18, borderRadius: radius.pill }} /> : <Ghost size={iconSize.sm} color={colors.textSecondary} />}</View>{!running && showCompletionBadge && <View style={[styles.check, { backgroundColor: colors.statusDone }]}>- <Check size={iconSize.xs} color={colors.surface} strokeWidth={iconStroke.regular} />+ <Check size={iconSize.xs} color={colors.ctaText} strokeWidth={iconStroke.regular} /></View>}</View><Text style={[styles.name, { color: colors.textSecondary }]}>{name}</Text>diff --git a/apps/mobile/src/session/RenameDeviceModal.tsx b/apps/mobile/src/session/RenameDeviceModal.tsxindex e56e152e4f..01c1638a36 100644--- a/apps/mobile/src/session/RenameDeviceModal.tsx+++ b/apps/mobile/src/session/RenameDeviceModal.tsx@@ -1,4 +1,4 @@-import { Modal, Pressable, StyleSheet } from 'react-native';+import { Modal, StyleSheet, View } from 'react-native';import { ModalContentArea } from '@/platform/ModalContentArea';import { useTranslation } from 'react-i18next';import { Text, TextInput } from '@/components/AppText';@@ -40,17 +40,18 @@ export function RenameDeviceModal({animationType="fade"transparentvisible={visible}- onRequestClose={onCancel}+ // 带取消按钮的对话框:点背景不关闭;保存中连 Android 返回键也不关闭。+ onRequestClose={() => {+ if (!saving) onCancel();+ }}>- <Pressable+ <Viewstyle={styles.renameDeviceBackdrop}- onPress={onCancel}testID="home.renameDevice.backdrop"><ModalContentArea>- <Pressable+ <Viewstyle={styles.renameDeviceCard}- onPress={() => undefined}testID="home.renameDevice.modal"><Text style={styles.renameDeviceTitle}>@@ -86,9 +87,7 @@ export function RenameDeviceModal({: t('devices.list.renameDevice.saveA11y'),busy: saving,disabled: !canSave,- label: saving- ? t('devices.common.saving')- : t('devices.common.save'),+ label: t('devices.common.save'),onPress: onConfirm,testID: 'home.renameDevice.save',tone: 'primary',@@ -103,16 +102,17 @@ export function RenameDeviceModal({}}testID="home.renameDevice.actions"/>- </Pressable>+ </View></ModalContentArea>- </Pressable>+ </View></Modal>);}const makeStyles = (colors: ThemeColors) =>StyleSheet.create({- error: { color: colors.destructive, fontSize: typeScale.body, lineHeight: lineHeight.body },+ // 报错说明:13/18 errorText(黑白系),红色只留给状态点与破坏性按钮。+ error: { color: colors.errorText, fontSize: typeScale.footnote, fontWeight: fontWeight.regular, lineHeight: lineHeight.caption },renameDeviceBackdrop: {alignItems: 'center',backgroundColor: colors.overlay,@@ -136,15 +136,16 @@ const makeStyles = (colors: ThemeColors) =>fontWeight: fontWeight.semibold,lineHeight: lineHeight.title,},+ // 单行输入统一胶囊形(与登录、设置的单行输入一致)。renameDeviceInput: {backgroundColor: colors.surface,borderColor: colors.border,- borderRadius: radius.container,+ borderRadius: radius.pill,borderWidth: StyleSheet.hairlineWidth,color: colors.textPrimary,fontSize: typeScale.body,minHeight: 48,- paddingHorizontal: spacing.md,+ paddingHorizontal: spacing.lg,paddingVertical: spacing.sm,},});diff --git a/apps/mobile/src/session/RenameSessionModal.tsx b/apps/mobile/src/session/RenameSessionModal.tsxindex 0c527e3d6b..37fd12cfcb 100644--- a/apps/mobile/src/session/RenameSessionModal.tsx+++ b/apps/mobile/src/session/RenameSessionModal.tsx@@ -1,4 +1,4 @@-import { Modal, Pressable, StyleSheet } from 'react-native';+import { Modal, StyleSheet, View } from 'react-native';import { ModalContentArea } from '@/platform/ModalContentArea';import { useTranslation } from 'react-i18next';import { Text, TextInput } from '@/components/AppText';@@ -27,10 +27,14 @@ export function RenameSessionModal({const { t } = useTranslation();const canSave = draft.trim().length > 0 && !saving;return (- <Modal supportedOrientations={["portrait", "portrait-upside-down", "landscape-left", "landscape-right"]} animationType="fade" transparent visible={visible} onRequestClose={onCancel}>- <Pressable style={styles.backdrop} onPress={onCancel} testID="home.renameSession.backdrop">+ <Modal supportedOrientations={["portrait", "portrait-upside-down", "landscape-left", "landscape-right"]} animationType="fade" transparent visible={visible}+ // 带取消按钮的对话框:点背景不关闭;保存中连 Android 返回键也不关闭。+ onRequestClose={() => {+ if (!saving) onCancel();+ }}>+ <View style={styles.backdrop} testID="home.renameSession.backdrop"><ModalContentArea>- <Pressable style={styles.card} onPress={() => undefined} testID="home.renameSession.modal">+ <View style={styles.card} testID="home.renameSession.modal"><Text style={styles.title}>{t('devices.list.renameSession.title')}</Text><TextInputautoFocus@@ -60,16 +64,16 @@ export function RenameSessionModal({accessibilityLabel: saving ? t('devices.list.renameSession.savingA11y') : t('devices.list.renameSession.saveA11y'),busy: saving,disabled: !canSave,- label: saving ? t('devices.common.saving') : t('devices.common.save'),+ label: t('devices.common.save'),onPress: onConfirm,testID: 'home.renameSession.save',tone: 'primary',}]}testID="home.renameSession.actions"/>- </Pressable>+ </View></ModalContentArea>- </Pressable>+ </View></Modal>);}@@ -98,15 +102,16 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({fontWeight: fontWeight.semibold,lineHeight: lineHeight.title,},+ // 单行输入统一胶囊形(与登录、设置的单行输入一致)。input: {backgroundColor: colors.surface,borderColor: colors.border,- borderRadius: radius.container,+ borderRadius: radius.pill,borderWidth: StyleSheet.hairlineWidth,color: colors.textPrimary,fontSize: typeScale.body,minHeight: 48,- paddingHorizontal: spacing.md,+ paddingHorizontal: spacing.lg,paddingVertical: spacing.sm,},});diff --git a/apps/mobile/src/session/SessionActionSheet.tsx b/apps/mobile/src/session/SessionActionSheet.tsxindex d57401df2e..4e920b1173 100644--- a/apps/mobile/src/session/SessionActionSheet.tsx+++ b/apps/mobile/src/session/SessionActionSheet.tsx@@ -50,10 +50,13 @@ import {import {fontWeight,lineHeight,+ motionDuration,+ motionEasing,radius,spacing,typeScale,} from "@/theme/tokens";+import { useReduceMotionEnabled } from "@/hooks/useReduceMotion";/** 卡片滑入距离(略大于卡片实高即可,滑入曲线吃掉误差)。 */const CARD_SLIDE_DISTANCE = 360;@@ -96,27 +99,38 @@ export function SessionActionSheet({const insets = useSafeAreaInsets();const [mounted, setMounted] = useState(visible);const progress = useRef(new Animated.Value(visible ? 1 : 0)).current;+ // 只有明确 === false 才播动画;null(尚未查到)/ true 一律直接显示 / 隐藏。+ const animate = useReduceMotionEnabled() === false;useEffect(() => {if (visible) {setMounted(true);+ if (!animate) {+ progress.setValue(1);+ return;+ }Animated.timing(progress, {- duration: 220,- easing: Easing.out(Easing.cubic),+ duration: motionDuration.enter,+ easing: Easing.bezier(...motionEasing.out),toValue: 1,useNativeDriver: true,}).start();} else {+ if (!animate) {+ progress.setValue(0);+ setMounted(false);+ return;+ }Animated.timing(progress, {- duration: 160,- easing: Easing.in(Easing.quad),+ duration: motionDuration.exit,+ easing: Easing.bezier(...motionEasing.in),toValue: 0,useNativeDriver: true,}).start(({ finished }) => {if (finished) setMounted(false);});}- }, [visible, progress]);+ }, [animate, visible, progress]);// onClosed 等 Modal 真正从树上卸载后再触发(同 DeviceMenuModal:动画回调里同步挂// 第二个 Modal 会和本 Modal 的卸载挤进同一个 commit,iOS 可能吞掉新弹窗)。diff --git a/apps/mobile/src/session/SessionHeaderNativeControls.ios.tsx b/apps/mobile/src/session/SessionHeaderNativeControls.ios.tsxindex f16553c55b..497b971894 100644--- a/apps/mobile/src/session/SessionHeaderNativeControls.ios.tsx+++ b/apps/mobile/src/session/SessionHeaderNativeControls.ios.tsx@@ -32,7 +32,6 @@ import {iconSize,iconStroke,lineHeight,- radius,spacing,typeScale,fontWeight,@@ -46,6 +45,19 @@ import type {} from "./SessionHeaderNativeControls";/** A stationary, feathered backdrop: scrolling content passes beneath it. */+/** Fade length at the content edge; the chrome area itself stays fully blurred. */+const BLUR_FADE = 32;+/**+ * A two-stop gradient left the title row at roughly half blur, so text that+ * scrolled under a header stayed legible and read as overlapping it. Keep the+ * mask opaque over the chrome and fade only the last BLUR_FADE points+ * (evenly spaced stops approximate the break point).+ */+function blurMaskStops(height: number): string[] {+ const solid = Math.max(1, Math.round(height / Math.min(BLUR_FADE, height / 2)) - 1);+ return [...Array<string>(solid).fill("black"), "transparent"];+}+export function SessionHeaderNativeBlur({ height, edge = 'top', inset = 0 }: { height: number; edge?: 'top' | 'bottom'; inset?: number }) {const { mode } = useTheme();return (@@ -74,7 +86,7 @@ export function SessionHeaderNativeBlur({ height, edge = 'top', inset = 0 }: { hforegroundStyle({type: "linearGradient",// Mask colors encode alpha only; they never tint the content.- colors: edge === 'top' ? ["black", "transparent"] : ["transparent", "black"],+ colors: edge === 'top' ? blurMaskStops(height) : blurMaskStops(height).reverse(),startPoint: { x: 0.5, y: 0 },endPoint: { x: 0.5, y: 1 },}),@@ -95,11 +107,9 @@ export function SessionHeaderNativeTitle({ title,const style = {alignSelf: 'center' as const,maxWidth: '100%' as const,- borderRadius: radius.pill,minHeight: 44,justifyContent: "center" as const,paddingHorizontal: spacing.xs / 2,- overflow: "hidden" as const,};const label = (<Text@@ -122,14 +132,14 @@ export function SessionHeaderNativeTitle({ title,return (<View style={{ flex: 1, minWidth: 0, justifyContent: 'center' }}><View style={style}>- <BlurBackdrop intensity={20} overlayColor={colors.surfaceTranslucent} />+ {/* The title sits directly on the bar: no capsule material behind it. */}<View style={{ flexDirection: "row", minWidth: 0, alignItems: "center", justifyContent: "center", gap: spacing.xs }}>{pinned ? <Pin color={colors.textTertiary} size={iconSize.sm} strokeWidth={iconStroke.regular} /> : null}{label}<TaskTagDotstags={tags}maxVisible={7}- surfaceColor={colors.surfaceTranslucent}+ surfaceColor={colors.surface}onPress={onTagsPress}/><QuietSyncIndicator active={syncing} immediate={syncingImmediately} />diff --git a/apps/mobile/src/session/SessionMenuSheet.tsx b/apps/mobile/src/session/SessionMenuSheet.tsxindex fcf9838e61..599f620d7e 100644--- a/apps/mobile/src/session/SessionMenuSheet.tsx+++ b/apps/mobile/src/session/SessionMenuSheet.tsx@@ -36,6 +36,7 @@ import {ActivityIndicator,Alert,Animated,+ Easing,Pressable,Platform,StyleSheet,@@ -46,7 +47,7 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context';import { useTranslation } from 'react-i18next';import { mobilePresentationLocalizer } from '@/i18n/presentationLocalizer';import { Text, TextInput } from '@/components/AppText';-import { MainWindowActionGroup } from '@/components/MobilePrimitives';+import { MainWindowActionButton, MainWindowActionGroup } from '@/components/MobilePrimitives';import type { MobileMakerTransport, RemoteDirectoryEntry } from '@/device-link/mobileMakerTransport';import type { MobileCodexRateLimitsResult } from '@cindy/maker-shared/device-link-contract';import { projectDraftSessionTitle } from '@cindy/maker-shared/session-title';@@ -85,10 +86,9 @@ import { SheetSurface } from '@/session/SheetSurface';import { SessionDetailsNative, SessionDetailsNativeActions } from './SessionDetailsNative';import type { RemoteSession } from '@/session/types';import { iconSize, iconStroke, monoFont, useTheme, useThemedStyles, type ThemeColors } from '@/theme';-import { fontWeight, lineHeight, radius, spacing, typeScale } from '@/theme/tokens';+import { fontWeight, lineHeight, motionDuration, motionEasing, radius, spacing, typeScale } from '@/theme/tokens';+import { useReduceMotionEnabled } from '@/hooks/useReduceMotion';-/** 二级 Surface 滑入/滑出时长(对齐 useContextSheetDrag 的 SNAP_ANIMATION_DURATION_MS)。 */-const SECONDARY_SLIDE_DURATION_MS = 180;/** 复制反馈(行内文案临时替换)展示时长。 */const COPY_FEEDBACK_MS = 1500;@@ -104,6 +104,8 @@ export interface SessionExtraDirBrowserState {export interface SessionMenuSheetProps {tagDeviceId?: string;providerName?: string;+ /** 当前模型在模型目录里的用户可读展示名(用量卡显示;缺席时卡片自行兜底)。 */+ modelLabel?: string | null;messageOnly?: boolean;onOpenSearch?: () => void;accountProvider?: OpenAiAccountProvider;@@ -150,6 +152,7 @@ export interface SessionMenuSheetProps {export function SessionMenuSheet({tagDeviceId,providerName,+ modelLabel,messageOnly = false,onOpenSearch,usageReader,@@ -217,6 +220,8 @@ export function SessionMenuSheet({const renameSeqRef = useRef(0);// 二级 Surface 滑入/滑出动画(0 = 就位;windowHeight = 屏下)。动画期间锁交互防连点。const secondaryTranslate = useRef(new Animated.Value(windowHeight)).current;+ // 只有明确 === false 才播二级滑入/滑出(null / true 直接就位)。+ const animateSecondary = useReduceMotionEnabled() === false;const secondaryAnimatingRef = useRef(false);const copyTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);@@ -279,28 +284,42 @@ export function SessionMenuSheet({secondaryAnimatingRef.current = true;setSecondarySnap('half');setView('info');+ // 二级 Surface 滑入 = 重浮层入场档;减弱动态效果(或偏好未查到)时直接就位。+ if (!animateSecondary) {+ secondaryTranslate.setValue(0);+ secondaryAnimatingRef.current = false;+ return;+ }secondaryTranslate.setValue(windowHeight);Animated.timing(secondaryTranslate, {- duration: SECONDARY_SLIDE_DURATION_MS,+ duration: motionDuration.enter,+ easing: Easing.bezier(...motionEasing.out),toValue: 0,useNativeDriver: true,}).start(() => {secondaryAnimatingRef.current = false;});- }, [secondaryTranslate, view, windowHeight]);+ }, [animateSecondary, secondaryTranslate, view, windowHeight]);const backToMenu = useCallback(() => {if (secondaryAnimatingRef.current) return;secondaryAnimatingRef.current = true;+ if (!animateSecondary) {+ secondaryTranslate.setValue(windowHeight);+ secondaryAnimatingRef.current = false;+ setView('menu');+ return;+ }Animated.timing(secondaryTranslate, {- duration: SECONDARY_SLIDE_DURATION_MS,+ duration: motionDuration.exit,+ easing: Easing.bezier(...motionEasing.in),toValue: windowHeight,useNativeDriver: true,}).start(() => {secondaryAnimatingRef.current = false;setView('menu');});- }, [secondaryTranslate, windowHeight]);+ }, [animateSecondary, secondaryTranslate, windowHeight]);// Android 返回键 / iOS 关闭手势:两段式(info 先回 menu,menu 才关浮窗)。const handleRequestClose = useCallback(() => {@@ -593,7 +612,7 @@ export function SessionMenuSheet({</View>)}- {!messageOnly ? <SessionUsageSummary providerName={providerName} session={session} usage={menuUsage} contextUsage={contextUsage} onPress={openInfo} translucent={Platform.OS === 'ios'} /> : null}+ {!messageOnly ? <SessionUsageSummary modelLabel={modelLabel} providerName={providerName} session={session} usage={menuUsage} contextUsage={contextUsage} onPress={openInfo} translucent={Platform.OS === 'ios'} /> : null}{!messageOnly && isSharedTaskPeer(session.deviceLinkDeviceId) && onLeaveSharing ? (Platform.OS === 'ios' ? <SessionDetailsNativeActions actions={[{@@ -707,7 +726,7 @@ export function SessionMenuSheet({const infoContent = (<View style={styles.infoBody} testID="session.infoSheetBody">- <SessionUsageSummary providerName={providerName} session={session} usage={menuUsage} contextUsage={contextUsage} detail translucent={Platform.OS === 'ios'} />+ <SessionUsageSummary modelLabel={modelLabel} providerName={providerName} session={session} usage={menuUsage} contextUsage={contextUsage} detail translucent={Platform.OS === 'ios'} /><View style={styles.infoSection}><View style={styles.infoSectionHeader}><Text style={styles.infoSectionTitle}>{t('session.menu.usageSection')}</Text>@@ -715,6 +734,7 @@ export function SessionMenuSheet({accessibilityLabel={t('session.menu.refreshContextUsage')}accessibilityRole="button"disabled={contextLoading}+ hitSlop={6}onPress={() => { onRefreshContextUsage(); menuUsage.refresh(); onRefreshAccountUsage(); }}style={({ pressed }) => [styles.refreshButton, pressed && styles.pressed]}testID="session.contextRefreshButton"@@ -753,8 +773,8 @@ export function SessionMenuSheet({</Text><View style={styles.infoActionRow}><MenuPillButton- disabled={codexResetBusy}- label={codexResetBusy ? t('session.menu.resetting') : t('session.menu.resetCodexUsage')}+ busy={codexResetBusy}+ label={t('session.menu.resetCodexUsage')}onPress={confirmCodexReset}testID="session.codexRateLimitResetButton"tone="primary"@@ -889,7 +909,7 @@ export function SessionMenuSheet({<MainWindowActionGroupprimaryActions={[{accessibilityLabel: t('session.menu.confirmRename'),- label: t('session.menu.confirm'),+ label: t('session.menu.renameSubmit'),onPress: submitRename,testID: 'session.renameButton',tone: 'primary',@@ -1049,42 +1069,34 @@ function MenuActionRow({);}+/** 信息面板内的紧凑操作按钮:统一走共享 MainWindowActionButton(compact,自带 44pt 命中区与加载转圈)。 */function MenuPillButton({+ busy = false,disabled = false,label,onPress,testID,tone = 'default',}: {+ busy?: boolean;disabled?: boolean;label: string;onPress: () => void;testID?: string;tone?: 'default' | 'primary';}) {- const styles = useThemedStyles(makeStyles);return (- <Pressable- accessibilityLabel={label}- accessibilityRole="button"- accessibilityState={{ disabled }}- disabled={disabled}- onPress={disabled ? undefined : onPress}- style={({ pressed }) => [- styles.pillButton,- tone === 'primary' && styles.pillButtonPrimary,- pressed && styles.pressed,- disabled && styles.disabled,- ]}- testID={testID}- >- <Text- numberOfLines={1}- style={[styles.pillButtonText, tone === 'primary' && styles.pillButtonTextPrimary]}- >- {label}- </Text>- </Pressable>+ <MainWindowActionButton+ action={{+ busy,+ disabled,+ label,+ onPress,+ testID,+ tone: tone === 'primary' ? 'primary' : 'secondary',+ }}+ density="compact"+ />);}@@ -1199,12 +1211,13 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({renameInput: {backgroundColor: colors.surface,borderColor: colors.border,- borderRadius: radius.container,+ // 单行输入框统一胶囊。+ borderRadius: radius.pill,borderWidth: StyleSheet.hairlineWidth,color: colors.textPrimary,fontSize: typeScale.body,minHeight: 44,- paddingLeft: spacing.md,+ paddingLeft: spacing.lg,paddingRight: 44,},renameAiButton: {@@ -1342,29 +1355,6 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({lineHeight: lineHeight.micro,marginTop: 2,},- pillButton: {- alignItems: 'center',- borderColor: colors.borderStrong,- borderRadius: radius.pill,- borderWidth: StyleSheet.hairlineWidth,- justifyContent: 'center',- minHeight: 36,- minWidth: 72,- paddingHorizontal: spacing.md,- },- pillButtonPrimary: {- backgroundColor: colors.cta,- borderColor: colors.cta,- },- pillButtonText: {- color: colors.textPrimary,- fontSize: typeScale.caption,- lineHeight: lineHeight.caption,- fontWeight: fontWeight.medium,- },- pillButtonTextPrimary: {- color: colors.ctaText,- },pressed: {opacity: 0.72,},diff --git a/apps/mobile/src/session/SessionTailBanner.tsx b/apps/mobile/src/session/SessionTailBanner.tsxindex 875897f666..26f2ab23da 100644--- a/apps/mobile/src/session/SessionTailBanner.tsx+++ b/apps/mobile/src/session/SessionTailBanner.tsx@@ -13,6 +13,7 @@ import { AgentErrorDetails } from './AgentErrorDetails';import { Pressable, StyleSheet } from 'react-native';import { useTranslation } from 'react-i18next';import { Text } from '@/components/AppText';+import { mobileInteractionStyles } from '@/components/mobileInteractionStyles';import { View } from 'react-native';import type { SessionTailBannerState } from '@/session/sessionTailBannerModel';import { fontWeight, lineHeight, useThemedStyles, type ThemeColors } from '@/theme';@@ -133,6 +134,6 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({pillCta: { backgroundColor: colors.cta },pillText: { color: colors.textSecondary, fontSize: typeScale.caption, lineHeight: lineHeight.caption, fontWeight: fontWeight.medium },pillTextCta: { color: colors.ctaText },- pressed: { opacity: 0.7 },+ pressed: mobileInteractionStyles.pressed,disabled: { opacity: 0.5 },});diff --git a/apps/mobile/src/session/SessionTransientNotice.tsx b/apps/mobile/src/session/SessionTransientNotice.tsxnew file mode 100644index 0000000000..cbac375f1c--- /dev/null+++ b/apps/mobile/src/session/SessionTransientNotice.tsx@@ -0,0 +1,121 @@+/**+ * SessionTransientNotice —— 会话页顶部的短暂提示(如「已复制路径」)。+ *+ * 会话页没有文件浏览器那样的底栏提示位,这里用一个不拦截触摸的浮层胶囊,+ * 显示约 1.5s 后自动消失。入场 / 退场走 motion token;系统开启「减弱动态效果」+ * (或偏好尚未查询到)时直接显示 / 隐藏,不播淡入淡出。+ */+import { useEffect, useRef, useState } from 'react';+import { Animated, Easing, StyleSheet, View } from 'react-native';++import { Text } from '@/components/AppText';+import { useReduceMotionEnabled } from '@/hooks/useReduceMotion';+import { useThemedStyles, type ThemeColors } from '@/theme';+import {+ fontWeight,+ lineHeight,+ motionDuration,+ motionEasing,+ radius,+ spacing,+ typeScale,+} from '@/theme/tokens';++export const SESSION_TRANSIENT_NOTICE_MS = 1500;++export interface SessionTransientNoticeValue {+ /** 每次提示递增,同文案连续触发也会重新计时。 */+ id: number;+ message: string;+}++export function SessionTransientNotice({+ notice,+ onDismiss,+ top,+}: {+ notice: SessionTransientNoticeValue | null;+ onDismiss: () => void;+ top: number;+}) {+ const styles = useThemedStyles(makeStyles);+ const reduceMotion = useReduceMotionEnabled();+ const animate = reduceMotion === false;+ const opacity = useRef(new Animated.Value(0)).current;+ const [rendered, setRendered] = useState<SessionTransientNoticeValue | null>(notice);+ const onDismissRef = useRef(onDismiss);+ onDismissRef.current = onDismiss;++ useEffect(() => {+ if (!notice) return;+ setRendered(notice);+ opacity.stopAnimation();+ if (animate) {+ Animated.timing(opacity, {+ toValue: 1,+ duration: motionDuration.fast,+ easing: Easing.bezier(...motionEasing.out),+ useNativeDriver: true,+ }).start();+ } else {+ opacity.setValue(1);+ }+ const timer = setTimeout(() => onDismissRef.current(), SESSION_TRANSIENT_NOTICE_MS);+ return () => clearTimeout(timer);+ }, [animate, notice, opacity]);++ useEffect(() => {+ if (notice || !rendered) return;+ if (!animate) {+ opacity.setValue(0);+ setRendered(null);+ return;+ }+ Animated.timing(opacity, {+ toValue: 0,+ duration: motionDuration.instant,+ easing: Easing.bezier(...motionEasing.in),+ useNativeDriver: true,+ }).start(({ finished }) => {+ if (finished) setRendered(null);+ });+ }, [animate, notice, opacity, rendered]);++ if (!rendered) return null;+ return (+ <View pointerEvents="none" style={[styles.host, { top }]}>+ <Animated.View+ accessibilityLiveRegion="polite"+ accessibilityRole="alert"+ style={[styles.pill, { opacity }]}+ testID="session.transientNotice"+ >+ <Text style={styles.text}>{rendered.message}</Text>+ </Animated.View>+ </View>+ );+}++const makeStyles = (colors: ThemeColors) => StyleSheet.create({+ host: {+ alignItems: 'center',+ left: 0,+ paddingHorizontal: spacing.lg,+ position: 'absolute',+ right: 0,+ },+ pill: {+ backgroundColor: colors.surfaceElevated,+ borderColor: colors.border,+ borderRadius: radius.pill,+ borderWidth: StyleSheet.hairlineWidth,+ paddingHorizontal: spacing.lg,+ paddingVertical: spacing.sm,+ },+ text: {+ color: colors.textPrimary,+ fontSize: typeScale.footnote,+ fontWeight: fontWeight.regular,+ lineHeight: lineHeight.caption,+ },+});diff --git a/apps/mobile/src/session/SessionUsageSummary.tsx b/apps/mobile/src/session/SessionUsageSummary.tsxindex f0a0f8fbef..7c4488cff5 100644--- a/apps/mobile/src/session/SessionUsageSummary.tsx+++ b/apps/mobile/src/session/SessionUsageSummary.tsx@@ -23,6 +23,23 @@ import {formatSessionUsageMoney,sessionUsageAmounts,} from "./sessionUsagePresentation";+import { formatModelShortLabel } from "./messageActions";++/**+ * 用量卡上的模型名:优先调用方从模型目录解析出的展示名;目录里找不到时把原始 id+ * 去掉路由前缀(如 `anthropic/`)再走与降级提示行同口径的短标签;都不行才回退原始 id。+ */+export function sessionUsageModelLabel(+ model: string | null | undefined,+ modelLabel?: string | null,+): string {+ const explicit = modelLabel?.trim();+ if (explicit) return explicit;+ const raw = model?.trim() ?? "";+ if (!raw) return "";+ const withoutRoutePrefix = raw.replace(/^[a-z0-9][a-z0-9.-]*\//i, "");+ return formatModelShortLabel(withoutRoutePrefix) || raw;+}export function SessionUsageSummary({session,@@ -32,6 +49,7 @@ export function SessionUsageSummary({detail = false,translucent = false,providerName,+ modelLabel,}: {session: RemoteSession;usage: ReturnType<typeof useSessionMenuUsage>;@@ -40,6 +58,8 @@ export function SessionUsageSummary({detail?: boolean;translucent?: boolean;providerName?: string;+ /** 模型目录里的用户可读展示名;缺席时按 sessionUsageModelLabel 兜底。 */+ modelLabel?: string | null;}) {const { t, i18n } = useTranslation();const styles = useThemedStyles(makeStyles);@@ -107,7 +127,7 @@ export function SessionUsageSummary({<><View style={styles.heading}><Text style={styles.source} numberOfLines={2}>- {session.model}{sourceLabel ? ` · ${sourceLabel}` : ""}+ {sessionUsageModelLabel(session.model, modelLabel)}{sourceLabel ? ` · ${sourceLabel}` : ""}{account?.plan && !account.accountOnly ? ` · ${account.plan}` : ""}</Text></View>@@ -268,10 +288,12 @@ const makeStyles = (colors: ThemeColors) =>fontWeight: fontWeight.medium,flexShrink: 1,},+ // 成句说明:§3「说明、提示」档 13/18 · 400 · textSecondary。note: {- color: colors.textTertiary,- fontSize: typeScale.micro,- lineHeight: lineHeight.micro,+ color: colors.textSecondary,+ fontSize: typeScale.footnote,+ lineHeight: lineHeight.caption,+ fontWeight: fontWeight.regular,},metrics: {borderTopWidth: StyleSheet.hairlineWidth,diff --git a/apps/mobile/src/session/SettingsGroupRows.tsx b/apps/mobile/src/session/SettingsGroupRows.tsxnew file mode 100644index 0000000000..5c62d1fdbb--- /dev/null+++ b/apps/mobile/src/session/SettingsGroupRows.tsx@@ -0,0 +1,289 @@+/**+ * 设置类页面共用的分组卡片与行(设置页、设置子页、设备管理列表)。+ *+ * 行布局规则(用户定稿):左侧标签 / 说明可换行;右侧取值右对齐、不收缩(过长时截断在+ * 行宽 60% 内)。行标题 16/22 500 textPrimary,取值 16/22 400 textSecondary,+ * 说明 13/18 400 textSecondary;分组标题 13/18 600 textTertiary。+ */+import { Children, Fragment, isValidElement, type ReactNode } from 'react';+import { Pressable, StyleSheet, View } from 'react-native';+import { ChevronDown, ChevronRight } from 'lucide-react-native';+import { Text } from '@/components/AppText';+import { mobileInteractionStyles } from '@/components/mobileInteractionStyles';+import { NativeSwitch } from '@/platform/chrome';+import { useTheme, useThemedStyles, type ThemeColors } from '@/theme';+import { fontWeight, iconSize, iconStroke, lineHeight, radius, spacing, typeScale } from '@/theme/tokens';++export const useSettingsRowStyles = () => useThemedStyles(makeSettingsRowStyles);++/**+ * iOS 风格分组:组标题在外侧 gutter,组内一块统一卡片,行间用 inset 分隔线。+ * rows 为空则不渲染卡片;footer 为卡片下方 gutter 里的说明文字(iOS 分组 footer 惯例)。+ */+export function SettingsGroup({+ children,+ footer,+ testID,+ title,+ titleAccessory,+}: {+ children: ReactNode;+ footer?: string;+ testID?: string;+ title?: string;+ titleAccessory?: ReactNode;+}) {+ const styles = useSettingsRowStyles();+ // Children.toArray 会丢弃 null/false 并给每个 child 赋稳定 key(沿用元素自身 key),+ // 比 key={index} 更稳:后续插入/重排行时不会让无关行 remount。+ const rows = Children.toArray(children);+ return (+ <View style={styles.group} testID={testID}>+ {title ? (+ <View style={styles.groupTitleRow}>+ <Text accessibilityRole="header" style={styles.groupTitle}>{title}</Text>+ {titleAccessory}+ </View>+ ) : null}+ {rows.length > 0 ? (+ <View style={styles.card}>+ {rows.map((row, index) => (+ <Fragment key={isValidElement(row) && row.key != null ? row.key : index}>+ {index > 0 ? <View style={styles.divider} /> : null}+ {row}+ </Fragment>+ ))}+ </View>+ ) : null}+ {footer && rows.length > 0 ? (+ <Text style={styles.groupFooter}>{footer}</Text>+ ) : null}+ </View>+ );+}++/** 设置项的单选入口行:iOS 由外层原生下拉菜单接管点击,其它平台打开选择面板。 */+export function ChoicePickerRow({+ expanded,+ label,+ onPress,+ testID,+ value,+}: {+ expanded: boolean;+ label: string;+ onPress(): void;+ testID?: string;+ value: string;+}) {+ const styles = useSettingsRowStyles();+ const { colors } = useTheme();+ return (+ <Pressable+ accessibilityLabel={`${label}: ${value}`}+ accessibilityRole="button"+ accessibilityState={{ expanded }}+ onPress={onPress}+ style={({ pressed }) => [styles.row, pressed && styles.pressed]}+ testID={testID}+ >+ <View style={styles.rowLine}>+ <Text style={styles.rowLabel}>{label}</Text>+ <Text style={styles.rowValue} numberOfLines={1}>{value}</Text>+ <ChevronDown color={colors.textTertiary} size={iconSize.lg} strokeWidth={iconStroke.regular} />+ </View>+ </Pressable>+ );+}++/** 只读信息行:标签左、值右;可选 detail 另起一行。 */+export function InfoRow({+ detail,+ label,+ testID,+ value,+}: {+ detail?: string;+ label: string;+ testID?: string;+ value: string;+}) {+ const styles = useSettingsRowStyles();+ return (+ <View style={styles.row} testID={testID}>+ <View style={styles.rowLine}>+ <Text style={styles.rowLabel}>{label}</Text>+ <Text style={styles.rowValue} numberOfLines={1}>{value}</Text>+ </View>+ {detail ? <Text style={styles.rowDetail}>{detail}</Text> : null}+ </View>+ );+}++/** 可点击信息行:进入子页、轻量编辑或打开外部信息;右侧统一 lg + textTertiary 箭头。 */+export function ActionInfoRow({+ accessibilityLabel,+ accessibilityRole = 'button',+ detail,+ disabled = false,+ label,+ onPress,+ testID,+ value = '',+}: {+ accessibilityLabel: string;+ accessibilityRole?: 'button' | 'link';+ detail?: string;+ disabled?: boolean;+ label: string;+ onPress(): void;+ testID?: string;+ value?: string;+}) {+ const styles = useSettingsRowStyles();+ const { colors } = useTheme();+ return (+ <Pressable+ accessibilityLabel={accessibilityLabel}+ accessibilityRole={accessibilityRole}+ accessibilityState={{ disabled }}+ disabled={disabled}+ onPress={onPress}+ style={({ pressed }) => [styles.row, (pressed || disabled) && styles.pressed]}+ testID={testID}+ >+ <View style={styles.rowLine}>+ <Text style={styles.rowLabel}>{label}</Text>+ {value ? <Text style={styles.rowValue} numberOfLines={1}>{value}</Text> : null}+ <ChevronRight color={colors.textTertiary} size={iconSize.lg} strokeWidth={iconStroke.regular} />+ </View>+ {detail ? <Text style={styles.rowDetail}>{detail}</Text> : null}+ </Pressable>+ );+}++/** 卡片内的折叠开关行(如「调试 / 开发者」):展开后其余行接在同一张卡片里。 */+export function SettingsDisclosureRow({+ expanded,+ label,+ onPress,+ testID,+}: {+ expanded: boolean;+ label: string;+ onPress(): void;+ testID?: string;+}) {+ const styles = useSettingsRowStyles();+ const { colors } = useTheme();+ const Chevron = expanded ? ChevronDown : ChevronRight;+ return (+ <Pressable+ accessibilityLabel={label}+ accessibilityRole="button"+ accessibilityState={{ expanded }}+ onPress={onPress}+ style={({ pressed }) => [styles.row, pressed && styles.pressed]}+ testID={testID}+ >+ <View style={styles.rowLine}>+ <Text style={styles.rowLabel}>{label}</Text>+ <Chevron color={colors.textTertiary} size={iconSize.lg} strokeWidth={iconStroke.regular} />+ </View>+ </Pressable>+ );+}++/** 开关行:标签 + 说明在左(可换行),系统开关在右;accessory 可追加开关右侧的次级入口。 */+export function SettingsSwitchRow({+ accessory,+ accessibilityLabel,+ disabled,+ hint,+ label,+ messages,+ onValueChange,+ switchTestID,+ testID,+ value,+}: {+ accessory?: ReactNode;+ accessibilityLabel?: string;+ disabled?: boolean;+ hint?: string;+ label: string;+ /** 开关下方的附加提示(保存失败、权限被拒等),按 13/18 说明档呈现。 */+ messages?: ReadonlyArray<{ text: string; testID?: string } | null | undefined>;+ onValueChange(value: boolean): void;+ switchTestID?: string;+ testID?: string;+ value: boolean;+}) {+ const styles = useSettingsRowStyles();+ const { colors } = useTheme();+ return (+ <View style={styles.switchRow} testID={testID}>+ <View style={styles.switchTexts}>+ <Text style={styles.rowLabel}>{label}</Text>+ {hint ? <Text style={styles.hint}>{hint}</Text> : null}+ {messages?.map((message, index) => message ? (+ <Text key={message.testID ?? index} style={styles.hint} testID={message.testID}>{message.text}</Text>+ ) : null)}+ </View>+ <NativeSwitch+ accessibilityLabel={accessibilityLabel ?? label}+ disabled={disabled}+ onValueChange={onValueChange}+ seedColor={colors.inputCaret}+ testID={switchTestID}+ value={value}+ />+ {accessory}+ </View>+ );+}++export const makeSettingsRowStyles = (colors: ThemeColors) => StyleSheet.create({+ // —— 分组 ——+ group: { gap: spacing.sm },+ groupTitleRow: {+ alignItems: 'center',+ flexDirection: 'row',+ gap: spacing.xs,+ minHeight: spacing.xl,+ paddingHorizontal: spacing.md,+ },+ groupTitle: { color: colors.textTertiary, flex: 1, fontSize: typeScale.footnote, lineHeight: lineHeight.caption, fontWeight: fontWeight.semibold },+ groupFooter: {+ color: colors.textSecondary,+ fontSize: typeScale.footnote,+ lineHeight: lineHeight.caption,+ paddingHorizontal: spacing.md,+ },+ card: {+ backgroundColor: colors.surfaceElevated,+ borderColor: colors.border,+ borderRadius: radius.container,+ borderWidth: StyleSheet.hairlineWidth,+ overflow: 'hidden',+ },+ divider: { backgroundColor: colors.border, height: StyleSheet.hairlineWidth, marginLeft: spacing.lg },+ // —— 行 ——+ row: { gap: spacing.xs, justifyContent: 'center', minHeight: 52, paddingHorizontal: spacing.lg, paddingVertical: spacing.md },+ rowLine: { alignItems: 'center', flexDirection: 'row', gap: spacing.md },+ // 左侧标签可换行(flex 1 + shrink);右侧取值右对齐、不收缩,过长截断在行宽 60% 内。+ rowLabel: { color: colors.textPrimary, flex: 1, flexShrink: 1, fontSize: typeScale.body, fontWeight: fontWeight.medium, lineHeight: lineHeight.body, minWidth: 0 },+ rowValue: { color: colors.textSecondary, flexShrink: 0, fontSize: typeScale.body, fontWeight: fontWeight.regular, lineHeight: lineHeight.body, maxWidth: '60%', textAlign: 'right' },+ rowDetail: { color: colors.textSecondary, fontSize: typeScale.footnote, fontWeight: fontWeight.regular, lineHeight: lineHeight.caption },+ switchRow: {+ alignItems: 'center',+ flexDirection: 'row',+ gap: spacing.md,+ minHeight: 52,+ paddingHorizontal: spacing.lg,+ paddingVertical: spacing.md,+ },+ switchTexts: { flex: 1, gap: spacing.xs, minWidth: 0 },+ hint: { color: colors.textSecondary, fontSize: typeScale.footnote, fontWeight: fontWeight.regular, lineHeight: lineHeight.caption },+ pressed: mobileInteractionStyles.pressed,+});diff --git a/apps/mobile/src/session/SharedTaskScreen.tsx b/apps/mobile/src/session/SharedTaskScreen.tsxindex d8867dd9e1..cff0897cc6 100644--- a/apps/mobile/src/session/SharedTaskScreen.tsx+++ b/apps/mobile/src/session/SharedTaskScreen.tsx@@ -2,7 +2,7 @@ import { type ReactNode, type Ref } from 'react';import { KeyboardAvoidingView, Platform, ScrollView, StyleSheet, type View } from 'react-native';import { SafeAreaView } from 'react-native-safe-area-context';import { MainWindowActionButton, type MainWindowAction } from '@/components/MobilePrimitives';-import { SimpleStackHeader, simpleScreenSafeAreaEdges } from '@/platform/chrome/SimpleStackHeader';+import { SimpleStackHeader, simpleScrollInsetProps, simpleScrollScreenSafeAreaEdges } from '@/platform/chrome/SimpleStackHeader';import { useThemedStyles, type ThemeColors } from '@/theme';import { fontWeight, lineHeight, spacing, typeScale } from '@/theme/tokens';@@ -11,10 +11,10 @@ export function SharedTaskScreen({ title, onClose, children }: {title: string; onClose(): void; children: ReactNode;}) {const styles = useThemedStyles(makeStyles);- return <SafeAreaView edges={simpleScreenSafeAreaEdges()} style={styles.root}>- <SimpleStackHeader title={title} onBack={onClose} />+ return <SafeAreaView edges={simpleScrollScreenSafeAreaEdges()} style={styles.root}>+ <SimpleStackHeader scrollEdge title={title} onBack={onClose} /><KeyboardAvoidingView style={styles.body} enabled={Platform.OS === 'ios'} behavior="padding">- <ScrollView contentContainerStyle={styles.content} keyboardShouldPersistTaps="handled" keyboardDismissMode="on-drag">{children}</ScrollView>+ <ScrollView {...simpleScrollInsetProps} contentContainerStyle={styles.content} keyboardShouldPersistTaps="handled" keyboardDismissMode="on-drag">{children}</ScrollView></KeyboardAvoidingView></SafeAreaView>;}diff --git a/apps/mobile/src/session/SheetModal.tsx b/apps/mobile/src/session/SheetModal.tsxindex 929fb23e87..06a9d10321 100644--- a/apps/mobile/src/session/SheetModal.tsx+++ b/apps/mobile/src/session/SheetModal.tsx@@ -5,8 +5,8 @@ import { modalLayout } from '@/platform/modalLayout';** 动机:此前 5 个底部 sheet 都用 `<Modal animationType="slide">` 且压暗背板放在 Modal* 内容里,导致背板跟着面板一起从底部升起(视觉跳变,违反规则 7)。本组件把两层动画拆开:- * - 背板:absoluteFill,原地纯透明度淡入(150ms easeOut)/ 淡出(120ms easeIn),- * 对齐 DeviceMenuModal 的 §14.4 ≤150ms 纯透明度过渡模式;+ * - 背板:absoluteFill,原地纯透明度淡入(motionDuration.enter)/ 淡出(motionDuration.exit),+ * 按 §14.4 重浮层档位;减弱动态效果下直接到位;* - 内容层:justifyContent flex-end,translateY 由同一 progress 驱动自底部滑入滑出,* 面板(SheetSurface 或 ad-hoc 面板)由调用方作为 children 放入。* 关闭动画播完才卸载 Modal(mounted 状态),避免面板/背板瞬间消失的空白帧。@@ -31,7 +31,9 @@ import { BlurBackdrop } from '@/session/BlurBackdrop';import { GestureHandlerRootView } from '@/platform/gestureHandler';import { useMobileKeyboardState } from '@/session/useMobileKeyboardState';import { useModalFadeLifecycle } from '@/session/useModalFadeLifecycle';+import { useReduceMotionEnabled } from '@/hooks/useReduceMotion';import { useThemedStyles, type ThemeColors } from '@/theme';+import { motionDuration } from '@/theme/tokens';export interface SheetModalProps {visible: boolean;@@ -69,9 +71,12 @@ export function SheetModal({|| geometry.insets.left > 0 || geometry.insets.right > 0;const [contentHeight, setContentHeight] = useState(geometry.height);// 背板淡入 + 面板滑入共用一条 progress;关闭淡出/滑出播完后再卸载 Modal。+ // sheet 是重浮层:入场 motionDuration.enter / 退场 exit(§14.4);减弱动态效果(含未查询到的+ // 首帧)时长为 0,直接到位。+ const reduceMotion = useReduceMotionEnabled();const { mounted, progress, onShowStartIn } = useModalFadeLifecycle(visible, {- inMs: 150,- outMs: 120,+ inMs: reduceMotion === false ? motionDuration.enter : 0,+ outMs: reduceMotion === false ? motionDuration.exit : 0,onClosed,});diff --git a/apps/mobile/src/session/SheetSurface.tsx b/apps/mobile/src/session/SheetSurface.tsxindex 1f518410f8..9d4252ed68 100644--- a/apps/mobile/src/session/SheetSurface.tsx+++ b/apps/mobile/src/session/SheetSurface.tsx@@ -116,7 +116,7 @@ export function SheetSurface({style={styles.headerButton}testID={testID ? `${testID}.back` : undefined}>- <ChevronLeft color={colors.textPrimary} size={iconSize.lg} strokeWidth={iconStroke.regular} />+ <ChevronLeft color={colors.textPrimary} size={iconSize.action} strokeWidth={iconStroke.regular} /></Pressable>) : (<View style={styles.headerSpacer} />diff --git a/apps/mobile/src/session/TaskTags.tsx b/apps/mobile/src/session/TaskTags.tsxindex ef0b33c10c..c215426c12 100644--- a/apps/mobile/src/session/TaskTags.tsx+++ b/apps/mobile/src/session/TaskTags.tsx@@ -25,7 +25,7 @@ import Animated, {Easing,type SharedValue,} from 'react-native-reanimated';-import { GripVertical, Pencil, MoreHorizontal, ArrowLeft } from 'lucide-react-native';+import { GripVertical, Pencil, MoreHorizontal } from 'lucide-react-native';import { useTranslation } from 'react-i18next';import { useSafeAreaInsets } from 'react-native-safe-area-context';import {@@ -41,6 +41,8 @@ import {type TaskTagResult,} from '@cindy/maker-shared';import { Text, TextInput } from '@/components/AppText';+import { ScreenBackButton } from '@/components/MobilePrimitives';+import { mobileInteractionStyles } from '@/components/mobileInteractionStyles';import { useDeviceLink, subscribeRemoteTaskTagsChanged } from '@/device-link/DeviceLinkContext';import { useTheme, type ThemeColors } from '@/theme';import { radius, spacing, typeScale, iconSize, fontWeight, lineHeight, motionDuration, motionEasing } from '@/theme/tokens';@@ -55,6 +57,24 @@ import {} from './taskTagCatalogCache';import type { RemoteSession } from './types';+function taskTagsHeadingCollapsed(colors: ThemeColors) {+ return {+ color: colors.textSecondary,+ fontSize: typeScale.caption,+ lineHeight: lineHeight.caption,+ fontWeight: fontWeight.regular,+ } as const;+}++function taskTagsHeadingExpanded(colors: ThemeColors) {+ return {+ color: colors.textPrimary,+ fontSize: typeScale.body,+ lineHeight: lineHeight.body,+ fontWeight: fontWeight.semibold,+ } as const;+}+function colorFor(tag: TaskTag, colors: ThemeColors) {const palette = {red: colors.taskTagRed,@@ -660,7 +680,7 @@ export function TaskTagsPanel({backgroundColor: primary ? colors.cta : undefined,justifyContent: 'center',paddingHorizontal: spacing.md,- opacity: busy || (!local && blocked) || inactive ? 0.4 : pressed ? 0.75 : 1,+ opacity: busy || (!local && blocked) || inactive ? 0.4 : pressed ? mobileInteractionStyles.pressed.opacity : 1,})}><Text@@ -788,29 +808,19 @@ export function TaskTagsPanel({}}>{formOpen && !deletion && (- <Pressable- accessibilityRole="button"- accessibilityLabel={t('taskTags.back')}- onPress={closeEditor}- disabled={busy}- style={{- width: 44,- height: 44,- alignItems: 'center',- justifyContent: 'center',- borderRadius: radius.pill,- }}- >- <ArrowLeft size={iconSize.action} color={colors.textPrimary} />- </Pressable>+ // 统一返回键:共享 ScreenBackButton(44pt、ChevronLeft、统一按压态)。+ <ScreenBackButton+ onPress={busy ? undefined : closeEditor}+ testID="taskTags.back"+ />)}<Text- style={{- flex: 1,- color: expanded ? colors.textPrimary : colors.textSecondary,- fontSize: expanded ? typeScale.body : typeScale.caption,- fontWeight: expanded ? fontWeight.semibold : fontWeight.regular,- }}+ style={[+ { flex: 1 },+ // 两种形态是两个角色,各自整行照抄 §3:收起 = 短元数据 12/18 · 400 · 二级色;+ // 展开 = 面板顶栏标题 16/22 · 600 · 主色。每档都配行高。+ expanded ? taskTagsHeadingExpanded(colors) : taskTagsHeadingCollapsed(colors),+ ]}>{deletion? t('taskTags.delete')diff --git a/apps/mobile/src/session/TeammateCreateButton.tsx b/apps/mobile/src/session/TeammateCreateButton.tsxindex fe5b43aac8..cf18e48d64 100644--- a/apps/mobile/src/session/TeammateCreateButton.tsx+++ b/apps/mobile/src/session/TeammateCreateButton.tsx@@ -4,12 +4,12 @@ import { Plus } from 'lucide-react-native';import { useTranslation } from 'react-i18next';import type { RemoteResourceRef } from '@cindy/device-link';import { useAuth } from '@/auth/AuthContext';-import { MainWindowActionButton } from '@/components/MobilePrimitives';import type { RemoteResourceHostTarget } from '@/device-link/remoteResources';import { NativePullDownMenu, usesNativePullDownMenu } from '@/platform/chrome/NativePullDownMenu';import { useTheme } from '@/theme';import { iconSize, iconStroke } from '@/theme/tokens';import { CompanionCreateSheet } from './CompanionProfileSheet';+import { CompanionSettingsRow } from './CompanionSettingsRow';import { CompanionSheet } from './CompanionSheet';import { HomeHeaderGlassButton } from './HomeHeaderGlassButton';import { TEAMMATE_COLLECTION_ID } from './useTeammateRoster';@@ -44,10 +44,12 @@ function CreateButton({ targets, preferredDeviceId, onInteract, onCreated, accousetHost(target); setVisible(true);};const label = t('devices.companionProfile.create');+ // The empty state names the next step instead of only reporting that nothing is available.+ const alertNoHosts = () => Alert.alert(label, t('devices.companions.noCreateHosts'));const button = <HomeHeaderGlassButton accessibilityLabel={label} testID="teammates.create"onPress={() => {onInteract();- if (!targets.length) Alert.alert(label, t('devices.resources.noHosts'));+ if (!targets.length) alertNoHosts();else if (targets.length === 1) select(targets[0].deviceId);else if (targets.length > 1 && !usesNativePullDownMenu()) setChoosing(true);}}>@@ -59,9 +61,10 @@ function CreateButton({ targets, preferredDeviceId, onInteract, onCreated, accou</NativePullDownMenu> : button}<CompanionSheet visible={choosing} title={label} onClose={() => { pendingHost.current = null; setChoosing(false); }}onClosed={() => { const target = pendingHost.current; pendingHost.current = null; if (target) select(target.deviceId); }}>- {ordered.map((target) => <MainWindowActionButton key={target.deviceId} action={{ label: target.deviceName, onPress: () => {- pendingHost.current = target; setChoosing(false);- } }} />)}+ {/* Same choice as the header's native menu: one plain row per computer name, not full-width buttons. */}+ {ordered.map((target) => <CompanionSettingsRow key={target.deviceId} icon={null} label={target.deviceName}+ testID={`teammates.createHost.${target.deviceId}`}+ onPress={() => { pendingHost.current = target; setChoosing(false); }} />)}</CompanionSheet>{host ? <CompanionCreateSheet visible={visible} deviceId={host.deviceId} deviceName={host.deviceName}collectionId={TEAMMATE_COLLECTION_ID} online={targets.some((target) => target.deviceId === host.deviceId)}diff --git a/apps/mobile/src/session/TeammateHomeScreen.tsx b/apps/mobile/src/session/TeammateHomeScreen.tsxindex 6280fb144b..10b9be7a8c 100644--- a/apps/mobile/src/session/TeammateHomeScreen.tsx+++ b/apps/mobile/src/session/TeammateHomeScreen.tsx@@ -1,6 +1,6 @@import { useCallback, useEffect, useRef, useState, useSyncExternalStore } from 'react';import { Alert, Keyboard, StyleSheet, View } from 'react-native';-import { Stack, useIsFocused } from 'expo-router';+import { Stack, useIsFocused, useRouter } from 'expo-router';import { Menu } from 'lucide-react-native';import { SafeAreaView } from 'react-native-safe-area-context';import { useTranslation } from 'react-i18next';@@ -29,6 +29,7 @@ export function TeammateHomeScreen({ active = true }: { active?: boolean }) {const routeFocused = useIsFocused();const focused = routeFocused && active;const push = useGuardedPush();+ const router = useRouter();const navigation = useTeammateNavigation();const roster = useTeammateRoster(focused);const resumed = useRef(false);@@ -41,8 +42,9 @@ export function TeammateHomeScreen({ active = true }: { active?: boolean }) {const mounted = useRef(true);const currentAccount = useRef(auth.accountGeneration); currentAccount.current = auth.accountGeneration;const hasRunningTasks = useSyncExternalStore(- useCallback((listener) => accounts ? remoteSessionStore.subscribe(listener) : () => {}, [accounts]),- useCallback(() => accounts && remoteSessionStore.getSessions().some((session) => remoteSessionStore.isSessionRunning(session.id)), [accounts]),+ // 账号切换与抽屉里的退出确认都要知道是否有运行中任务;两者都关着时不订阅。+ useCallback((listener) => accounts || drawer ? remoteSessionStore.subscribe(listener) : () => {}, [accounts, drawer]),+ useCallback(() => (accounts || drawer) && remoteSessionStore.getSessions().some((session) => remoteSessionStore.isSessionRunning(session.id)), [accounts, drawer]),);useEffect(() => {if (!navigation.restoreLastTeammate) { resumed.current = true; return; }@@ -87,18 +89,19 @@ export function TeammateHomeScreen({ active = true }: { active?: boolean }) {onInteract={() => { resumed.current = true; }}onRefresh={() => { resumed.current = true; void roster.refresh(); }}onSelect={(item) => { resumed.current = true; void navigation.openTeammate(item); }} />- <HomeChromeDrawer open={drawer} user={auth.user} loggingOut={loggingOut} mode="teammates"+ <HomeChromeDrawer open={drawer} user={auth.user} loggingOut={loggingOut} hasRunningTasks={hasRunningTasks} mode="teammates"onModeChange={(mode) => afterDrawer(() => { void navigation.setMode(mode); })}onClose={() => { pending.current = null; setDrawer(false); }} onClosed={finishOverlay}onOpenSearch={() => afterDrawer(() => setSearchEpoch((epoch) => epoch + 1))}onOpenDevices={() => afterDrawer(() => push('/devices/manage'))}onOpenSettings={() => afterDrawer(() => push('/settings'))}onOpenAccounts={() => afterDrawer(() => setAccounts(true))}+ // 抽屉内部已 confirmLogout;成功后与设置页一致直接回登录页,不依赖外层自动跳转的时序。onLogout={() => {if (loggingOut) return;setLoggingOut(true);const account = auth.accountGeneration;- void auth.logout().catch((cause) => {+ void auth.logout().then(() => { router.replace('/login'); }, (cause) => {if (mounted.current && currentAccount.current === account) Alert.alert(t('devices.list.alert.actionFailed'), formatRemoteError(cause));}).finally(() => { if (mounted.current && currentAccount.current === account) setLoggingOut(false); });}} />diff --git a/apps/mobile/src/session/TeammateList.tsx b/apps/mobile/src/session/TeammateList.tsxindex bbd517e3f1..cc2ea7ba2a 100644--- a/apps/mobile/src/session/TeammateList.tsx+++ b/apps/mobile/src/session/TeammateList.tsx@@ -1,19 +1,20 @@import { readWorkingPhase } from '@cindy/maker-shared';import { TeammateGenerationLabel } from './TeammateGenerationLabel';import { useMemo, useState } from 'react';-import { ActivityIndicator, FlatList, Pressable, RefreshControl, StyleSheet, View } from 'react-native';+import { ActivityIndicator, FlatList, Pressable, RefreshControl, StyleSheet, View, type ScrollViewProps } from 'react-native';import { useTranslation } from 'react-i18next';-import { RefreshCw, TriangleAlert } from 'lucide-react-native';+import { RefreshCw, Search, TriangleAlert, X } from 'lucide-react-native';import { resolveRemoteText } from '@cindy/device-link';import { Text, TextInput } from '@/components/AppText';-import { MainWindowEmptyState } from '@/components/MobilePrimitives';+import { MainWindowEmptyState, RemoteListSyncingPlaceholder, StatusDot } from '@/components/MobilePrimitives';+import { mobileInteractionStyles } from '@/components/mobileInteractionStyles';import { RemoteCompanionAvatar } from '@/components/RemoteCompanionAvatar';import { useAuth } from '@/auth/AuthContext';import { isRemoteResourceUnread } from '@/device-link/remoteResourceCache';import type { HostedRemoteCollectionItem, RemoteResourceHostTarget } from '@/device-link/remoteResources';import { useMinuteNow } from '@/utils/useMinuteNow';import { useThemedStyles, useTheme, type ThemeColors } from '@/theme';-import { fontWeight, iconSize, lineHeight, radius, spacing, typeScale } from '@/theme/tokens';+import { fontWeight, iconSize, iconStroke, lineHeight, radius, spacing, typeScale } from '@/theme/tokens';import { formatRemoteSessionSidebarTime } from './sessionList';import { orderedTeammates, sameTeammate, teammateIdentity } from './teammateNavigation';import type { LastTeammateIdentity } from './homeViewPreferenceStore';@@ -31,12 +32,14 @@ export interface TeammateListProps {current?: LastTeammateIdentity | null;/** SheetSurface already owns the scroll view. */embedded?: boolean;+ /** 独立整页、铺到透明系统顶栏下时,由列表自己让出上下安全区。 */+ scrollInsetProps?: Pick<ScrollViewProps, 'automaticallyAdjustsScrollIndicatorInsets' | 'contentInsetAdjustmentBehavior'>;autoFocusSearch?: boolean;onInteract?(): void;}/** Flat identity list shared by home, collection route and the name picker. No host headings or groups. */export function TeammateList({ items, loading, refreshing, error, isOnline, connectionState, onRefresh, onSelect,- current = null, embedded = false, autoFocusSearch = false, onInteract }: TeammateListProps) {+ current = null, embedded = false, autoFocusSearch = false, onInteract, scrollInsetProps }: TeammateListProps) {const { t, i18n } = useTranslation();const { user } = useAuth();const { colors } = useTheme();@@ -52,11 +55,22 @@ export function TeammateList({ items, loading, refreshing, error, isOnline, conn}return names;}, [items, i18n.language]);+ const trimmedQuery = query.trim();+ // Mirrors HomeSearchBar: the trailing X clears typed text.const header = <View style={styles.controls}>- <TextInput accessibilityLabel={t('devices.companions.search')} autoFocus={autoFocusSearch}- autoCorrect={false} onChangeText={(value) => { onInteract?.(); setQuery(value); }} onFocus={onInteract} placeholder={t('devices.companions.search')}- placeholderTextColor={colors.textPlaceholder} selectionColor={colors.inputCaret}- style={styles.search} value={query} testID="teammates.search" />+ <View style={styles.search} testID="teammates.searchRow">+ <Search color={colors.textSecondary} size={iconSize.md} strokeWidth={iconStroke.regular} />+ <TextInput accessibilityLabel={t('devices.companions.search')} autoFocus={autoFocusSearch}+ autoCorrect={false} onChangeText={(value) => { onInteract?.(); setQuery(value); }} onFocus={onInteract} placeholder={t('devices.companions.search')}+ placeholderTextColor={colors.textPlaceholder} selectionColor={colors.inputCaret}+ style={styles.searchInput} value={query} testID="teammates.search" />+ {trimmedQuery ? <Pressable accessibilityRole="button" hitSlop={spacing.xs}+ accessibilityLabel={t('devices.detail.search.clearA11y')}+ onPress={() => setQuery('')}+ style={({ pressed }) => [styles.searchButton, pressed && mobileInteractionStyles.pressed]} testID="teammates.searchClose">+ <X color={colors.textTertiary} size={iconSize.md} strokeWidth={iconStroke.regular} />+ </Pressable> : null}+ </View>{error ? <View style={styles.noticeRow}><Text accessibilityRole="alert" style={[styles.notice, styles.noticeText]} testID="teammates.error">{t(items.length ? 'devices.companions.stale' : 'devices.resources.loadFailed')}</Text><Pressable accessibilityRole="button" accessibilityLabel={t('devices.resources.retry')} disabled={refreshing}@@ -65,7 +79,7 @@ export function TeammateList({ items, loading, refreshing, error, isOnline, conn</Pressable></View> : null}</View>;- const empty = loading ? <View style={styles.empty}><ActivityIndicator color={colors.textSecondary} /><Text style={styles.notice}>{t('devices.resources.loading')}</Text></View>+ const empty = loading ? <RemoteListSyncingPlaceholder testID="teammates.loading" />: <MainWindowEmptyState centered style={styles.empty} testID="teammates.empty"title={query.trim() ? t('devices.companions.noResults') : t('devices.companions.emptyTitle')}copy={query.trim() || error ? '' : t('devices.companions.emptyCopy')} />;@@ -90,13 +104,14 @@ export function TeammateList({ items, loading, refreshing, error, isOnline, connconst timestamp = display.timestamp;const time = timestamp !== undefined && Number.isFinite(new Date(timestamp).getTime())? formatRemoteSessionSidebarTime(new Date(timestamp).toISOString(), now) : '';- const selected = sameTeammate(current, teammateIdentity(row));+ // Only the name picker marks the current identity; the single-column home list never does.+ const selected = embedded && sameTeammate(current, teammateIdentity(row));const meta = [connected === false ? t('devices.resources.hostOffline') : connected === null ? t('devices.resources.connectionUnknown') : '', source].filter(Boolean).join(' · ');return <Pressable key={row.key} accessibilityRole="button" accessibilityState={{ selected, disabled: !online }}accessibilityLabel={[title, attention, accessiblePreview, time, unread ? t('devices.companions.unread') : '', meta].filter(Boolean).join(', ')}- disabled={!online} onPress={() => onSelect(row)} style={({ pressed }) => [styles.row, selected && styles.selected, pressed && styles.pressed]}+ disabled={!online} onPress={() => onSelect(row)} style={({ pressed }) => [styles.row, selected && styles.selected, pressed && mobileInteractionStyles.pressed]}testID={`teammates.item.${row.host.deviceId}.${row.item.ref.id}`}>- <View style={styles.avatar}><RemoteCompanionAvatar avatar={display.avatar} deviceId={row.host.deviceId} name={title} online={online} /><View testID="teammate.connection" style={[styles.connection, { backgroundColor: connected === null ? colors.textTertiary : connected ? colors.statusDone : colors.statusError }]} /></View>+ <View style={styles.avatar}><RemoteCompanionAvatar avatar={display.avatar} deviceId={row.host.deviceId} name={title} online={online} /><View testID="teammate.connection" style={styles.connection}><StatusDot tone={connected === null ? 'muted' : connected ? 'ready' : 'off'} /></View></View><View style={styles.body}><View style={styles.titleRow}><Text numberOfLines={1} style={styles.title}>{title}</Text>{attention ? <TriangleAlert accessibilityLabel={attention} size={iconSize.sm} color={colors.warningFg} testID="teammate.attention" /> : null}@@ -110,7 +125,7 @@ export function TeammateList({ items, loading, refreshing, error, isOnline, conn</Pressable>;};if (embedded) return <View testID="teammates.list">{header}{rows.length ? rows.map(renderRow) : empty}</View>;- return <FlatList style={styles.list} contentContainerStyle={styles.content} data={rows} keyExtractor={(row) => row.key}+ return <FlatList {...scrollInsetProps} style={styles.list} contentContainerStyle={styles.content} data={rows} keyExtractor={(row) => row.key}keyboardShouldPersistTaps="handled" keyboardDismissMode="on-drag" onScrollBeginDrag={onInteract} testID="teammates.list"ListHeaderComponent={header} ListEmptyComponent={empty} renderItem={({ item }) => renderRow(item)}refreshControl={<RefreshControl refreshing={refreshing} onRefresh={onRefresh} tintColor={colors.textSecondary} />} />;@@ -119,8 +134,12 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({list: { flex: 1 },content: { flexGrow: 1, paddingBottom: spacing.xl },controls: { paddingHorizontal: spacing.lg, paddingVertical: spacing.sm, gap: spacing.sm },- search: { borderRadius: radius.pill, backgroundColor: colors.surfaceElevated, borderColor: colors.border,- borderWidth: StyleSheet.hairlineWidth, minHeight: 44, paddingHorizontal: spacing.lg, color: colors.textPrimary, fontSize: typeScale.body },+ // Same pill as HomeSearchBar; the field text follows the 15pt search-box role.+ search: { flexDirection: 'row', alignItems: 'center', gap: spacing.sm, borderRadius: radius.pill, backgroundColor: colors.surfaceElevated,+ borderColor: colors.border, borderWidth: StyleSheet.hairlineWidth, minHeight: 44, paddingLeft: spacing.lg, paddingRight: spacing.xs },+ searchInput: { flex: 1, minWidth: 0, paddingVertical: spacing.sm, color: colors.textPrimary, fontSize: typeScale.bodySmall },+ // 36 visible + hitSlop 4 on each side = 44pt target.+ searchButton: { width: 36, height: 36, alignItems: 'center', justifyContent: 'center' },notice: { color: colors.textSecondary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption },empty: { padding: spacing.xl, gap: spacing.md },noticeRow: { flexDirection: 'row', alignItems: 'center', gap: spacing.sm },@@ -129,13 +148,13 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({// 行本身不留上下内边距,分割线落在行的最底边:选中底色正好铺在上下两条分割线之间。row: { flexDirection: 'row', alignItems: 'center', gap: spacing.md, paddingHorizontal: spacing.lg, minHeight: 78 },avatar: { width: 44, height: 44, borderRadius: radius.pill, backgroundColor: colors.surfaceChip, alignItems: 'center', justifyContent: 'center' },- connection: { position: 'absolute', right: 0, bottom: 0, width: 10, height: 10, borderRadius: radius.pill, borderWidth: 2, borderColor: colors.surface },+ // StatusDot sits in a page-coloured ring so it stays legible over the avatar.+ connection: { position: 'absolute', right: 0, bottom: 0, padding: 2, borderRadius: radius.pill, backgroundColor: colors.surface },selected: { backgroundColor: colors.surfaceChip, borderRadius: radius.container },- pressed: { opacity: 0.72 },// 原先是行上下各 12 + 文字区底部 12,分割线在行底上方 12 处,选中底色因此整体下错 12。- // 现在 36 的留白上下各 18 放进文字区,行高不变,文字在两条分割线之间居中。+ // 现在留白上下各 spacing.lg 放进文字区,文字在两条分割线之间居中。body: { flex: 1, minWidth: 0, alignSelf: 'stretch', justifyContent: 'center', gap: spacing.xs,- borderBottomColor: colors.border, borderBottomWidth: StyleSheet.hairlineWidth, paddingVertical: 18 },+ borderBottomColor: colors.border, borderBottomWidth: StyleSheet.hairlineWidth, paddingVertical: spacing.lg },titleRow: { flexDirection: 'row', alignItems: 'center', gap: spacing.sm },// Match task rows in HomeListVisuals: title, preview and metadata keep the same hierarchy.title: { flex: 1, color: colors.textPrimary, fontSize: typeScale.subtitle, fontWeight: fontWeight.medium, lineHeight: lineHeight.listTitle },diff --git a/apps/mobile/src/session/UnifiedModelPickerView.ios.tsx b/apps/mobile/src/session/UnifiedModelPickerView.ios.tsxindex a10ed45cbc..1ffce9dd4b 100644--- a/apps/mobile/src/session/UnifiedModelPickerView.ios.tsx+++ b/apps/mobile/src/session/UnifiedModelPickerView.ios.tsx@@ -306,7 +306,7 @@ export function UnifiedModelPickerView(p: UnifiedMobilePickerViewProps) {label={t("models.options.fastMode")}isOn={config.fast}onIsOnChange={(fast) => options.onChange({ ...config, fast })}- modifiers={[disabled(p.busy)]}+ modifiers={[disabled(p.busy), tint(colors.inputCaret)]}testID={`${p.testID}.fast`}/></HStack>diff --git a/apps/mobile/src/session/UnifiedModelPickerView.tsx b/apps/mobile/src/session/UnifiedModelPickerView.tsxindex c0f76aedb9..06a2ec9693 100644--- a/apps/mobile/src/session/UnifiedModelPickerView.tsx+++ b/apps/mobile/src/session/UnifiedModelPickerView.tsx@@ -13,7 +13,9 @@ import { Pressable, ScrollView, View, useWindowDimensions } from "react-native";import { useSafeAreaInsets } from "react-native-safe-area-context";import { useTranslation } from "react-i18next";import { Text, TextInput } from "@/components/AppText";+import { mobileInteractionStyles } from "@/components/mobileInteractionStyles";import { useTheme, spacing, radius, iconSize } from "@/theme";+import { fontWeight, lineHeight, typeScale } from "@/theme/tokens";import { SheetModal } from "./SheetModal";import { SheetSurface } from "./SheetSurface";import {@@ -22,6 +24,24 @@ import {} from "./contextSheetModel";import { mobileAgentLabel } from "./sessionAgentSwitch";import type { UnifiedMobilePickerViewProps } from "./UnifiedModelPickerSheet";+// 文字角色按 mobile-design-guide §3 整行取值(字号 / 行高 / 字重);字色随主题在渲染处注入。+const textRole = {+ /** 行标题、选项、按钮:16/22 500(textPrimary)。 */+ optionLabel: { fontSize: typeScale.body, lineHeight: lineHeight.body, fontWeight: fontWeight.medium },+ /** 行标题(模型名):16/22 500(textPrimary)。 */+ rowTitle: { flexShrink: 1, fontSize: typeScale.body, lineHeight: lineHeight.body, fontWeight: fontWeight.medium },+ /** 次级正文(模型副标题):15/20 400(textSecondary)。 */+ rowSubtitle: { fontSize: typeScale.bodySmall, lineHeight: lineHeight.bodySmall, fontWeight: fontWeight.regular },+ /** 短元数据(价格档、推理档、额度):12/18 400(textTertiary)。 */+ meta: { fontSize: typeScale.caption, lineHeight: lineHeight.caption, fontWeight: fontWeight.regular },+ /** 分组小标签:13/18 600(textTertiary)。 */+ groupLabel: { fontSize: typeScale.footnote, lineHeight: lineHeight.caption, fontWeight: fontWeight.semibold, paddingTop: spacing.md },+ /** 说明 / 提示 / 报错(成句的话):13/18 400(textSecondary / errorText)。 */+ note: { fontSize: typeScale.footnote, lineHeight: lineHeight.caption, fontWeight: fontWeight.regular },+ /** 搜索框:bodySmall 字号;单行输入框不设行高。 */+ searchInput: { fontSize: typeScale.bodySmall, minHeight: 44 },+} as const;+export function UnifiedModelPickerView(p: UnifiedMobilePickerViewProps) {const { colors } = useTheme();const { t } = useTranslation();@@ -40,20 +60,24 @@ export function UnifiedModelPickerView(p: UnifiedMobilePickerViewProps) {accessibilityRole="button"accessibilityLabel={label}disabled={p.busy || disabled}+ accessibilityState={{ disabled: p.busy || disabled, selected }}onPress={onPress}- style={{- opacity: disabled ? 0.4 : 1,- flexDirection: "row",- alignItems: "center",- gap: spacing.sm,- minHeight: 44,- padding: spacing.md,- backgroundColor: selected ? colors.surfaceChip : undefined,- borderRadius: radius.pill,- }}+ style={({ pressed }) => [+ {+ opacity: disabled ? 0.4 : 1,+ flexDirection: "row",+ alignItems: "center",+ gap: spacing.sm,+ minHeight: 44,+ padding: spacing.md,+ backgroundColor: selected ? colors.surfaceChip : undefined,+ borderRadius: radius.pill,+ },+ pressed && mobileInteractionStyles.pressed,+ ]}>{icon}- <Text style={{ color: colors.textPrimary }}>{label}</Text>+ <Text style={[textRole.optionLabel, { color: colors.textPrimary }]}>{label}</Text></Pressable>);const o = p.options;@@ -79,12 +103,12 @@ export function UnifiedModelPickerView(p: UnifiedMobilePickerViewProps) {testID={p.testID}>{p.error ? (- <Text style={{ color: colors.errorText }}>{p.error}</Text>+ <Text style={[textRole.note, { color: colors.errorText }]}>{p.error}</Text>) : null}{o ? (<>- <Text style={{ color: colors.textSecondary }}>{o.context}</Text>- <Text>{t("models.unified.harness")}</Text>+ <Text style={[textRole.note, { color: colors.textSecondary }]}>{o.context}</Text>+ <Text style={[textRole.groupLabel, { color: colors.textTertiary }]}>{t("models.unified.harness")}</Text>{o.agents.map((agent) =>button(mobileAgentLabel(agent),@@ -105,7 +129,7 @@ export function UnifiedModelPickerView(p: UnifiedMobilePickerViewProps) {/>,),)}- <Text>{t("models.options.reasoningEffort")}</Text>+ <Text style={[textRole.groupLabel, { color: colors.textTertiary }]}>{t("models.options.reasoningEffort")}</Text>{o.row.entry.capabilities[o.row.config.agent]?.efforts.map((effort) =>button(@@ -127,7 +151,7 @@ export function UnifiedModelPickerView(p: UnifiedMobilePickerViewProps) {/>,): null}- {o.price ? <Text>{o.price}</Text> : null}+ {o.price ? <Text style={[textRole.note, { color: colors.textSecondary }]}>{o.price}</Text> : null}{button(t(o.row.favorite@@ -153,13 +177,8 @@ export function UnifiedModelPickerView(p: UnifiedMobilePickerViewProps) {value={p.query}onChangeText={p.onQuery}placeholder={t("models.picker.searchPlaceholder")}- style={{- flexDirection: "row",- alignItems: "center",- gap: spacing.sm,- minHeight: 44,- color: colors.textPrimary,- }}+ placeholderTextColor={colors.textPlaceholder}+ style={[textRole.searchInput, { color: colors.textPrimary }]}/><ScrollView horizontal>{p.filters.map((item) =>@@ -214,9 +233,7 @@ export function UnifiedModelPickerView(p: UnifiedMobilePickerViewProps) {</ScrollView>{p.groups.map((group) => (<View key={group.key}>- <Text style={{ color: colors.textSecondary }}>- {group.title}- </Text>+ <Text style={[textRole.groupLabel, { color: colors.textTertiary }]}>{group.title}</Text>{group.rows.map((row) => (<Viewkey={row.key}@@ -224,15 +241,20 @@ export function UnifiedModelPickerView(p: UnifiedMobilePickerViewProps) {><Pressabledisabled={p.busy || row.disabled}+ accessibilityRole="button"+ accessibilityState={{ disabled: p.busy || row.disabled, selected: row.selected }}onPress={() => p.onSelect(row)}- style={{- flex: 1,- minHeight: 52,- padding: 12,- flexDirection: "row",- alignItems: "center",- gap: spacing.sm,- }}+ style={({ pressed }) => [+ {+ flex: 1,+ minHeight: 52,+ padding: spacing.md,+ flexDirection: "row",+ alignItems: "center",+ gap: spacing.sm,+ },+ pressed && mobileInteractionStyles.pressed,+ ]}><MobileModelIconMarkicon={row.entry.icon}@@ -246,24 +268,17 @@ export function UnifiedModelPickerView(p: UnifiedMobilePickerViewProps) {gap: spacing.xs,}}>- <Text- numberOfLines={1}- style={{ color: colors.textPrimary, flexShrink: 1 }}- >+ <Text numberOfLines={1} style={[textRole.rowTitle, { color: colors.textPrimary }]}>{row.entry.displayName}</Text>{row.costMarks ? (- <Text style={{ color: colors.textSecondary }}>- {row.costMarks}- </Text>+ <Text style={[textRole.meta, { color: colors.textTertiary }]}>{row.costMarks}</Text>) : null}<MobileAgentMarkagentKind={row.config.agent}color={colors.textSecondary}/>- <Text style={{ color: colors.textSecondary }}>- {row.effortLabel}- </Text>+ <Text style={[textRole.meta, { color: colors.textTertiary }]}>{row.effortLabel}</Text>{row.config.fast ? (<Zapsize={iconSize.sm}@@ -272,14 +287,12 @@ export function UnifiedModelPickerView(p: UnifiedMobilePickerViewProps) {) : null}</View>{row.subtitle ? (- <Text numberOfLines={1} style={{ color: colors.textSecondary }}>+ <Text numberOfLines={1} style={[textRole.rowSubtitle, { color: colors.textSecondary }]}>{row.subtitle}</Text>) : null}{row.quotaLabel ? (- <Text style={{ color: colors.textSecondary }}>- {row.quotaLabel}- </Text>+ <Text style={[textRole.meta, { color: colors.textTertiary }]}>{row.quotaLabel}</Text>) : null}</View>{row.favorite ? (@@ -304,12 +317,15 @@ export function UnifiedModelPickerView(p: UnifiedMobilePickerViewProps) {)}disabled={p.busy || row.disabled}onPress={() => p.onOptions(row)}- style={{- width: 44,- height: 44,- alignItems: "center",- justifyContent: "center",- }}+ style={({ pressed }) => [+ {+ width: 44,+ height: 44,+ alignItems: "center",+ justifyContent: "center",+ },+ pressed && mobileInteractionStyles.pressed,+ ]}><SlidersHorizontalsize={iconSize.action}@@ -321,7 +337,7 @@ export function UnifiedModelPickerView(p: UnifiedMobilePickerViewProps) {</View>))}{!p.groups.length ? (- <Text>+ <Text style={[textRole.note, { color: colors.textSecondary }]}>{p.loading ? t("models.picker.loadingDefault") : p.emptyHint}</Text>) : null}diff --git a/apps/mobile/src/session/VoiceRecordingPill.tsx b/apps/mobile/src/session/VoiceRecordingPill.tsxindex 336fc5875c..e768e001ac 100644--- a/apps/mobile/src/session/VoiceRecordingPill.tsx+++ b/apps/mobile/src/session/VoiceRecordingPill.tsx@@ -3,7 +3,7 @@ import { useEffect, useRef, useState } from 'react';import { Text } from '@/components/AppText';import { getCachedReduceMotionEnabled, useReduceMotionEnabled } from '@/hooks/useReduceMotion';import { useThemedStyles, type ThemeColors } from '@/theme';-import { lineHeight, radius, typeScale } from '@/theme/tokens';+import { lineHeight, motionDuration, radius, typeScale } from '@/theme/tokens';import { MOBILE_COMPOSER_CONTROL_SIZE } from '@/session/MobileComposerInputRow';// 旧架构 Android 需要显式开启 LayoutAnimation;新架构(Fabric)下该开关是 no-op。@@ -52,8 +52,8 @@ export interface MobileVoiceRecordingTimer {/*** 录音计时状态。counting 翻 true 时从 0 重新计时,expanded 翻 false 清零。* 同时在展开态翻转与宽度换档的下一帧布局注册一次 LayoutAnimation- * (一次性瞬态、用户触发、有明确结束,符合动效红线;240ms 对齐桌面胶囊- * 展开时长),让胶囊展开/收回与左邻按钮的让位在同一段运动里完成。+ * (一次性瞬态、用户触发、有明确结束,符合动效红线;时长取尺寸变化档+ * motionDuration.base),让胶囊展开/收回与左邻按钮的让位在同一段运动里完成。*/export function useMobileVoiceRecordingTimer({ expanded, counting }: MobileVoiceRecordingTimerInput,@@ -86,8 +86,10 @@ export function useMobileVoiceRecordingTimer(// pillTransition = undefined 的行为。按 useReduceMotion 的约定,null// (首帧未查到)也按不播处理——缓存模块加载即预热,实际命中窗口极小。if (getCachedReduceMotionEnabled() === false) {+ // 尺寸变化档 motionDuration.base(§14.4);LayoutAnimation 只接受预设曲线,+ // easeInEaseOut 是与 motionEasing.move 最接近的预设。LayoutAnimation.configureNext({- duration: 240,+ duration: motionDuration.base,update: { type: 'easeInEaseOut' },});}diff --git a/apps/mobile/src/session/composerGeometry.ts b/apps/mobile/src/session/composerGeometry.tsnew file mode 100644index 0000000000..757262680c--- /dev/null+++ b/apps/mobile/src/session/composerGeometry.ts@@ -0,0 +1,30 @@+/**+ * Shared message-composer geometry, in points. `pillHeight` is also the floating+ * new-task button's size: the button sits on the composer's resting line and the+ * compact pill is exactly as tall, so the circle only stretches sideways.+ */+export const composerGeometry = { cornerRadius: 30, horizontalInset: 16, keyboardGap: 8, restingGap: 8, pillHeight: 55 } as const;++export interface ComposerMorphOrigin {+ id: string; x: number; y: number; width: number; height: number;+ windowWidth: number; windowHeight: number;+}++function usableOrigin(origin: ComposerMorphOrigin | null, width: number, height: number): origin is ComposerMorphOrigin {+ return !!origin && Math.abs(origin.windowWidth - width) < 1 && Math.abs(origin.windowHeight - height) < 1+ && origin.width > 0 && origin.height > 0 && origin.y >= 0 && origin.y + origin.height <= height;+}++export function composerRestingBottom(origin: ComposerMorphOrigin | null, width: number, height: number, safeBottom: number): number {+ if (usableOrigin(origin, width, height)) return height - origin.y - origin.height;+ return safeBottom + composerGeometry.restingGap;+}++/** The compact composer pill matches the new-task button, so the button only stretches sideways into it. */+export function composerPillHeight(origin: ComposerMorphOrigin | null, width: number, height: number): number {+ return usableOrigin(origin, width, height) ? origin.height : composerGeometry.pillHeight;+}++export function composerBottomContentPadding(desiredBottom: number, layerBottom: number, innerPadding: number): number {+ return Math.max(0, desiredBottom - layerBottom - innerPadding);+}diff --git a/apps/mobile/src/session/composerMorph.ts b/apps/mobile/src/session/composerMorph.tsnew file mode 100644index 0000000000..d43b1df9fa--- /dev/null+++ b/apps/mobile/src/session/composerMorph.ts@@ -0,0 +1,39 @@+import { useSyncExternalStore } from 'react';+import { Platform, useWindowDimensions } from 'react-native';+import { useSafeAreaInsets } from 'react-native-safe-area-context';+import { composerGeometry, composerPillHeight, composerRestingBottom, type ComposerMorphOrigin } from './composerGeometry';++let geometry: ComposerMorphOrigin | null = null;+const listeners = new Set<() => void>();+const entries = new Map<string, { origin: ComposerMorphOrigin; at: number }>();+const subscribe = (listener: () => void) => { listeners.add(listener); return () => { listeners.delete(listener); }; };++export function rememberComposerGeometry(origin: ComposerMorphOrigin) {+ if (!origin || ![origin.x, origin.y, origin.width, origin.height, origin.windowWidth, origin.windowHeight].every(Number.isFinite)) return;+ if (geometry && ['x', 'y', 'width', 'height', 'windowWidth', 'windowHeight'].every(key => geometry![key as keyof ComposerMorphOrigin] === origin[key as keyof ComposerMorphOrigin])) return;+ geometry = origin;+ listeners.forEach(listener => listener());+}+export function rememberComposerEntry(origin: ComposerMorphOrigin): string {+ rememberComposerGeometry(origin);+ entries.clear();+ entries.set(origin.id, { origin, at: Date.now() });+ return origin.id;+}+export function readComposerEntry(id: string | undefined): ComposerMorphOrigin | null {+ const value = id ? entries.get(id) : undefined;+ return value && Date.now() - value.at < 2500 ? value.origin : null;+}+export function useComposerDock() {+ const origin = useSyncExternalStore(subscribe, () => geometry);+ const window = useWindowDimensions();+ const safe = useSafeAreaInsets();+ return {+ // iOS composer dock: new task, existing task and partner chat share the+ // new-task button's resting line, pill height and keyboard gap.+ enabled: Platform.OS === 'ios',+ restingBottom: composerRestingBottom(origin, window.width, window.height, safe.bottom),+ keyboardGap: composerGeometry.keyboardGap,+ pillHeight: composerPillHeight(origin, window.width, window.height),+ };+}diff --git a/apps/mobile/src/session/confirmLogout.ts b/apps/mobile/src/session/confirmLogout.tsnew file mode 100644index 0000000000..59d25af3f2--- /dev/null+++ b/apps/mobile/src/session/confirmLogout.ts@@ -0,0 +1,19 @@+import { Alert } from 'react-native';+import type { TFunction } from 'i18next';++/**+ * Every sign-out entry (settings, home drawer, partner home and drawer) asks+ * first: signing out clears this phone's saved accounts and local mirror, and+ * running tasks stop reporting here. Switching accounts already warns; the+ * heavier action must not be quieter.+ */+export function confirmLogout(t: TFunction, hasRunningTasks: boolean, onConfirm: () => void): void {+ Alert.alert(+ t('settings.account.logoutConfirmTitle'),+ hasRunningTasks ? t('settings.account.logoutConfirmRunning') : t('settings.account.logoutHint'),+ [+ { text: t('devices.common.cancel'), style: 'cancel' },+ { text: t('settings.account.logout'), style: 'destructive', onPress: onConfirm },+ ],+ );+}diff --git a/apps/mobile/src/session/deviceManagementSections.ts b/apps/mobile/src/session/deviceManagementSections.tsnew file mode 100644index 0000000000..5399af3209--- /dev/null+++ b/apps/mobile/src/session/deviceManagementSections.ts@@ -0,0 +1,47 @@+import type { DeviceListItem, DeviceListDeviceLike } from '@cindy/maker-shared/device-list';++/** 离线分组默认只露出最近在线的几台,其余收在「显示全部」后面(只影响呈现,不删数据)。 */+export const DEVICE_MANAGEMENT_OFFLINE_PREVIEW_COUNT = 3;++export interface DeviceManagementSections<TDevice extends DeviceListDeviceLike> {+ /** 在线设备(可控在前;含未开远控 / 已撤销访问的在线设备),保持共享排序。 */+ online: DeviceListItem<TDevice>[];+ /** 离线设备:按最近在线时间倒序(没有记录的排最后),同时间按名称。 */+ offline: DeviceListItem<TDevice>[];+}++function lastSeenMs(iso: string | null): number {+ if (!iso) return Number.NEGATIVE_INFINITY;+ const ms = Date.parse(iso);+ return Number.isFinite(ms) ? ms : Number.NEGATIVE_INFINITY;+}++/**+ * 设备管理页分组:在线 / 可控的在前,离线的单独一组。+ * 同名离线设备(如重装后留下的十来条旧记录)按最近在线排序后,最新的一条总在最上面。+ */+export function buildDeviceManagementSections<TDevice extends DeviceListDeviceLike>(+ rows: readonly DeviceListItem<TDevice>[],+): DeviceManagementSections<TDevice> {+ const online: DeviceListItem<TDevice>[] = [];+ const offline: DeviceListItem<TDevice>[] = [];+ for (const row of rows) {+ if (row.state === 'offline') offline.push(row);+ else online.push(row);+ }+ offline.sort((a, b) =>+ lastSeenMs(b.device.lastSeenAt) - lastSeenMs(a.device.lastSeenAt)+ || a.device.name.localeCompare(b.device.name)+ || a.device.deviceId.localeCompare(b.device.deviceId));+ return { online, offline };+}++/** 离线分组当前应显示的行;expanded 为 false 时只取最近几条。 */+export function visibleOfflineDeviceRows<T>(offline: readonly T[], expanded: boolean): readonly T[] {+ return expanded ? offline : offline.slice(0, DEVICE_MANAGEMENT_OFFLINE_PREVIEW_COUNT);+}++/** 行内状态文字:离线分组已由标题说明「离线」,只留时间;其余显示「状态 · 说明」。 */+export function deviceManagementStatusText(row: Pick<DeviceListItem, 'state' | 'statusDetail' | 'statusLabel'>): string {+ return row.state === 'offline' ? row.statusDetail : `${row.statusLabel} · ${row.statusDetail}`;+}diff --git a/apps/mobile/src/session/fullAccessConfirmationCopy.ts b/apps/mobile/src/session/fullAccessConfirmationCopy.tsindex 0a997a01f5..fd6f1804c6 100644--- a/apps/mobile/src/session/fullAccessConfirmationCopy.ts+++ b/apps/mobile/src/session/fullAccessConfirmationCopy.ts@@ -1,15 +1,21 @@/*** Full access 确认弹窗的多语文案。*- * 单独成模块是为了**能被术语门禁扫到**:这是不走 i18next 的手写多语 catalog,- * check-i18n-glossary.mjs 只读 locale JSON 扫不到它。而它恰恰是全 App 风险最高的一处- * 提示——用户在这里决定是否关掉工作区沙箱、跳过逐条批准,措辞含糊的代价很实在。+ * 正本在 i18n locale JSON(`interaction.permission.fullAccessConfirm.*`),与权限选择器+ * `interaction.permission.mode.bypass` 同名(zh「完全访问」/ ja「フルアクセス」/ ko「전체 접근」),+ * 因此根门禁 check-i18n-glossary.mjs 可直接扫到。本模块只把五语 JSON 投影成按语言取值的+ * 对象,保留原导出形态:确认弹窗在 Alert 调用时按「手动语言优先、否则系统语言」取值,+ * 不依赖 i18next 当前语言;且本模块不 import react-native,测试可直接 import。*- * 之所以不能留在 fullAccessConfirmation.ts 里被测试直接 import:那个文件 import 了- * react-native,vitest 解析不了 RN 的 Flow 源码。- *- * 覆盖它的是 src/__tests__/shadowCatalogGlossary.test.ts。+ * 影子 catalog 门禁 src/__tests__/shadowCatalogGlossary.test.ts 仍覆盖这份投影。*/+import { BRAND_NAME } from "@cindy/maker-shared/branding";++import enInteraction from "@/i18n/locales/en/interaction.json";+import jaInteraction from "@/i18n/locales/ja/interaction.json";+import koInteraction from "@/i18n/locales/ko/interaction.json";+import zhCNInteraction from "@/i18n/locales/zh-CN/interaction.json";+import zhTWInteraction from "@/i18n/locales/zh-TW/interaction.json";export type FullAccessConfirmationCopy = Readonly<{title: string;@@ -18,43 +24,27 @@ export type FullAccessConfirmationCopy = Readonly<{cancel: string;}>;+type FullAccessConfirmationSource = { permission: { fullAccessConfirm: FullAccessConfirmationCopy } };++/** locale JSON 里的 {{appName}} 由 i18next defaultVariables 注入;这里不经 i18next,手动替换。 */+function project(source: FullAccessConfirmationSource): FullAccessConfirmationCopy {+ const copy = source.permission.fullAccessConfirm;+ const fill = (value: string) => value.replace(/\{\{appName\}\}/g, BRAND_NAME);+ return {+ title: fill(copy.title),+ description: fill(copy.description),+ confirm: fill(copy.confirm),+ cancel: fill(copy.cancel),+ };+}+export const FULL_ACCESS_CONFIRMATION_COPY: Record<"en" | "ja" | "ko" | "zh-CN" | "zh-TW",FullAccessConfirmationCopy> = {- en: {- title: "Enable Full access?",- description:- "Full access disables the workspace sandbox and skips routine approvals. Cindy can modify files outside the workspace and run network commands without asking; built-in high-risk operations will still require confirmation.",- confirm: "Enable Full access",- cancel: "Keep current permissions",- },- ja: {- title: "Full access を有効にしますか?",- description:- "Full access はワークスペースのサンドボックスを無効にし、通常の承認を省略します。Cindy はワークスペース外のファイル変更やネットワークコマンドを確認なしで実行できます。組み込みの高リスク操作では引き続き確認が必要です。",- confirm: "Full access を有効にする",- cancel: "現在の権限を維持",- },- ko: {- title: "Full access를 활성화할까요?",- description:- "Full access는 작업 공간 샌드박스를 비활성화하고 일반 승인을 건너뜁니다. Cindy가 작업 공간 밖의 파일을 수정하고 네트워크 명령을 묻지 않고 실행할 수 있습니다. 기본 제공 고위험 작업은 계속 확인을 요청합니다.",- confirm: "Full access 활성화",- cancel: "현재 권한 유지",- },- "zh-CN": {- title: "开启 Full access?",- description:- "Full access 会关闭工作区沙箱并跳过常规审批。Cindy 可以修改工作区外的文件、执行联网命令且不再询问;内置高风险操作仍会要求确认。",- confirm: "开启 Full access",- cancel: "保留当前权限",- },- "zh-TW": {- title: "開啟 Full access?",- description:- "Full access 會關閉工作區沙箱並跳過常規審批。Cindy 可以修改工作區外的檔案、執行聯網命令且不再詢問;內建高風險操作仍會要求確認。",- confirm: "開啟 Full access",- cancel: "保留當前權限",- },+ en: project(enInteraction),+ ja: project(jaInteraction),+ ko: project(koInteraction),+ "zh-CN": project(zhCNInteraction),+ "zh-TW": project(zhTWInteraction),};diff --git a/apps/mobile/src/session/homeMenuFadeTiming.ts b/apps/mobile/src/session/homeMenuFadeTiming.tsnew file mode 100644index 0000000000..24073756af--- /dev/null+++ b/apps/mobile/src/session/homeMenuFadeTiming.ts@@ -0,0 +1,15 @@+import { useReduceMotionEnabled } from '@/hooks/useReduceMotion';+import { motionDuration } from '@/theme/tokens';++/**+ * 首页玻璃菜单(范围菜单、显示设置、搜索筛选)共用的淡入淡出时长,喂给+ * useModalFadeLifecycle。三者都是 HomeMenuScrim + HomeGlassMenuPanel 的轻浮层,+ * 按 DESIGN.md §14.4「Light overlay」取 fast 入场 / instant 退场(退场快于入场)。+ * 减弱动态效果(含尚未查询到的首帧)直接显示 / 消失,不播过渡。+ */+export function useHomeMenuFadeTiming(): { inMs: number; outMs: number } {+ const reduceMotion = useReduceMotionEnabled();+ return reduceMotion === false+ ? { inMs: motionDuration.fast, outMs: motionDuration.instant }+ : { inMs: 0, outMs: 0 };+}diff --git a/apps/mobile/src/session/sessionDurationFormat.ts b/apps/mobile/src/session/sessionDurationFormat.tsnew file mode 100644index 0000000000..1ebaf56a0a--- /dev/null+++ b/apps/mobile/src/session/sessionDurationFormat.ts@@ -0,0 +1,30 @@+/**+ * 会话页里展示给用户的时长(「已工作 3 分 25 秒」「思考 12 秒」、composer 工作状态计时)。+ *+ * 共享包 `formatDuration`(@cindy/maker-shared)固定输出 `3m 25s` 这种英文紧凑写法,+ * 桌面也在用,不改共享包;移动端展示层在这里按当前语言本地化,五语格式各自走 i18n。+ * 取整口径与共享包一致:按秒四舍五入,至少 1 秒;不折算小时(与共享包同语义)。+ */+import { i18n } from '@/i18n';++/** 毫秒时长 → 本地化文案(至少 1 秒,与共享包 formatDuration 同取整)。 */+export function formatLocalizedDuration(ms: number): string {+ const totalSec = Math.max(1, Math.round((Number.isFinite(ms) ? ms : 0) / 1000));+ return formatLocalizedSeconds(totalSec);+}++/**+ * 整秒时长 → 本地化文案(允许 0 秒,供实时计时从 0 起跳)。+ * alwaysShowSeconds:实时计时用,整分时也写「3 分 0 秒」,避免文案宽度逐秒跳动。+ */+export function formatLocalizedSeconds(+ seconds: number,+ { alwaysShowSeconds = false }: { alwaysShowSeconds?: boolean } = {},+): string {+ const safe = Math.max(0, Math.floor(Number.isFinite(seconds) ? seconds : 0));+ const minutes = Math.floor(safe / 60);+ const rest = safe % 60;+ if (minutes === 0) return i18n.t('message.renderer.durationSeconds', { seconds: rest });+ if (rest === 0 && !alwaysShowSeconds) return i18n.t('message.renderer.durationMinutes', { minutes });+ return i18n.t('message.renderer.durationMinutesSeconds', { minutes, seconds: rest });+}diff --git a/apps/mobile/src/session/settingsDeviceDirectory.ts b/apps/mobile/src/session/settingsDeviceDirectory.tsnew file mode 100644index 0000000000..963d702d96--- /dev/null+++ b/apps/mobile/src/session/settingsDeviceDirectory.ts@@ -0,0 +1,90 @@+import { useEffect, useState, useSyncExternalStore } from 'react';+import type { DeviceView } from '@cindy/device-link';+import { useAuth } from '@/auth/AuthContext';+import { DEVICE_LINK_API_BASE_URL } from '@/config/env';+import { useDeviceLink } from '@/device-link/DeviceLinkContext';+import {+ collectMobileVoiceDictionaryHosts,+ patchMobileVoiceDictionaryHosts,+ type MobileVoiceDictionaryHost,+} from '@/session/mobileVoiceDictionaryView';++export const SETTINGS_DEVICE_TIMEOUT_MS = 12_000;++/**+ * 本机名称的进程内最新值。设置页与「设备名称」子页是两个路由:子页保存成功后+ * 在这里发布,设置页返回时立即显示新名称,不用等下一次设备清单请求。+ * 按 deviceId 记,换账号 / 换设备 ID 后旧值自动失效。+ */+let publishedSelfDeviceName: { deviceId: string; name: string } | null = null;+const selfDeviceNameListeners = new Set<() => void>();++export function publishSelfDeviceName(deviceId: string, name: string | null): void {+ publishedSelfDeviceName = name ? { deviceId, name } : null;+ selfDeviceNameListeners.forEach((listener) => listener());+}++function subscribeSelfDeviceName(listener: () => void): () => void {+ selfDeviceNameListeners.add(listener);+ return () => selfDeviceNameListeners.delete(listener);+}++function usePublishedSelfDeviceName(deviceId: string | null | undefined): string | null {+ const published = useSyncExternalStore(subscribeSelfDeviceName, () => publishedSelfDeviceName);+ return deviceId && published?.deviceId === deviceId ? published.name : null;+}++/**+ * 设置页及其子页共用的设备清单读取:本机名称(正本在 device-link 服务端)+ 词典宿主电脑。+ * 电脑的在线状态跟 presence 实时修补 —— 设置页可能开着很久,REST 快照会过期。+ */+export function useSettingsDeviceDirectory(): {+ desktopDevices: readonly MobileVoiceDictionaryHost[];+ selfDeviceName: string | null;+} {+ const auth = useAuth();+ const { lastPresenceSnapshot } = useDeviceLink();+ const [desktopDevices, setDesktopDevices] = useState<readonly MobileVoiceDictionaryHost[]>([]);+ const publishedName = usePublishedSelfDeviceName(auth.deviceId);++ useEffect(() => {+ if (!auth.isAuthenticated || !auth.deviceId) {+ if (publishedSelfDeviceName) publishSelfDeviceName('', null);+ // 登出/未登录才清空电脑列表 —— 拉取失败不清(见下面 catch 的说明)。+ setDesktopDevices([]);+ return;+ }++ const selfDeviceId = auth.deviceId;+ let cancelled = false;+ void auth.apiFetch<{ devices: DeviceView[] }>('/api/device-link/devices', {+ baseUrl: DEVICE_LINK_API_BASE_URL,+ timeoutMs: SETTINGS_DEVICE_TIMEOUT_MS,+ })+ .then((res) => {+ if (cancelled) return;+ const self = res.devices.find((device) => device.deviceId === selfDeviceId);+ publishSelfDeviceName(selfDeviceId, self?.name?.trim() || null);+ // 同一份设备清单顺带筛出电脑:词典正本在电脑上,手机按电脑分别展示。+ setDesktopDevices(collectMobileVoiceDictionaryHosts(res.devices));+ })+ .catch(() => {+ if (cancelled) return;+ // 本机名称保留上一次已知值(没有时回退系统名)。电脑列表刻意不清空:这只是一次+ // 拉取失败(断网、超时),不代表用户没有电脑。+ // 清掉的话词典页会显示成「还没有电脑」,连带 hydrate/refresh 也没有 host 可+ // 跑 —— 明明本地还有一份可用的离线缓存。真正该清空的时机是登出。+ });++ return () => {+ cancelled = true;+ };+ }, [auth]);++ useEffect(() => {+ if (!lastPresenceSnapshot) return;+ setDesktopDevices((current) => patchMobileVoiceDictionaryHosts(current, lastPresenceSnapshot));+ }, [lastPresenceSnapshot]);++ return { desktopDevices, selfDeviceName: publishedName };+}diff --git a/apps/mobile/src/session/useComposerPillOpen.ts b/apps/mobile/src/session/useComposerPillOpen.tsnew file mode 100644index 0000000000..269c8ed30f--- /dev/null+++ b/apps/mobile/src/session/useComposerPillOpen.ts@@ -0,0 +1,43 @@+import { useCallback, useEffect, useRef, useState } from 'react';+import { useReduceMotionEnabled } from '@/hooks/useReduceMotion';++/** Native focuses the input as the card opens; JS only covers a missing native view. */+const FALLBACK_FOCUS_MS = 320;+/** Long enough for onFocus to arrive after focus(); only a fallback release. */+const FOCUS_GRACE_MS = 400;++/**+ * iOS composer dock: a tap on the compact pill first pulls it open into+ * the card (native glass growth keyed by `expandToken`), then the input is+ * focused so the keyboard follows.+ * `opening` holds the card open until focus lands; it is released shortly+ * after either way so a refused focus cannot leave the card stuck open.+ */+export function useComposerPillOpen(enabled: boolean, focus: () => void) {+ const reduceMotion = useReduceMotionEnabled();+ const [opening, setOpening] = useState(false);+ const [openCount, setOpenCount] = useState(0);+ const timers = useRef<ReturnType<typeof setTimeout>[]>([]);+ const focusRef = useRef(focus);+ focusRef.current = focus;+ useEffect(() => () => { timers.current.forEach(clearTimeout); }, []);+ const open = useCallback(() => {+ if (timers.current.length > 0) return;+ setOpening(true);+ setOpenCount(count => count + 1);+ timers.current.push(setTimeout(() => {+ focusRef.current();+ timers.current.push(setTimeout(() => {+ timers.current = [];+ setOpening(false);+ }, FOCUS_GRACE_MS));+ }, FALLBACK_FOCUS_MS));+ }, []);+ const active = enabled && reduceMotion === false;+ return {+ opening,+ onCollapsedPress: active ? open : undefined,+ // Mounted while enabled so native already knows the pill's frame on the first open.+ expandToken: active ? String(openCount) : undefined,+ };+}diff --git a/apps/mobile/src/session/useModalFadeLifecycle.ts b/apps/mobile/src/session/useModalFadeLifecycle.tsindex d6042c79fb..4c8583be31 100644--- a/apps/mobile/src/session/useModalFadeLifecycle.ts+++ b/apps/mobile/src/session/useModalFadeLifecycle.ts@@ -13,6 +13,11 @@*/import { useCallback, useEffect, useRef, useState } from 'react';import { Animated, Easing } from 'react-native';+import { motionEasing } from '@/theme/tokens';++// Shared entrance / exit curves (DESIGN §14.4), same as every other overlay.+const EASE_IN = Easing.bezier(...motionEasing.out);+const EASE_OUT = Easing.bezier(...motionEasing.in);export interface ModalFadeLifecycleOptions {/** 进场时长(ms)。docs/design-rules/cindy-design-system.md §14.4:纯透明度过渡 ≤150ms。 */@@ -48,7 +53,7 @@ export function useModalFadeLifecycle(const startIn = useCallback(() => {Animated.timing(progress, {duration: inMs,- easing: Easing.out(Easing.quad),+ easing: EASE_IN,toValue: 1,useNativeDriver: true,}).start();@@ -69,7 +74,7 @@ export function useModalFadeLifecycle(if (!mountedRef.current) return; // 从未打开/已完全关闭:无需播退场。Animated.timing(progress, {duration: outMs,- easing: Easing.in(Easing.quad),+ easing: EASE_OUT,toValue: 0,useNativeDriver: true,}).start(({ finished }) => {diff --git a/apps/mobile/src/theme/tokens.ts b/apps/mobile/src/theme/tokens.tsindex f1af74c8fd..95ac2b95cd 100644--- a/apps/mobile/src/theme/tokens.ts+++ b/apps/mobile/src/theme/tokens.ts@@ -36,6 +36,8 @@ export interface ThemeColors {surface: string;/** 抬一层的 Card / 弹窗 / 输入框 */surfaceElevated: string;+ /** 首页导航抽屉投影,局部浮层例外(2026-09-27 用户要求)。 */+ homeDrawerShadow: string;/** Surface 半透明(吸顶栏等,solid 非模糊——chrome/composer 热路径专用,守护测试禁 BlurView) */surfaceTranslucent: string;/** 侧栏/抽屉类面板毛玻璃底色(R1 audit 模式1,blur≈50 等效;BlurView tint 用) */@@ -407,6 +409,7 @@ export const lightColors: ThemeColors = {taskTagWhiteCheck: '#525252',surfaceElevated: '#FFFFFC',+ homeDrawerShadow: 'rgba(0, 0, 0, 0.16)',surfaceTranslucent: 'rgba(249, 249, 246, 0.78)',surfaceTranslucentSidebar: 'rgba(255, 255, 252, 0.90)',chatHeaderSurface: 'rgba(249, 249, 246, 0.90)',@@ -494,6 +497,7 @@ export const darkColors: ThemeColors = {taskTagWhite: '#ffffff',taskTagWhiteCheck: '#525252',surfaceElevated: '#1E1E1E',+ homeDrawerShadow: 'rgba(0, 0, 0, 0.40)',surfaceTranslucent: 'rgba(18, 18, 18, 0.78)',surfaceTranslucentSidebar: 'rgba(10, 10, 10, 0.85)',chatHeaderSurface: 'rgba(18, 18, 18, 0.80)',diff --git a/docs/design-rules/DESIGN.md b/docs/design-rules/DESIGN.mdindex 6dd1be3bda..bc59018f3c 100644--- a/docs/design-rules/DESIGN.md+++ b/docs/design-rules/DESIGN.md@@ -540,13 +540,15 @@ Making something clickable never moves a layer between Step 1 and Step 2.## 6. Depth & Elevation+**Mobile home navigation drawer exception (owner request, 2026-09-27):** The left-edge main menu uses an elevated surface, right-side container corners, and a soft outward shadow from mobile's `homeDrawerShadow` theme token. This exception is confined to `HomeChromeDrawer` (including its companion entry), not in-page cards or the task-list sidebar. The account header puts the user's name first, with a default letter avatar, optional email, and a small organization logo beside the organization name; do not show an account ID. Opening waits for native layout, then translates the panel and fades the backdrop together; drag, cancellation and close share one UI-thread progress value and respect reduced motion. Numeric values remain in mobile tokens and component styles.+| Level | Treatment | Use || ------------------ | ------------------------------------------------------------------------- | ---------------------------------------------- || Flat (Level 0) | No shadow, no border | Surface background, most content || Bordered (Level 1) | `1px solid` Board (`#d7d7d4` Light / `#3c3c3a` Dark) | Cards, code blocks, dividers, section outlines || Lifted (Card) | Card fill (`#ffffff` Light / `#2c2c2a` Dark) + optional 1px Board outline | Login cards, modals, raised panels |-**Shadow Philosophy**: Cindy's base visual language uses **zero shadows**. This is not an oversight — it's a deliberate design decision. The flat, shadowless approach creates a paper-like experience where elements are distinguished purely by background color and single-pixel borders. Depth is communicated through **content hierarchy and typography weight**, not visual layering. (The only shadows in the system are the token-gated floating-layer exceptions and the Slider thumb (§15.18) / Segmented selected-pill (§4) exceptions registered in §10 — `--shadow-menu` / `--cmd-palette-shadow` / `--confirm-shadow` / `--segmented-selected-shadow`; never add ad-hoc shadows to in-page elements. A Switch-knob shadow was trialed and explicitly rejected — user ruling 2026-08-05: the legacy `shadow-lg` on the 16px thumb was invisible in practice, and a visible replacement read as noise; the knob is flat by decision, don't re-add it.)+**Shadow Philosophy**: Cindy's base visual language uses **zero shadows**. This is not an oversight — it's a deliberate design decision. The flat, shadowless approach creates a paper-like experience where elements are distinguished purely by background color and single-pixel borders. Depth is communicated through **content hierarchy and typography weight**, not visual layering. (The only shadows in the system are the mobile home drawer exception above and the token-gated floating-layer exceptions and the Slider thumb (§15.18) / Segmented selected-pill (§4) exceptions registered in §10 — `--shadow-menu` / `--cmd-palette-shadow` / `--confirm-shadow` / `--segmented-selected-shadow`; never add ad-hoc shadows to in-page elements. A Switch-knob shadow was trialed and explicitly rejected — user ruling 2026-08-05: the legacy `shadow-lg` on the 16px thumb was invisible in practice, and a visible replacement read as noise; the knob is flat by decision, don't re-add it.)## 7. Do's and Don'tsdiff --git a/docs/design-rules/design-decision-log.md b/docs/design-rules/design-decision-log.mdindex 0f0adbfafb..78b8b95999 100644--- a/docs/design-rules/design-decision-log.md+++ b/docs/design-rules/design-decision-log.md@@ -12,6 +12,8 @@## 2026-09+- **09-27 移动端主菜单账号层级与抽屉层次**——用户要求姓名放大、默认头像取代公司大 Logo、公司 Logo 缩为小图标、不展示 ID;左侧菜单滑出更流畅,右侧有圆角和适当阴影。账号头以用户姓名为主,邮箱与组织信息为辅;仅首页主菜单抽屉(含伙伴入口)登记柔和投影例外,取代该处零阴影要求,不扩展到页面卡片与任务列表侧栏。落点:`DESIGN.md §6`、`mobile-design-guide.md §1`、`HomeChromeDrawer.tsx` 与 `homeDrawerShadow` 色板 token。方向授权不代表实机视觉验收。+- **09-27 字重 / 字号 / 行高规则复核补丁**——整体复核后补齐遗漏并澄清三条口径:chip 底上的徽标与字母标记可用 600(按图形元素处理,不受「浅色字不配粗字重」限制);文字需与相邻图标、按钮或行内正文对齐时,行高跟随被对齐对象(对齐例外);只有单行输入框不设行高,多行编辑区可配标准行高。同时补齐:iOS 对话输入框占位字改用 `textPlaceholder`;队友主页顶栏标题与「所有任务」一致(20 · 600);远程任务建议空状态标题、浏览器菜单标题、伙伴邀请等待页标题改为 600;伙伴变体里的二级色类别标签改为 500;计划正文由 12 改为 13;11 处独立段落的非标准行高回到标准配对。本条为规则裁决,不代表实机视觉验收。- **09-27 移动端文字行高补齐并按字号成对**——字号收拢后单独一轮处理行高。约 330 处没配行高的文字样式(含 30 处内联样式)按标准配对补齐:11/16、12/18、13/18、15/20、16/22、17/26、18/26、20/25、24/30、30/36、40/44;20 号标题统一回 20/25(原 19 号并入的首页顶栏标题 27、弹窗标题 26),删除不再使用的 27 行高(`listTitleCompact`)。保留的登记场景:首页列表与队友行节奏值、代码 / diff 紧凑行高、对话流 Markdown 标题、长文阅读 24。输入框不设行高(iOS 占位字与光标会偏位),登录画布不动。新增守护测试:设了字号的文字样式必须同时设行高。落点:`apps/mobile/src/theme/tokens.ts`、`typographyTokenDiscipline.test.ts`、`mobile-design-guide.md §3`。本条为规则裁决,不代表实机视觉验收。diff --git a/scripts/mobile-navigation-demo.mjs b/scripts/mobile-navigation-demo.mjsnew file mode 100644index 0000000000..64818833b5--- /dev/null+++ b/scripts/mobile-navigation-demo.mjs@@ -0,0 +1,137 @@+#!/usr/bin/env node+// Local-only trial entry. No dev server, distribution signing, publishing or OTA upload.+import { execFileSync, spawnSync } from 'node:child_process';+import { createRequire } from 'node:module';+import { dirname, resolve } from 'node:path';+import { fileURLToPath } from 'node:url';+import { constants, copyFileSync, existsSync, mkdtempSync, readdirSync, readFileSync, writeFileSync, renameSync, statSync } from 'node:fs';+import { tmpdir } from 'node:os';+import { podInstallBounded } from '../apps/mobile/scripts/sim-pod-install.mjs';+import { computeSimulatorNativeFingerprint, inspectSimulatorNativeIdentity } from '../apps/mobile/scripts/lib/sim-native-identity.mjs';++const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');+const mobile = resolve(root, 'apps/mobile');+const args = process.argv.slice(2);+const command = args[0] ?? 'inspect';+const region = args.find(arg => arg.startsWith('--region='))?.slice(9);+const platform = args.find(arg => arg.startsWith('--platform='))?.slice(11);+const udid = args.find(arg => arg.startsWith('--udid='))?.slice(7);+if (!['inspect', 'export', 'simulator'].includes(command) || !['cn', 'global'].includes(region)+ || args.some((arg, index) => index > 0 && !arg.startsWith('--region=') && !arg.startsWith('--platform=') && !arg.startsWith('--udid='))+ || (command === 'export' && !['ios', 'android'].includes(platform))+ || (command === 'simulator' && (process.platform !== 'darwin' || !/^[A-Fa-f0-9-]{36}$/.test(udid ?? '')))) {+ throw new Error('Usage: inspect --region=cn|global; export --region=cn|global --platform=ios|android; simulator --region=cn|global --udid=<booted simulator UUID>');+}+const branch = execFileSync('git', ['branch', '--show-current'], { cwd: root, encoding: 'utf8' }).trim();+if (branch !== 'experiment/mobile-bottom-navigation') throw new Error('This entry belongs to experiment/mobile-bottom-navigation only');+execFileSync('git', ['merge-base', '--is-ancestor', 'c2dd5e0c5669420a785c1dfe2edd6bcc660afb9c', 'HEAD'], { cwd: root });++// No .env or production provider registrations are borrowed from other worktrees.+for (const key of Object.keys(process.env)) {+ if (key.startsWith('EXPO_PUBLIC_CINDY_GOOGLE_') || key.startsWith('EXPO_PUBLIC_CINDY_WECHAT_')+ || key.startsWith('EAS_') || key === 'CINDY_SELF_HOST_REGIONS_FILE'+ || key === 'CINDY_MOBILE_UPDATES_URL' || key === 'CINDY_MOBILE_OTA_NATIVE'+ || key === 'EXPO_PUBLIC_APP_VARIANT' || key === 'EXPO_PUBLIC_BETA_DEV') delete process.env[key];+}+Object.assign(process.env, {+ EXPO_PUBLIC_CINDY_NAV_DEMO: '1', EXPO_PUBLIC_CINDY_AUTH_REGION: region,+ EXPO_PUBLIC_XDT_OTA_SELFHOST: '0', CINDY_USE_LOCAL_REGION_CONFIG: '0',+ EXPO_NO_DOTENV: '1', EXPO_NO_TELEMETRY: '1',+});+const require = createRequire(import.meta.url);+const config = require(resolve(mobile, 'app.config.js'))();+const expectedId = region === 'cn' ? 'com.xd.cindycn.navdemo' : 'com.xd.cindy.navdemo';+if (config.ios.bundleIdentifier !== expectedId || config.android.package !== expectedId+ || config.updates.enabled !== false || config.updates.url || config.extra.eas) {+ throw new Error('Trial isolation check failed');+}+console.log(JSON.stringify({ directory: root, branch, baseline: 'c2dd5e0c56', region,+ applicationId: expectedId, scheme: config.scheme, automaticUpdates: false,+ nativeInstallVerified: false }, null, 2));+if (command === 'export' || command === 'simulator') {+ // Metro resolves even the unused dev require. Use the public example only;+ // never copy an internal endpoint file or .env from another worktree.+ const devEndpoint = resolve(root, 'config/endpoint.dev.json');+ if (!existsSync(devEndpoint)) copyFileSync(resolve(root, 'config/endpoint.dev.json.example'), devEndpoint, constants.COPYFILE_EXCL);+}+if (command === 'export') {+ const destination = mkdtempSync(resolve(tmpdir(), 'cindy-navigation-demo-' + region + '-' + platform + '-'));+ console.log('Export destination: ' + destination);+ const result = spawnSync(process.platform === 'win32' ? 'pnpm.cmd' : 'pnpm',+ ['exec', 'expo', 'export', '--platform', platform, '--output-dir', destination, '--max-workers', '2'],+ { cwd: mobile, env: process.env, stdio: 'inherit', shell: process.platform === 'win32' });+ if (result.error) throw result.error;+ process.exitCode = result.status ?? 1;+}+if (command === 'simulator') {+ const run = (bin, argv, cwd = mobile) => execFileSync(bin, argv, { cwd, env: process.env, stdio: 'inherit' });+ const capture = (bin, argv) => execFileSync(bin, argv, { cwd: mobile, env: process.env, encoding: 'utf8' }).trim();+ const xcodeVersion = capture('xcodebuild', ['-version']);+ const version = /Xcode (\d+)\.(\d+)/.exec(xcodeVersion);+ if (!version || Number(version[1]) < 27 || (Number(version[1]) === 27 && Number(version[2]) < 1)) {+ throw new Error('Navigation trial requires Xcode 27.1+ to compile Duo reserved-region support. Set DEVELOPER_DIR explicitly.');+ }+ // Swift 6.4 in 27.1 spells private C++ names __ObjC::expo instead of+ // __ObjC.expo. Extend Expo's existing interface sanitizer for this syntax.+ // Atomic replacement breaks pnpm hardlinks: other worktrees/store stay intact.+ const jsiScript = resolve(dirname(require.resolve('expo-modules-jsi/package.json')), 'apple/scripts/build-xcframework.sh');+ const jsiSource = readFileSync(jsiScript, 'utf8');+ const oldSanitizer = String.raw`/^extension __ObjC\./`;+ const newSanitizer = '/^extension __ObjC[.:]/';+ if (jsiSource.includes(oldSanitizer)) {+ const replacement = jsiScript + '.navigation-demo-tmp';+ writeFileSync(replacement, jsiSource.replace(oldSanitizer, newSanitizer), { mode: statSync(jsiScript).mode });+ renameSync(replacement, jsiScript);+ } else if (!jsiSource.includes(newSanitizer)) {+ throw new Error('ExpoModulesJSI interface sanitizer changed; review the trial Xcode compatibility adjustment');+ }+ const devices = JSON.parse(capture('xcrun', ['simctl', 'list', 'devices', 'booted', '--json']));+ if (!Object.values(devices.devices).flat().some(device => device.udid.toLowerCase() === udid.toLowerCase() && device.state === 'Booted')) {+ throw new Error('Select an exact booted simulator; no other device will be changed');+ }+ Object.assign(process.env, { NODE_ENV: 'production', CI: '1' });+ const ios = resolve(mobile, 'ios');+ const buildDir = resolve(ios, 'build-navigation-demo-' + region);+ const readId = path => capture('plutil', ['-extract', 'CFBundleIdentifier', 'raw', '-o', '-', resolve(path, 'Info.plist')]);+ let workspace = existsSync(ios) ? readdirSync(ios).find(name => name.endsWith('.xcworkspace')) : undefined;+ const previousApp = workspace+ ? resolve(buildDir, 'Build/Products/Release-iphonesimulator', workspace.slice(0, -'.xcworkspace'.length) + '.app')+ : null;+ const reusableNativeProject = previousApp && existsSync(resolve(previousApp, 'Info.plist'))+ && readId(previousApp) === expectedId+ && inspectSimulatorNativeIdentity({ appPath: previousApp, projectDir: mobile, env: process.env }).healthy;+ if (reusableNativeProject) {+ console.log('Native inputs still match the existing build; refreshing bundled JavaScript without regenerating Pods.');+ } else {+ console.log('Generating isolated native project (no device data or existing apps are removed).');+ run('pnpm', ['exec', 'expo', 'prebuild', '--platform', 'ios', '--no-install']);+ await podInstallBounded({ iosDir: ios, env: process.env });+ workspace = readdirSync(ios).find(name => name.endsWith('.xcworkspace'));+ }+ if (!workspace) throw new Error('Native workspace missing after prebuild');+ const scheme = workspace.slice(0, -'.xcworkspace'.length);+ console.log('Building self-contained simulator app. Existing Metro services are not used.');+ run('xcodebuild', ['-workspace', resolve(ios, workspace), '-scheme', scheme,+ '-configuration', 'Release', '-sdk', 'iphonesimulator', '-destination', 'platform=iOS Simulator,id=' + udid,+ '-derivedDataPath', buildDir, '-jobs', '4', 'ONLY_ACTIVE_ARCH=YES', '-quiet', 'build']);+ const app = resolve(buildDir, 'Build/Products/Release-iphonesimulator', scheme + '.app');+ const sdk = capture('plutil', ['-extract', 'DTSDKName', 'raw', '-o', '-', resolve(app, 'Info.plist')]);+ if (!/^iphonesimulator27\.[1-9]/.test(sdk) && !/^iphonesimulator(2[8-9]|[3-9]\d)/.test(sdk)) {+ throw new Error('Built app does not contain a Duo-capable 27.1+ simulator SDK identity');+ }+ capture('plutil', ['-extract', 'UIApplicationSceneManifest', 'json', '-o', '-', resolve(app, 'Info.plist')]);+ if (readId(app) !== expectedId) throw new Error('Refusing to install a non-trial app');+ if (!existsSync(resolve(app, 'main.jsbundle'))) throw new Error('Embedded JavaScript missing; refusing to depend on another Metro');+ const expectedFingerprint = computeSimulatorNativeFingerprint(mobile, process.env);+ const beforeInstall = inspectSimulatorNativeIdentity({ appPath: app, expectedFingerprint });+ if (!beforeInstall.healthy) throw new Error('Built native runtime mismatch: ' + beforeInstall.code);+ run('xcrun', ['simctl', 'install', udid, app]);+ const installedApp = capture('xcrun', ['simctl', 'get_app_container', udid, expectedId, 'app']);+ if (readId(installedApp) !== expectedId || !inspectSimulatorNativeIdentity({ appPath: installedApp, expectedFingerprint }).healthy) {+ throw new Error('Installed trial identity/runtime did not match the build');+ }+ run('xcrun', ['simctl', 'launch', '--terminate-running-process', udid, expectedId]);+ run(process.execPath, [resolve(mobile, 'scripts/sim-open.mjs'), '--udid', udid]);+ console.log(JSON.stringify({ app, udid, applicationId: expectedId, fingerprint: expectedFingerprint,+ embeddedJavaScript: true, nativeInstallVerified: true, pageVerified: false }, null, 2));+}