Import apps/android/src/screens/chat/styles.ts

This commit is contained in:
QQ 2026-11-17 08:29:13 +08:00
parent 0fb947f583
commit d5ed3db684
1 changed files with 246 additions and 299 deletions

View File

@ -1,20 +1,32 @@
import { StyleSheet } from 'react-native' import { StyleSheet } from 'react-native'
import { floatingShadow, radius, spacing, typeForDensity, type TypographyDensity } from '../../ui/theme' import {
DEFAULT_CHAT_APPEARANCE,
floatingShadow,
radius,
resolveChatMetrics,
spacing,
typeForDensity,
type ChatAppearance,
type TypographyDensity,
} from '../../ui/theme'
import type { ThemeColors } from '../../ui/theme-context' import type { ThemeColors } from '../../ui/theme-context'
export function createStyles(colors: ThemeColors, density: TypographyDensity = 'compact') { export function createStyles(
colors: ThemeColors,
density: TypographyDensity = 'compact',
appearance: ChatAppearance = DEFAULT_CHAT_APPEARANCE,
) {
const isCompact = density === 'compact' const isCompact = density === 'compact'
const t = typeForDensity(density) const t = typeForDensity(density)
const m = resolveChatMetrics(density, appearance)
return StyleSheet.create({ return StyleSheet.create({
flex: { flex: 1, backgroundColor: colors.background }, flex: { flex: 1, backgroundColor: colors.background },
splitRoot: { flex: 1 }, splitRoot: { flex: 1 },
splitRootWide: { flexDirection: 'row' }, splitRootWide: { flexDirection: 'row' },
splitSidebar: { width: 300, maxWidth: '38%', backgroundColor: colors.surface }, splitSidebar: { width: 300, maxWidth: '38%', backgroundColor: colors.surface },
splitMain: { flex: 1, minWidth: 0 }, splitMain: { flex: 1, minWidth: 0 },
modelChip: { minWidth: 0, flexShrink: 1, flexDirection: 'row', alignItems: 'center', gap: 4, paddingLeft: spacing.sm + 2, paddingRight: spacing.sm, height: 38, borderRadius: radius.pill, backgroundColor: colors.surfaceStrong },
permissionChip: { minWidth: 0, flexShrink: 1, flexDirection: 'row', alignItems: 'center', gap: isCompact ? 4 : spacing.xs, paddingHorizontal: isCompact ? 8 : spacing.sm, height: isCompact ? 32 : 36, borderRadius: radius.pill, backgroundColor: colors.primarySoft, borderWidth: StyleSheet.hairlineWidth, borderColor: colors.separator }, permissionChip: { minWidth: 0, flexShrink: 1, flexDirection: 'row', alignItems: 'center', gap: isCompact ? 4 : spacing.xs, paddingHorizontal: isCompact ? 8 : spacing.sm, height: isCompact ? 32 : 36, borderRadius: radius.pill, backgroundColor: colors.primarySoft, borderWidth: StyleSheet.hairlineWidth, borderColor: colors.separator },
permissionChipDisabled: { opacity: 0.52 }, permissionChipDisabled: { opacity: 0.52 },
modelChipText: { ...t.small, fontSize: 14, color: colors.ink, flexShrink: 1 },
olderButton: { alignSelf: 'center', paddingVertical: isCompact ? 4 : spacing.xs, paddingHorizontal: spacing.md, marginBottom: isCompact ? 4 : spacing.sm }, olderButton: { alignSelf: 'center', paddingVertical: isCompact ? 4 : spacing.xs, paddingHorizontal: spacing.md, marginBottom: isCompact ? 4 : spacing.sm },
olderText: { ...t.smallStrong, color: colors.primary }, olderText: { ...t.smallStrong, color: colors.primary },
// Floats over the newest row so jumping back never moves the composer. // Floats over the newest row so jumping back never moves the composer.
@ -24,19 +36,15 @@ export function createStyles(colors: ThemeColors, density: TypographyDensity = '
// 44 dp circle reachable as the 48 dp target the design system asks for. // 44 dp circle reachable as the 48 dp target the design system asks for.
latestTurnColumn: { alignItems: 'flex-end', paddingVertical: 2 }, latestTurnColumn: { alignItems: 'flex-end', paddingVertical: 2 },
latestTurnButton: { latestTurnButton: {
width: 44, width: 40,
height: 44, height: 40,
borderRadius: radius.pill, borderRadius: radius.pill,
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
backgroundColor: colors.surface, backgroundColor: colors.elevated,
borderWidth: StyleSheet.hairlineWidth, borderWidth: StyleSheet.hairlineWidth,
borderColor: colors.separator, borderColor: colors.separator,
shadowColor: '#000', ...floatingShadow(colors, 'low'),
shadowOffset: { width: 0, height: 2 },
shadowOpacity: 0.16,
shadowRadius: 6,
elevation: 4,
}, },
latestTurnButtonPressed: { opacity: 0.7 }, latestTurnButtonPressed: { opacity: 0.7 },
modalBackdrop: { flex: 1, backgroundColor: colors.modalBackdrop, justifyContent: 'flex-end' }, modalBackdrop: { flex: 1, backgroundColor: colors.modalBackdrop, justifyContent: 'flex-end' },
@ -62,20 +70,57 @@ export function createStyles(colors: ThemeColors, density: TypographyDensity = '
permissionOptionName: { ...t.small, color: colors.ink }, permissionOptionName: { ...t.small, color: colors.ink },
permissionOptionDescription: { ...t.caption, color: colors.muted, marginTop: 2 }, permissionOptionDescription: { ...t.caption, color: colors.muted, marginTop: 2 },
modelFailures: { ...t.caption, color: colors.danger, marginTop: spacing.sm }, modelFailures: { ...t.caption, color: colors.danger, marginTop: spacing.sm },
connectionBanner: { minHeight: 40, marginHorizontal: spacing.md, marginTop: spacing.xxs, paddingHorizontal: spacing.md, paddingVertical: spacing.xs, borderRadius: radius.pill, backgroundColor: colors.warningSoft, flexDirection: 'row', alignItems: 'center', gap: spacing.xs }, connectionBanner: {
connectionDot: { width: 8, height: 8, borderRadius: radius.pill, backgroundColor: colors.warning }, alignSelf: 'center',
connectionBannerText: { ...t.small, color: colors.ink, flex: 1 }, maxWidth: '92%',
minHeight: 30,
marginTop: spacing.xxs,
paddingHorizontal: 12,
paddingVertical: 5,
borderRadius: radius.pill,
backgroundColor: colors.warningSoft,
borderWidth: StyleSheet.hairlineWidth,
borderColor: colors.separator,
flexDirection: 'row',
alignItems: 'center',
gap: 6,
...floatingShadow(colors, 'low'),
},
syncBanner: {
alignSelf: 'center',
maxWidth: '92%',
minHeight: 30,
marginTop: spacing.xxs,
paddingHorizontal: 12,
paddingVertical: 5,
borderRadius: radius.pill,
backgroundColor: colors.elevated,
borderWidth: StyleSheet.hairlineWidth,
borderColor: colors.separator,
flexDirection: 'row',
alignItems: 'center',
gap: 6,
...floatingShadow(colors, 'low'),
},
connectionDot: { width: 7, height: 7, borderRadius: radius.pill, backgroundColor: colors.warning },
connectionBannerText: { ...t.caption, fontWeight: '500', color: colors.ink, flexShrink: 1 },
list: { flex: 1 }, list: { flex: 1 },
listContent: { paddingHorizontal: isCompact ? 14 : spacing.lg, paddingTop: isCompact ? spacing.md : spacing.xl, paddingBottom: spacing.xxl, gap: isCompact ? 2 : spacing.xxs }, listContent: { paddingHorizontal: isCompact ? 16 : spacing.lg, paddingTop: isCompact ? spacing.md : spacing.xl, paddingBottom: spacing.md, gap: isCompact ? 2 : spacing.xxs },
shortConversation: { flexGrow: 1, justifyContent: 'flex-end', paddingBottom: spacing.sm }, shortConversation: { flexGrow: 1, justifyContent: 'flex-end', paddingBottom: spacing.sm },
emptyList: { flexGrow: 1, justifyContent: 'center' }, emptyList: { flexGrow: 1, justifyContent: 'center' },
messageRow: { flexDirection: 'row', alignItems: 'flex-start', gap: isCompact ? 6 : spacing.sm, marginVertical: isCompact ? 3 : spacing.xs }, messageRow: { flexDirection: 'row', alignItems: 'flex-start', gap: isCompact ? 6 : spacing.sm, marginVertical: isCompact ? 3 : spacing.xs },
messageRowUser: { flexDirection: 'row-reverse' }, messageRowUser: { flexDirection: 'row-reverse' },
assistantBlock: { alignSelf: 'stretch', gap: isCompact ? 2 : spacing.xxs, marginVertical: isCompact ? 2 : spacing.xs }, assistantBlock: { alignSelf: 'stretch', gap: m.assistantGap, marginTop: Math.max(2, m.assistantGap - 2), marginBottom: m.turnBottomGap },
assistantText: { paddingHorizontal: 0 }, assistantText: { paddingHorizontal: 0 },
userBlock: { alignSelf: 'flex-end', maxWidth: '88%', marginVertical: isCompact ? 4 : spacing.sm }, userBlock: { alignSelf: 'flex-end', maxWidth: '86%', marginTop: m.turnTopGap, marginBottom: m.turnBottomGap },
userContent: { paddingHorizontal: isCompact ? 12 : spacing.md, paddingVertical: isCompact ? 6 : spacing.xs }, userContent: { paddingHorizontal: isCompact ? 14 : 16, paddingVertical: isCompact ? 10 : 12 },
userBubble: { backgroundColor: colors.inverse, borderRadius: radius.lg, maxWidth: '100%' }, userMediaOnly: { paddingHorizontal: 0, paddingVertical: 0 },
userSoftBubble: { backgroundColor: colors.userBubble ?? colors.surfaceStrong, borderRadius: 18, borderTopRightRadius: 6, maxWidth: '100%' },
userTintedBubble: { backgroundColor: colors.primarySoft, borderRadius: 18, borderTopRightRadius: 6, borderWidth: StyleSheet.hairlineWidth, borderColor: colors.border, maxWidth: '100%' },
userSolidBubble: { backgroundColor: colors.primary, borderRadius: 18, borderTopRightRadius: 6, maxWidth: '100%' },
userMinimalBubble: { backgroundColor: 'transparent', borderRadius: 18, borderTopRightRadius: 6, borderWidth: 1, borderColor: colors.border, maxWidth: '100%' },
userBubble: { backgroundColor: colors.inverse, borderRadius: 18, borderTopRightRadius: 6, maxWidth: '100%' },
userMarkdownWrap: { marginBottom: -m.paragraphGap },
userMessageInlineWrap: { userMessageInlineWrap: {
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
@ -84,9 +129,10 @@ export function createStyles(colors: ThemeColors, density: TypographyDensity = '
}, },
userMessageInlineText: { userMessageInlineText: {
...t.body, ...t.body,
fontSize: 15, fontSize: m.bodyFontSize,
lineHeight: m.bodyLineHeight,
letterSpacing: m.letterSpacing,
color: colors.ink, color: colors.ink,
lineHeight: 22,
}, },
avatar: { width: isCompact ? 28 : 32, height: isCompact ? 28 : 32, borderRadius: radius.md, alignItems: 'center', justifyContent: 'center' }, avatar: { width: isCompact ? 28 : 32, height: isCompact ? 28 : 32, borderRadius: radius.md, alignItems: 'center', justifyContent: 'center' },
avatarUser: { backgroundColor: colors.primary }, avatarUser: { backgroundColor: colors.primary },
@ -102,43 +148,62 @@ export function createStyles(colors: ThemeColors, density: TypographyDensity = '
messageImagePlaceholder: { width: 132, minHeight: 76, borderRadius: radius.md, backgroundColor: colors.primarySoft, alignItems: 'center', justifyContent: 'center', padding: spacing.sm, gap: spacing.xs }, messageImagePlaceholder: { width: 132, minHeight: 76, borderRadius: radius.md, backgroundColor: colors.primarySoft, alignItems: 'center', justifyContent: 'center', padding: spacing.sm, gap: spacing.xs },
messageImageName: { ...t.caption, color: colors.primary, maxWidth: '100%' }, messageImageName: { ...t.caption, color: colors.primary, maxWidth: '100%' },
reasoningCard: { alignSelf: 'stretch', borderRadius: radius.md, overflow: 'hidden' }, reasoningCard: { alignSelf: 'stretch', borderRadius: radius.md, overflow: 'hidden' },
reasoningHeader: { minHeight: 48, paddingHorizontal: spacing.xs, flexDirection: 'row', alignItems: 'center', gap: spacing.xs }, reasoningHeader: { minHeight: isCompact ? 34 : 40, paddingHorizontal: 0, flexDirection: 'row', alignItems: 'center', gap: spacing.xs, borderRadius: radius.sm },
reasoningHeaderPressed: { backgroundColor: colors.surfaceStrong }, reasoningHeaderPressed: { backgroundColor: colors.surfaceStrong },
reasoningLabel: { ...t.smallStrong, color: colors.muted }, reasoningLabel: { ...t.smallStrong, color: colors.muted },
reasoningLabelActive: { color: colors.accent }, reasoningLabelActive: { color: colors.accent },
reasoningPreview: { ...t.small, color: colors.muted, flex: 1 }, reasoningPreview: { ...t.small, color: colors.muted, flex: 1 },
activitySeparator: { ...t.small, color: colors.subtle }, activitySeparator: { ...t.small, color: colors.subtle },
reasoningBody: { backgroundColor: colors.surface, padding: isCompact ? 8 : spacing.sm, marginHorizontal: isCompact ? 4 : spacing.xs, marginBottom: isCompact ? 4 : spacing.xs, borderRadius: radius.sm }, reasoningBody: {
processGroup: { alignSelf: 'stretch', marginHorizontal: spacing.xs }, backgroundColor: colors.toolSurface ?? colors.surface,
padding: isCompact ? 10 : 12,
marginTop: 2,
marginBottom: 4,
marginLeft: 9,
paddingLeft: 12,
borderLeftWidth: 2,
borderLeftColor: colors.separator,
borderTopRightRadius: radius.md,
borderBottomRightRadius: radius.md,
},
processGroup: { alignSelf: 'stretch', marginHorizontal: 0, gap: isCompact ? 4 : 6 },
activityGroup: { alignSelf: 'stretch' }, activityGroup: { alignSelf: 'stretch' },
processHeader: { minHeight: 48, flexDirection: 'row', alignItems: 'center', gap: spacing.xs, paddingHorizontal: 0, borderRadius: radius.md }, processHeader: { minHeight: isCompact ? 34 : 40, flexDirection: 'row', alignItems: 'center', gap: spacing.xs, paddingHorizontal: 0, borderRadius: radius.sm },
processIcon: { width: 28, height: 28, alignItems: 'center', justifyContent: 'center' }, processIcon: { width: 20, height: 20, alignItems: 'center', justifyContent: 'center' },
processCurrent: { flexDirection: 'row', alignItems: 'center', gap: spacing.xs, paddingHorizontal: spacing.xs, paddingBottom: spacing.xs }, processCurrent: { flexDirection: 'row', alignItems: 'center', gap: spacing.xs, paddingLeft: 28, paddingRight: 0, paddingBottom: 4 },
processCurrentText: { ...t.small, color: colors.muted, flex: 1 }, processCurrentText: { ...t.small, color: colors.muted, flex: 1 },
processLabel: { ...t.small, color: colors.muted, flex: 1 }, processLabel: { ...t.small, fontWeight: '500', color: colors.muted, flex: 1 },
turnProcessHeader: { minHeight: 48, flexDirection: 'row', alignItems: 'center', gap: spacing.xs }, turnProcessHeader: { minHeight: isCompact ? 30 : 36, flexDirection: 'row', alignItems: 'center', gap: spacing.xs },
turnProcessLabel: { ...t.small, color: colors.muted }, turnProcessLabel: { ...t.caption, color: colors.subtle },
activityReasoning: { paddingVertical: isCompact ? 4 : spacing.xs }, activityReasoning: { paddingVertical: isCompact ? 4 : spacing.xs },
processBody: { gap: 0, paddingVertical: 2 }, processScroll: {
marginLeft: 9,
paddingLeft: 12,
borderLeftWidth: 2,
borderLeftColor: colors.separator,
marginVertical: 2,
},
processScrollActive: { borderLeftColor: colors.primary },
processBody: { gap: 2, paddingVertical: 2 },
streamingCursor: { width: 7, height: isCompact ? 14 : 16, backgroundColor: colors.accent, borderRadius: 2, marginTop: 3 }, streamingCursor: { width: 7, height: isCompact ? 14 : 16, backgroundColor: colors.accent, borderRadius: 2, marginTop: 3 },
toolCard: { borderRadius: radius.md, overflow: 'hidden' }, toolCard: { borderRadius: radius.md, overflow: 'hidden' },
toolCardExpanded: { backgroundColor: colors.card }, toolCardExpanded: { backgroundColor: colors.toolSurface ?? colors.card, marginVertical: 2 },
toolRow: { minHeight: isCompact ? 36 : 48, paddingHorizontal: spacing.xs, paddingVertical: isCompact ? 0 : spacing.xxs, flexDirection: 'row', alignItems: 'center', gap: spacing.xs }, toolRow: { minHeight: isCompact ? 32 : 38, paddingHorizontal: 6, paddingVertical: 4, flexDirection: 'row', alignItems: 'center', gap: spacing.xs },
toolRowPressed: { backgroundColor: colors.surfaceStrong }, toolRowPressed: { backgroundColor: colors.surfaceStrong },
toolIcon: { width: isCompact ? 20 : 24, height: isCompact ? 20 : 24, alignItems: 'center', justifyContent: 'center' }, toolIcon: { width: 20, height: 20, alignItems: 'center', justifyContent: 'center' },
toolCopy: { flex: 1, minWidth: 0, flexDirection: 'row', alignItems: 'center', gap: 6 }, toolCopy: { flex: 1, minWidth: 0, flexDirection: 'row', alignItems: 'center', gap: 6 },
toolName: { ...(isCompact ? t.caption : t.small), color: colors.muted, flexShrink: 1 }, toolName: { ...(isCompact ? t.caption : t.small), fontWeight: '500', color: colors.ink, flexShrink: 1 },
toolSummary: { ...(isCompact ? t.caption : t.small), color: colors.muted, flex: 1 }, toolSummary: { ...(isCompact ? t.caption : t.small), color: colors.muted, flex: 1 },
toolStateGroup: { flexDirection: 'row', alignItems: 'center', gap: spacing.xs }, toolStateGroup: { flexDirection: 'row', alignItems: 'center', gap: spacing.xs },
toolState: { ...t.caption, color: colors.success }, toolState: { ...t.caption, color: colors.success },
toolFailed: { color: colors.danger }, toolFailed: { ...t.caption, fontWeight: '500', color: colors.danger },
toolDetails: { borderTopWidth: StyleSheet.hairlineWidth, borderTopColor: colors.separator, padding: isCompact ? 8 : spacing.sm, gap: isCompact ? 8 : spacing.md }, toolDetails: { borderTopWidth: StyleSheet.hairlineWidth, borderTopColor: colors.separator, padding: isCompact ? 8 : 10, gap: isCompact ? 8 : 10 },
toolDetailBlock: { gap: isCompact ? 4 : spacing.xs }, toolDetailBlock: { gap: isCompact ? 4 : spacing.xs },
toolDetailLabel: { ...t.caption, color: colors.muted }, toolDetailLabel: { ...t.caption, color: colors.muted },
toolDetailCode: { fontFamily: 'monospace', fontSize: isCompact ? 12 : 13, lineHeight: isCompact ? 17 : 20, color: colors.ink, backgroundColor: colors.surfaceStrong, borderRadius: radius.sm, padding: isCompact ? 6 : spacing.sm }, toolDetailCode: { fontFamily: 'monospace', fontSize: m.codeFontSize, lineHeight: m.codeLineHeight, color: colors.ink, backgroundColor: colors.codeSurface ?? colors.surfaceStrong, borderRadius: radius.sm, padding: isCompact ? 9 : 11 },
toolDetailTruncated: { ...t.caption, color: colors.warning }, toolDetailTruncated: { ...t.caption, color: colors.warning },
permissionCard: { borderRadius: radius.lg, backgroundColor: colors.warningSoft, padding: spacing.md, gap: spacing.md, marginVertical: spacing.xs }, permissionCard: { borderRadius: radius.xl, backgroundColor: colors.warningSoft, padding: 14, gap: 12, marginVertical: 6 },
questionCard: { borderRadius: radius.lg, backgroundColor: colors.accentSoft, padding: spacing.md, gap: spacing.md, marginVertical: spacing.xs }, questionCard: { borderRadius: radius.xl, backgroundColor: colors.accentSoft, padding: 14, gap: 12, marginVertical: 6 },
permissionHeader: { flexDirection: 'row', alignItems: 'center', gap: spacing.sm }, permissionHeader: { flexDirection: 'row', alignItems: 'center', gap: spacing.sm },
permissionIcon: { width: 40, height: 40, borderRadius: radius.md, backgroundColor: colors.background, alignItems: 'center', justifyContent: 'center' }, permissionIcon: { width: 40, height: 40, borderRadius: radius.md, backgroundColor: colors.background, alignItems: 'center', justifyContent: 'center' },
permissionHeaderCopy: { flex: 1 }, permissionHeaderCopy: { flex: 1 },
@ -173,7 +238,7 @@ export function createStyles(colors: ThemeColors, density: TypographyDensity = '
subagentRunningFailed: { ...t.smallStrong, color: colors.danger }, subagentRunningFailed: { ...t.smallStrong, color: colors.danger },
subagentProvisioning: { ...t.smallStrong, color: colors.warning }, subagentProvisioning: { ...t.smallStrong, color: colors.warning },
subagentIdle: { ...t.small, color: colors.muted }, subagentIdle: { ...t.small, color: colors.muted },
stopButtonSmall: { width: 38, height: 38, borderRadius: 19, backgroundColor: colors.inverse, alignItems: 'center', justifyContent: 'center', marginRight: spacing.xs }, stopButtonSmall: { width: 36, height: 36, borderRadius: 18, backgroundColor: colors.inverse, alignItems: 'center', justifyContent: 'center' },
resendRowDisabled: { opacity: 0.5 }, resendRowDisabled: { opacity: 0.5 },
resendTextMuted: { color: colors.muted }, resendTextMuted: { color: colors.muted },
resendTextFailed: { color: colors.danger }, resendTextFailed: { color: colors.danger },
@ -190,15 +255,24 @@ export function createStyles(colors: ThemeColors, density: TypographyDensity = '
welcomeSlogan: { ...t.title, fontSize: 24, lineHeight: 30, fontWeight: '600', letterSpacing: -0.4, color: colors.ink }, welcomeSlogan: { ...t.title, fontSize: 24, lineHeight: 30, fontWeight: '600', letterSpacing: -0.4, color: colors.ink },
welcomeBadge: { borderRadius: radius.pill, backgroundColor: colors.primarySoft, paddingHorizontal: spacing.sm, paddingVertical: 3, marginTop: 2 }, welcomeBadge: { borderRadius: radius.pill, backgroundColor: colors.primarySoft, paddingHorizontal: spacing.sm, paddingVertical: 3, marginTop: 2 },
welcomeBadgeText: { ...t.caption, fontWeight: '600', color: colors.primary }, welcomeBadgeText: { ...t.caption, fontWeight: '600', color: colors.primary },
welcomePolicyHint: {
...t.caption,
fontSize: 11,
lineHeight: 15,
color: colors.subtle,
textAlign: 'center',
marginTop: spacing.sm,
paddingHorizontal: spacing.lg,
},
mentionBackdrop: { ...StyleSheet.absoluteFill, backgroundColor: colors.menuDismiss }, mentionBackdrop: { ...StyleSheet.absoluteFill, backgroundColor: colors.menuDismiss },
composerWrap: { backgroundColor: colors.background, paddingHorizontal: spacing.md, paddingTop: spacing.xs, paddingBottom: spacing.xs }, composerWrap: { backgroundColor: 'transparent', paddingHorizontal: spacing.md, paddingTop: 4, paddingBottom: 6 },
composerInner: { width: '100%' }, composerInner: { width: '100%' },
runningFooterWrap: { paddingHorizontal: spacing.lg, paddingTop: spacing.xs, paddingBottom: spacing.md }, runningFooterWrap: { paddingHorizontal: spacing.lg, paddingTop: spacing.xs, paddingBottom: spacing.md },
replyStatus: { minHeight: 32, flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start', gap: spacing.xs, paddingVertical: spacing.sm, borderTopWidth: StyleSheet.hairlineWidth, borderTopColor: colors.separator }, replyStatus: { minHeight: 24, flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start', gap: 6, paddingHorizontal: 2, paddingTop: spacing.xs, paddingBottom: spacing.xs },
replyStatusText: { ...t.small, color: colors.accent }, replyStatusText: { ...t.caption, fontWeight: '500', color: colors.accent },
replyDots: { flexDirection: 'row', alignItems: 'center', marginLeft: -spacing.xs }, replyDots: { flexDirection: 'row', alignItems: 'center', marginLeft: -4 },
replyDot: { ...t.caption, fontSize: 18, lineHeight: 18, fontWeight: '700' }, replyDot: { ...t.caption, fontSize: 16, lineHeight: 16, fontWeight: '700' },
imageTray: { gap: spacing.xs, paddingBottom: spacing.xs }, imageTray: { gap: spacing.xs, paddingBottom: spacing.xs },
imagePreviewWrap: { width: 72, height: 72 }, imagePreviewWrap: { width: 72, height: 72 },
imagePreview: { width: 72, height: 72, borderRadius: radius.sm, backgroundColor: colors.surfaceStrong }, imagePreview: { width: 72, height: 72, borderRadius: radius.sm, backgroundColor: colors.surfaceStrong },
@ -229,26 +303,34 @@ export function createStyles(colors: ThemeColors, density: TypographyDensity = '
marginLeft: 2, marginLeft: 2,
}, },
composerCard: { composerCard: {
position: 'relative',
borderWidth: StyleSheet.hairlineWidth, borderWidth: StyleSheet.hairlineWidth,
borderColor: colors.separator, borderColor: colors.separator,
borderRadius: radius.xxl, borderRadius: 26,
backgroundColor: colors.surface, minHeight: 52,
paddingHorizontal: spacing.xs, backgroundColor: colors.elevated,
paddingTop: spacing.xs, paddingHorizontal: 10,
paddingBottom: spacing.xs, paddingTop: 8,
gap: spacing.xs, paddingBottom: 8,
...floatingShadow(colors, 'high'), ...floatingShadow(colors, 'low'),
}, },
composerExpandButton: { composerCardWithQuotes: {
borderRadius: 22,
paddingTop: 10,
},
composerBody: {
position: 'relative',
},
composerExpandCorner: {
position: 'absolute', position: 'absolute',
top: 6, top: 0,
right: 6, right: 0,
width: 32, width: 28,
height: 32, height: 28,
borderRadius: radius.pill, borderRadius: radius.pill,
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
zIndex: 5, zIndex: 4,
}, },
expandedComposerOverlay: { expandedComposerOverlay: {
...StyleSheet.absoluteFill, ...StyleSheet.absoluteFill,
@ -256,12 +338,13 @@ export function createStyles(colors: ThemeColors, density: TypographyDensity = '
elevation: 50, elevation: 50,
}, },
expandedComposerBackdrop: { expandedComposerBackdrop: {
height: 52, ...StyleSheet.absoluteFill,
backgroundColor: colors.menuDismiss, backgroundColor: colors.menuDismiss,
}, },
expandedComposerCard: { expandedComposerCard: {
flex: 1, flex: 1,
backgroundColor: colors.surface, marginTop: 88,
backgroundColor: colors.elevated,
borderTopLeftRadius: 28, borderTopLeftRadius: 28,
borderTopRightRadius: 28, borderTopRightRadius: 28,
paddingHorizontal: spacing.md, paddingHorizontal: spacing.md,
@ -312,33 +395,45 @@ export function createStyles(colors: ThemeColors, density: TypographyDensity = '
paddingVertical: spacing.xs, paddingVertical: spacing.xs,
minHeight: 48, minHeight: 48,
}, },
runningComposer: { flexDirection: 'row', alignItems: 'center', gap: spacing.xs, padding: spacing.xs }, runningComposer: { flexDirection: 'row', alignItems: 'center', gap: 6, paddingVertical: 6, paddingHorizontal: 6 },
runningComposerPrompt: { flex: 1, minHeight: 44, justifyContent: 'center', minWidth: 0 }, runningComposerPrompt: { flex: 1, minHeight: 36, justifyContent: 'center', minWidth: 0, paddingHorizontal: 4 },
runningComposerText: { ...t.small, color: colors.muted }, runningComposerText: { ...t.small, color: colors.muted },
composerControls: { flexDirection: 'row', alignItems: 'center', gap: spacing.xs, paddingHorizontal: 4, paddingBottom: 2 }, composerActionsOverlay: {
composerSpacer: { flex: 1 }, position: 'absolute',
// Keep the actual target at the Android 48dp minimum. hitSlop is not left: 0,
// reliable when a control sits inside a clipped/native text-input surface. right: 0,
bottom: 0,
height: 36,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
},
composerActionsRow: {
marginTop: 6,
height: 36,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
},
composerTrailing: { flexDirection: 'row', alignItems: 'center', gap: 4 },
plusButton: { plusButton: {
width: 38, width: 36,
height: 38, height: 36,
borderRadius: radius.pill, borderRadius: 18,
backgroundColor: colors.surfaceStrong, backgroundColor: 'transparent',
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
}, },
quickPromptsButton: { composerShortcutButton: {
height: 38, width: 36,
flexShrink: 0, height: 36,
paddingHorizontal: spacing.sm + 2, borderRadius: 18,
borderRadius: radius.pill, backgroundColor: 'transparent',
backgroundColor: colors.surfaceStrong,
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
}, },
quickPromptsText: { ...t.small, fontSize: 14, color: colors.ink }, plusPressed: { opacity: 0.65, transform: [{ scale: 0.94 }] },
plusPressed: { opacity: 0.7 }, plusDisabled: { opacity: 0.45 },
plusDisabled: { opacity: 0.52 },
plusMenuOption: { flexDirection: 'row', alignItems: 'center', gap: spacing.sm, padding: spacing.md, borderRadius: radius.lg, backgroundColor: colors.card, borderWidth: StyleSheet.hairlineWidth, borderColor: colors.separator, marginBottom: spacing.xs }, plusMenuOption: { flexDirection: 'row', alignItems: 'center', gap: spacing.sm, padding: spacing.md, borderRadius: radius.lg, backgroundColor: colors.card, borderWidth: StyleSheet.hairlineWidth, borderColor: colors.separator, marginBottom: spacing.xs },
plusMenuOptionPressed: { backgroundColor: colors.surfaceStrong }, plusMenuOptionPressed: { backgroundColor: colors.surfaceStrong },
plusMenuOptionDisabled: { opacity: 0.5 }, plusMenuOptionDisabled: { opacity: 0.5 },
@ -352,13 +447,43 @@ export function createStyles(colors: ThemeColors, density: TypographyDensity = '
effortRow: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', gap: spacing.sm, paddingHorizontal: spacing.md, paddingVertical: spacing.sm, minHeight: 52, borderRadius: radius.lg, backgroundColor: colors.card, borderWidth: StyleSheet.hairlineWidth, borderColor: colors.separator, marginTop: spacing.xs }, effortRow: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', gap: spacing.sm, paddingHorizontal: spacing.md, paddingVertical: spacing.sm, minHeight: 52, borderRadius: radius.lg, backgroundColor: colors.card, borderWidth: StyleSheet.hairlineWidth, borderColor: colors.separator, marginTop: spacing.xs },
effortRowLabel: { ...t.smallStrong, color: colors.ink }, effortRowLabel: { ...t.smallStrong, color: colors.ink },
effortRowValue: { ...t.small, color: colors.muted, flexShrink: 1 }, effortRowValue: { ...t.small, color: colors.muted, flexShrink: 1 },
composerInputWrap: { composerQuotesWrap: {
position: 'relative', flexDirection: 'row',
flexWrap: 'wrap',
gap: 6,
paddingHorizontal: 4,
paddingTop: 2,
marginBottom: 6,
},
composerQuotePill: {
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
flexWrap: 'wrap', gap: 5,
minHeight: 44, paddingHorizontal: 10,
paddingHorizontal: spacing.sm, paddingVertical: 5,
borderRadius: radius.pill,
backgroundColor: colors.primarySoft,
maxWidth: '100%',
},
composerQuotePillText: {
fontSize: 13,
lineHeight: 17,
fontWeight: '500',
color: colors.primary,
flexShrink: 1,
},
composerInputSlotInline: {
minHeight: 36,
justifyContent: 'center',
paddingHorizontal: 4,
},
composerInputSlotStacked: {
minHeight: 36,
justifyContent: 'center',
paddingHorizontal: 6,
},
composerInputSlotExpandPad: {
paddingRight: 34,
}, },
composerInlineQuoteBadge: { composerInlineQuoteBadge: {
flexDirection: 'row', flexDirection: 'row',
@ -377,236 +502,58 @@ export function createStyles(colors: ThemeColors, density: TypographyDensity = '
assistantProseWrap: { assistantProseWrap: {
position: 'relative', position: 'relative',
}, },
floatingCalloutAnchor: {
position: 'absolute', composerInput: {
top: -46,
left: 0,
right: 0,
zIndex: 999,
alignItems: 'center',
},
assistantSelectableText: {
...t.body, ...t.body,
fontSize: 15, fontSize: 16,
lineHeight: 23, lineHeight: 22,
padding: 0,
margin: 0,
},
calloutBackdrop: {
flex: 1,
backgroundColor: 'rgba(0, 0, 0, 0.25)',
justifyContent: 'center',
alignItems: 'center',
padding: spacing.md,
},
calloutMenu: {
flexDirection: 'row',
alignItems: 'center',
backgroundColor: colors.surface,
borderRadius: radius.md,
borderWidth: StyleSheet.hairlineWidth,
borderColor: colors.border,
shadowColor: '#000',
shadowOffset: { width: 0, height: 2 },
shadowOpacity: 0.18,
shadowRadius: 8,
elevation: 8,
paddingHorizontal: spacing.xs,
height: 42,
maxWidth: 320,
},
calloutBtn: {
paddingHorizontal: spacing.sm,
paddingVertical: 6,
borderRadius: radius.sm,
},
calloutBtnPressed: {
backgroundColor: colors.surfaceStrong,
},
calloutBtnText: {
...t.small,
color: colors.ink, color: colors.ink,
fontWeight: '600', minHeight: 36,
maxHeight: 136,
paddingTop: 7,
paddingBottom: 7,
paddingHorizontal: 0,
includeFontPadding: false,
textAlignVertical: 'center',
}, },
calloutDivider: { composerInputStacked: {
width: StyleSheet.hairlineWidth, textAlignVertical: 'top',
height: 16,
backgroundColor: colors.separator,
}, },
composerInputEmpty: {
snippetModalBackdrop: { height: 36,
flex: 1, paddingTop: 0,
backgroundColor: 'rgba(0, 0, 0, 0.4)', paddingBottom: 0,
justifyContent: 'center',
alignItems: 'center',
padding: spacing.md,
}, },
snippetModalCard: {
width: '100%',
maxWidth: 380,
backgroundColor: colors.surface,
borderRadius: radius.lg,
borderWidth: StyleSheet.hairlineWidth,
borderColor: colors.border,
padding: spacing.md,
shadowColor: '#000',
shadowOffset: { width: 0, height: 4 },
shadowOpacity: 0.15,
shadowRadius: 16,
elevation: 10,
},
snippetModalHeader: {
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
marginBottom: spacing.sm,
},
snippetHeaderLeft: {
flexDirection: 'row',
alignItems: 'center',
gap: 6,
},
snippetModalTitle: {
...t.bodyStrong,
color: colors.ink,
fontSize: 14,
},
snippetCloseBtn: {
padding: 4,
},
snippetPreviewBox: {
backgroundColor: colors.surfaceStrong,
borderRadius: radius.md,
padding: spacing.sm,
marginBottom: spacing.sm,
},
snippetPreviewQuote: {
...t.small,
color: colors.primary,
fontWeight: '500',
lineHeight: 18,
},
snippetCharCount: {
fontSize: 11,
lineHeight: 14,
color: colors.muted,
marginTop: 4,
textAlign: 'right',
},
snippetChipRow: {
marginBottom: spacing.sm,
},
snippetChipScroll: {
gap: 6,
},
snippetChip: {
paddingHorizontal: spacing.sm,
paddingVertical: 5,
borderRadius: radius.pill,
backgroundColor: colors.surfaceStrong,
borderWidth: StyleSheet.hairlineWidth,
borderColor: colors.border,
},
snippetChipActive: {
backgroundColor: colors.primarySoft,
borderColor: colors.primary,
},
snippetChipText: {
fontSize: 11,
lineHeight: 14,
color: colors.muted,
fontWeight: '500',
},
snippetChipTextActive: {
color: colors.primary,
fontWeight: '600',
},
snippetEditorWrap: {
maxHeight: 140,
backgroundColor: colors.surfaceStrong,
borderRadius: radius.md,
padding: spacing.sm,
marginBottom: spacing.md,
},
snippetTextInput: {
...t.small,
color: colors.ink,
lineHeight: 20,
minHeight: 70,
},
snippetActionRow: {
flexDirection: 'row',
alignItems: 'center',
gap: spacing.sm,
},
snippetCopyBtn: {
flex: 1,
height: 40,
borderRadius: radius.md,
borderWidth: StyleSheet.hairlineWidth,
borderColor: colors.border,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',
gap: 6,
backgroundColor: colors.surface,
},
snippetCopyBtnActive: {
borderColor: colors.primary,
backgroundColor: colors.primarySoft,
},
snippetCopyText: {
...t.small,
color: colors.ink,
fontWeight: '500',
},
snippetAskBtn: {
flex: 1.4,
height: 40,
borderRadius: radius.md,
backgroundColor: colors.primary,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',
gap: 6,
},
snippetAskBtnDisabled: {
opacity: 0.5,
},
snippetAskText: {
...t.small,
color: colors.white,
fontWeight: '600',
},
composerInput: { ...t.body, flex: 1, minWidth: 80, fontSize: 16, color: colors.ink, minHeight: 44, maxHeight: 126, paddingVertical: 10, paddingHorizontal: 0, textAlignVertical: 'top' },
sendButton: { sendButton: {
width: 40, width: 36,
height: 40, height: 36,
borderRadius: radius.pill, borderRadius: 18,
backgroundColor: colors.primary,
alignItems: 'center',
justifyContent: 'center',
},
sendPressed: { backgroundColor: colors.primaryPressed },
stopButton: {
width: 40,
height: 40,
borderRadius: radius.pill,
backgroundColor: colors.inverse, backgroundColor: colors.inverse,
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
}, },
stopPressed: { opacity: 0.78 }, sendPressed: { opacity: 0.78, transform: [{ scale: 0.95 }] },
stopButton: {
width: 36,
height: 36,
borderRadius: 18,
backgroundColor: colors.inverse,
alignItems: 'center',
justifyContent: 'center',
},
stopPressed: { opacity: 0.78, transform: [{ scale: 0.95 }] },
sendDisabled: { backgroundColor: colors.surfaceStrong }, sendDisabled: { backgroundColor: colors.surfaceStrong },
composerHint: { composerHint: {
...t.caption, ...t.caption,
fontSize: 11, fontSize: 11,
lineHeight: 15, lineHeight: 15,
color: colors.muted, color: colors.subtle,
textAlign: 'center', textAlign: 'center',
marginTop: 5, marginTop: 4,
},
composerHintWarning: {
color: colors.muted,
}, },
promptInputLabel: { ...t.caption, color: colors.muted, marginBottom: 4, marginTop: 4 }, promptInputLabel: { ...t.caption, color: colors.muted, marginBottom: 4, marginTop: 4 },
promptInput: { borderRadius: radius.md, borderWidth: 1, borderColor: colors.border, backgroundColor: colors.surface, color: colors.ink, paddingHorizontal: spacing.sm, paddingVertical: 8, ...t.body, minHeight: 40 }, promptInput: { borderRadius: radius.md, borderWidth: 1, borderColor: colors.border, backgroundColor: colors.surface, color: colors.ink, paddingHorizontal: spacing.sm, paddingVertical: 8, ...t.body, minHeight: 40 },