Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
fix(mobile): use icon size tokens in attachment previews
ylliuuu664cd3e9d4fa61
diff --git a/apps/mobile/src/__tests__/BotGroupTextAttachmentPreview.test.tsx b/apps/mobile/src/__tests__/BotGroupTextAttachmentPreview.test.tsxindex 6783316772..32c776c314 100644--- a/apps/mobile/src/__tests__/BotGroupTextAttachmentPreview.test.tsx+++ b/apps/mobile/src/__tests__/BotGroupTextAttachmentPreview.test.tsx@@ -21,6 +21,7 @@ vi.mock('lucide-react-native', () => ({vi.mock('react-i18next', () => ({ useTranslation: () => ({ t: (key: string) => key }) }));vi.mock('@/theme', () => ({fontWeight: { semibold: '600' },+ iconSize: { action: 20, md: 16 },lineHeight: { bodySmall: 20 },monoFont: 'monospace',radius: { pill: 9999 },diff --git a/apps/mobile/src/session/BotGroupTextAttachmentPreview.tsx b/apps/mobile/src/session/BotGroupTextAttachmentPreview.tsxindex 8758b831b9..d205101d8f 100644--- a/apps/mobile/src/session/BotGroupTextAttachmentPreview.tsx+++ b/apps/mobile/src/session/BotGroupTextAttachmentPreview.tsx@@ -10,7 +10,7 @@ import { Text } from '@/components/AppText';import { HtmlFileReader } from '@/session/HtmlFileReader';import { MarkdownFileReader } from '@/session/MarkdownFileReader';import { withDownloadedRemoteMediaFile } from '@/session/remoteMediaDiskCacheExpo';-import { fontWeight, lineHeight, monoFont, radius, spacing, textStyles, typeScale, useTheme } from '@/theme';+import { fontWeight, iconSize, lineHeight, monoFont, radius, spacing, textStyles, typeScale, useTheme } from '@/theme';const TEXT_ATTACHMENT_PREVIEW_MAX_BYTES = 10 * 1024 * 1024;const JSON_ATTACHMENT_PREVIEW_MAX_LINES = 10_000;@@ -138,7 +138,7 @@ export function BotGroupTextAttachmentPreview({ attachmentId, fileName, kind, restyle={styles.closeButton}testID="groupChat.server.attachmentPreviewCloseButton">- <X color={colors.textSecondary} size={20} />+ <X color={colors.textSecondary} size={iconSize.action} /></Pressable><Text numberOfLines={1} style={[textStyles.body, styles.title, { color: colors.textPrimary }]}>{fileName}</Text></View>@@ -158,7 +158,7 @@ export function BotGroupTextAttachmentPreview({ attachmentId, fileName, kind, re) : null}{kind !== 'html' && (state.status === 'too-large' || state.status === 'binary') ? (<Pressable accessibilityRole="button" onPress={() => { void openOutside(); }} style={[styles.action, { backgroundColor: colors.surfaceElevated, borderColor: colors.border }]} testID="groupChat.server.attachmentPreviewOpenOutside">- <ExternalLink color={colors.textPrimary} size={16} />+ <ExternalLink color={colors.textPrimary} size={iconSize.md} /><Text style={[textStyles.body, { color: colors.textPrimary }]}>{t('groupChat.server.attachmentPreviewOpenOutside')}</Text></Pressable>) : null}