Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(mobile): center home device selector between symmetric action slots

DavidShen4afce0c04c45
diff --git a/apps/mobile/src/session/HomeSurface.tsx b/apps/mobile/src/session/HomeSurface.tsx
index 37455317c7..425cf86ac6 100644
--- a/apps/mobile/src/session/HomeSurface.tsx
+++ b/apps/mobile/src/session/HomeSurface.tsx
@@ -260,7 +260,7 @@ 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, navigationChrome, radius, spacing, typeScale } from '@/theme/tokens';
const LIST_LIMIT = 200;
// Keep the device-link channel responsive while All Sessions hydrates several
@@ -2825,6 +2825,7 @@ function HomeScreenContent({ active = true, onModeChange, width, onDismiss, newS
<View style={{ paddingTop: nativeHomeHeader ? 0 : embedded ? spacing.lg : edgePadding.paddingTop }}>
{nativeHomeHeader ? null : (
<View style={styles.homeHeader}>
+ <View style={styles.headerLeadingActions}>
<HomeHeaderGlassButton
accessibilityLabel={onDismiss ? t('home.drawer.closeA11y') : t('devices.list.a11y.openMenu')}
onPress={onDismiss ?? openChromeMenu}
@@ -2832,6 +2833,7 @@ function HomeScreenContent({ active = true, onModeChange, width, onDismiss, newS
>
<>{onDismiss ? <X color={colors.textPrimary} size={iconSize.action} strokeWidth={iconStroke.regular} /> : <Menu color={colors.textPrimary} size={iconSize.action} strokeWidth={iconStroke.regular} />}</>
</HomeHeaderGlassButton>
+ </View>
{showRemoteGuide ? (
// 引导态没有可筛选的范围:正中只留品牌标题。
<View style={styles.headerTitleWrap} testID="devices.title">
@@ -2860,7 +2862,7 @@ function HomeScreenContent({ active = true, onModeChange, width, onDismiss, newS
</NativePullDownMenu>
)}
{showRemoteGuide ? (
- <View style={styles.headerIconButton} />
+ <View style={styles.headerActions} />
) : (
<View style={styles.headerActions}>
{selectedDeviceId && !embedded ? (
@@ -4563,17 +4565,22 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({
paddingBottom: spacing.md,
paddingHorizontal: spacing.lg,
},
- headerIconButton: {
- alignItems: 'center',
+ headerLeadingActions: {
+ // Match the trailing two-button slot so the title is centered on the
+ // screen, even when selecting a device reveals the remote-desktop action.
+ alignItems: 'flex-start',
flexShrink: 0,
- height: 44,
+ height: navigationChrome.target,
justifyContent: 'center',
- width: 44,
+ width: navigationChrome.target * 2 + spacing.xs,
},
headerActions: {
alignItems: 'center',
flexDirection: 'row',
+ flexShrink: 0,
gap: spacing.xs,
+ justifyContent: 'flex-end',
+ width: navigationChrome.target * 2 + spacing.xs,
},
// 菜单外层替标题占住顶栏中间的剩余宽度,长设备名在这里截断而不是挤开右侧按钮。
headerTitleSlot: {