diff --git a/mobile/app/h/[hostId]/session/[worktreeId].tsx b/mobile/app/h/[hostId]/session/[worktreeId].tsx index 057dcd6bf01..916247e98f1 100644 --- a/mobile/app/h/[hostId]/session/[worktreeId].tsx +++ b/mobile/app/h/[hostId]/session/[worktreeId].tsx @@ -6,7 +6,6 @@ import { FlatList, View, Text, - StyleSheet, ScrollView, TextInput, Pressable, @@ -141,7 +140,8 @@ import { dismissMobileSessionCreateWarningState, reconcileMobileSessionCreateWarningState } from '../../../../src/session/mobile-session-create-warning-state' -import { colors, spacing, radii, typography } from '../../../../src/theme/mobile-theme' +import { colors, spacing } from '../../../../src/theme/mobile-theme' +import { styles } from './mobile-session-styles' import type { DiffComment } from '../../../../../src/shared/types' import type { AgentStatusEntry } from '../../../../../src/shared/agent-status-types' @@ -3209,7 +3209,8 @@ export default function SessionScreen() { if (!repoResponse.ok) { throw new Error((repoResponse as RpcFailure).error.message) } - const repos = ((repoResponse as RpcSuccess).result as { repos?: RuntimeRepoSummary[] }).repos ?? [] + const repos = + ((repoResponse as RpcSuccess).result as { repos?: RuntimeRepoSummary[] }).repos ?? [] return repos.find((repo) => repo.id === repoId)?.connectionId?.trim() || null }, [client, worktreeId]) @@ -3290,7 +3291,15 @@ export default function SessionScreen() { showToast('Paste failed', 1500) } } - }, [client, activeHandle, canSend, connState, getActiveWorktreeConnectionId, refreshCanPaste, showToast]) + }, [ + client, + activeHandle, + canSend, + connState, + getActiveWorktreeConnectionId, + refreshCanPaste, + showToast + ]) // Why: refresh canPaste on mount, AppState active, after paste. useEffect(() => { @@ -4822,632 +4831,3 @@ export default function SessionScreen() { ) } - -const styles = StyleSheet.create({ - container: { - flex: 1, - backgroundColor: colors.bgBase - }, - kavInner: { - flex: 1 - }, - sessionChrome: { - backgroundColor: colors.bgPanel, - borderBottomWidth: 1, - borderBottomColor: colors.borderSubtle - }, - sessionTopBar: { - minHeight: 44, - flexDirection: 'row', - alignItems: 'center', - paddingHorizontal: spacing.sm, - paddingVertical: spacing.xs - }, - backButton: { - width: 36, - height: 36, - borderRadius: 18, - alignItems: 'center', - justifyContent: 'center', - marginRight: spacing.xs - }, - backButtonPressed: { - backgroundColor: colors.bgRaised - }, - filesButton: { - width: 36, - height: 36, - borderRadius: radii.button, - alignItems: 'center', - justifyContent: 'center', - marginLeft: spacing.xs - }, - filesButtonPressed: { - backgroundColor: colors.bgRaised - }, - sessionTitleBlock: { - flex: 1, - minWidth: 0 - }, - sessionTitle: { - color: colors.textPrimary, - fontSize: 14, - fontWeight: '600' - }, - sessionMetaRow: { - flexDirection: 'row', - alignItems: 'center', - marginTop: 2 - }, - sessionMetaText: { - flexShrink: 1, - color: colors.textSecondary, - fontSize: typography.metaSize - }, - tabBar: { - flexDirection: 'row', - alignItems: 'center', - borderTopWidth: 1, - borderTopColor: colors.borderSubtle - }, - tabScroll: { - flex: 1, - maxHeight: 36 - }, - tabContent: { - paddingLeft: spacing.sm, - paddingRight: spacing.sm - }, - tab: { - width: 128, - maxWidth: 128, - minHeight: 36, - alignItems: 'center', - justifyContent: 'center', - paddingHorizontal: spacing.sm, - paddingVertical: spacing.sm, - borderBottomWidth: 2, - borderBottomColor: 'transparent' - }, - tabActive: { - borderBottomColor: colors.accentBlue - }, - tabLabelRow: { - maxWidth: '100%', - flexDirection: 'row', - alignItems: 'center', - gap: spacing.xs - }, - tabText: { - flexShrink: 1, - color: colors.textSecondary, - fontSize: 13 - }, - tabTextActive: { - color: colors.textPrimary - }, - newTerminalButton: { - width: 40, - height: 36, - alignItems: 'center', - justifyContent: 'center', - borderBottomWidth: 2, - borderBottomColor: 'transparent' - }, - newTerminalButtonPressed: { - backgroundColor: colors.bgRaised - }, - newTerminalButtonDisabled: { - opacity: 0.45 - }, - terminalFrame: { - flex: 1, - minHeight: 0, - position: 'relative', - overflow: 'hidden' - }, - terminalPane: { - ...StyleSheet.absoluteFillObject - }, - terminalPaneHidden: { - opacity: 0 - }, - terminalWebView: { - flex: 1 - }, - markdownFrame: { - flex: 1, - minHeight: 0, - backgroundColor: colors.bgBase - }, - browserFrame: { - flex: 1, - minHeight: 0, - backgroundColor: colors.bgBase - }, - markdownEditor: { - flex: 1, - position: 'relative' - }, - markdownState: { - flex: 1, - alignItems: 'center', - justifyContent: 'center', - padding: spacing.xl, - gap: spacing.md - }, - markdownError: { - color: colors.statusRed, - fontSize: typography.bodySize - }, - markdownTextInput: { - flex: 1, - minHeight: 0, - color: colors.textPrimary, - backgroundColor: colors.bgBase, - paddingHorizontal: spacing.lg, - paddingTop: spacing.lg, - paddingBottom: spacing.xl * 3, - fontSize: typography.bodySize, - lineHeight: 22, - fontFamily: Platform.select({ ios: 'Menlo', android: 'monospace', default: 'monospace' }) - }, - filePreviewScroll: { - flex: 1, - minHeight: 0, - backgroundColor: colors.editorSurface - }, - filePreviewContent: { - paddingHorizontal: spacing.lg, - paddingTop: spacing.lg, - paddingBottom: spacing.xl - }, - filePreviewText: { - color: colors.textPrimary, - fontSize: typography.bodySize, - lineHeight: 22, - fontFamily: Platform.select({ ios: 'Menlo', android: 'monospace', default: 'monospace' }) - }, - diffNotesToolbar: { - flexDirection: 'row', - alignItems: 'center', - justifyContent: 'space-between', - gap: spacing.sm, - paddingHorizontal: spacing.lg, - paddingVertical: spacing.sm, - borderBottomWidth: StyleSheet.hairlineWidth, - borderBottomColor: colors.borderSubtle, - backgroundColor: colors.bgPanel - }, - diffNotesTitleRow: { - minWidth: 0, - flex: 1, - flexDirection: 'row', - alignItems: 'center', - gap: spacing.xs - }, - diffNotesTitle: { - color: colors.textSecondary, - fontSize: typography.metaSize, - fontWeight: '600' - }, - diffNotesActions: { - flexDirection: 'row', - alignItems: 'center', - gap: spacing.xs - }, - diffNotesActionButton: { - minHeight: 30, - flexDirection: 'row', - alignItems: 'center', - gap: spacing.xs, - borderWidth: 1, - borderColor: colors.borderSubtle, - borderRadius: radii.button, - paddingHorizontal: spacing.sm, - backgroundColor: colors.bgRaised - }, - diffNotesActionText: { - color: colors.textSecondary, - fontSize: typography.metaSize, - fontWeight: '600' - }, - diffLineBlock: { - marginBottom: spacing.xs - }, - diffLine: { - flexDirection: 'row', - alignItems: 'flex-start', - borderLeftWidth: 2, - borderLeftColor: colors.editorSurface, - paddingRight: spacing.sm - }, - diffLineAdded: { - backgroundColor: colors.diffAddedBg, - borderLeftColor: colors.gitDecorationAdded - }, - diffLineDeleted: { - backgroundColor: colors.diffDeletedBg, - borderLeftColor: colors.gitDecorationDeleted - }, - diffGutter: { - width: 42, - paddingRight: spacing.sm, - textAlign: 'right', - color: colors.textMuted, - fontSize: typography.metaSize, - lineHeight: 22, - fontFamily: Platform.select({ ios: 'Menlo', android: 'monospace', default: 'monospace' }) - }, - diffText: { - flex: 1, - color: colors.textPrimary, - fontSize: typography.bodySize, - lineHeight: 22, - fontFamily: Platform.select({ ios: 'Menlo', android: 'monospace', default: 'monospace' }) - }, - diffPrefix: { - color: colors.textMuted - }, - diffPrefixAdded: { - color: colors.gitDecorationAdded - }, - diffPrefixDeleted: { - color: colors.gitDecorationDeleted - }, - diffCommentAddButton: { - width: 26, - height: 22, - alignItems: 'center', - justifyContent: 'center', - borderRadius: radii.button - }, - diffCommentAddButtonPressed: { - backgroundColor: colors.bgPanel - }, - diffCommentButtonDisabled: { - opacity: 0.45 - }, - diffCommentList: { - gap: spacing.xs, - marginLeft: 44, - marginRight: spacing.sm, - marginTop: spacing.xs - }, - diffCommentCard: { - borderWidth: 1, - borderColor: colors.borderSubtle, - borderRadius: radii.button, - backgroundColor: colors.bgPanel, - paddingHorizontal: spacing.sm, - paddingVertical: spacing.xs - }, - diffCommentHeader: { - flexDirection: 'row', - alignItems: 'center', - gap: spacing.xs, - marginBottom: 2 - }, - diffCommentMeta: { - flex: 1, - color: colors.textMuted, - fontSize: typography.metaSize, - fontWeight: '600' - }, - diffCommentDeleteButton: { - width: 22, - height: 22, - alignItems: 'center', - justifyContent: 'center', - borderRadius: 11 - }, - diffCommentBody: { - color: colors.textPrimary, - fontSize: typography.metaSize, - lineHeight: 17 - }, - diffCommentComposer: { - gap: spacing.xs, - marginLeft: 44, - marginRight: spacing.sm, - marginTop: spacing.xs, - borderWidth: 1, - borderColor: colors.borderSubtle, - borderRadius: radii.button, - backgroundColor: colors.bgPanel, - padding: spacing.sm - }, - diffCommentInput: { - minHeight: 70, - height: 70, - marginRight: 0, - paddingTop: spacing.sm, - paddingBottom: spacing.sm - }, - diffCommentComposerActions: { - flexDirection: 'row', - justifyContent: 'flex-end', - gap: spacing.xs - }, - diffCommentSecondaryAction: { - minHeight: 30, - justifyContent: 'center', - borderRadius: radii.button, - paddingHorizontal: spacing.md - }, - diffCommentSecondaryText: { - color: colors.textSecondary, - fontSize: typography.metaSize, - fontWeight: '600' - }, - diffCommentPrimaryAction: { - minHeight: 30, - justifyContent: 'center', - borderRadius: radii.button, - backgroundColor: colors.bgRaised, - paddingHorizontal: spacing.md - }, - diffCommentPrimaryText: { - color: colors.textPrimary, - fontSize: typography.metaSize, - fontWeight: '700' - }, - markdownRefreshButton: { - alignSelf: 'flex-start', - flexDirection: 'row', - alignItems: 'center', - gap: spacing.xs, - backgroundColor: colors.bgRaised, - borderWidth: 1, - borderColor: colors.borderSubtle, - borderRadius: radii.button, - paddingHorizontal: spacing.md, - paddingVertical: spacing.xs - }, - markdownButtonDisabled: { - opacity: 0.45 - }, - markdownRefreshText: { - color: colors.textPrimary, - fontSize: 13, - fontWeight: '600' - }, - markdownFloatingBar: { - position: 'absolute', - left: spacing.md, - right: spacing.md, - bottom: spacing.lg, - alignItems: 'flex-end', - gap: spacing.xs - }, - markdownFloatingStatus: { - maxWidth: '100%', - alignSelf: 'flex-end', - overflow: 'hidden', - color: colors.textSecondary, - backgroundColor: colors.bgPanel, - borderWidth: 1, - borderColor: colors.borderSubtle, - borderRadius: radii.button, - paddingHorizontal: spacing.sm, - paddingVertical: spacing.xs, - fontSize: typography.metaSize - }, - markdownFloatingActions: { - flexDirection: 'row', - flexWrap: 'wrap', - justifyContent: 'flex-end', - gap: spacing.xs - }, - markdownFloatingButton: { - minHeight: 34, - flexDirection: 'row', - alignItems: 'center', - gap: spacing.xs, - backgroundColor: colors.bgPanel, - borderWidth: 1, - borderColor: colors.borderSubtle, - borderRadius: radii.button, - paddingHorizontal: spacing.md, - paddingVertical: spacing.xs - }, - markdownSaveButton: { - backgroundColor: colors.bgRaised - }, - markdownFloatingButtonText: { - color: colors.textPrimary, - fontSize: 13, - fontWeight: '600' - }, - toast: { - position: 'absolute', - bottom: spacing.lg, - alignSelf: 'center', - left: 0, - right: 0, - alignItems: 'center' - }, - toastText: { - backgroundColor: colors.bgRaised, - borderWidth: StyleSheet.hairlineWidth, - borderColor: colors.borderSubtle, - color: colors.textPrimary, - fontSize: 13, - paddingHorizontal: spacing.lg, - paddingVertical: spacing.sm, - borderRadius: radii.button, - overflow: 'hidden' - }, - createWarningBanner: { - flexDirection: 'row', - alignItems: 'flex-start', - gap: spacing.sm, - backgroundColor: colors.bgPanel, - borderBottomWidth: StyleSheet.hairlineWidth, - borderBottomColor: colors.borderSubtle, - paddingHorizontal: spacing.md, - paddingVertical: spacing.sm - }, - createWarningText: { - flex: 1, - color: colors.textPrimary, - fontSize: 12, - lineHeight: 16 - }, - createWarningDismiss: { - width: 24, - height: 24, - alignItems: 'center', - justifyContent: 'center', - marginTop: -4 - }, - emptyState: { - flex: 1, - alignItems: 'center', - justifyContent: 'center', - padding: spacing.xl - }, - emptyText: { - color: colors.textSecondary, - fontSize: typography.bodySize, - marginBottom: spacing.lg - }, - createError: { - color: colors.statusRed, - fontSize: 13, - marginBottom: spacing.sm - }, - emptyActions: { - flexDirection: 'row', - flexWrap: 'wrap', - justifyContent: 'center', - gap: spacing.sm - }, - createButton: { - backgroundColor: colors.bgRaised, - borderWidth: 1, - borderColor: colors.borderSubtle, - paddingHorizontal: spacing.xl, - paddingVertical: spacing.sm + 2, - borderRadius: radii.button - }, - createButtonDisabled: { - opacity: 0.5 - }, - createButtonText: { - color: colors.textPrimary, - fontSize: typography.bodySize, - fontWeight: '600' - }, - commandDock: { - zIndex: 20 - }, - accessoryBar: { - borderTopWidth: 1, - borderTopColor: colors.borderSubtle, - backgroundColor: colors.bgPanel - }, - accessoryContent: { - paddingHorizontal: spacing.sm, - paddingVertical: spacing.xs, - gap: spacing.xs - }, - accessoryKey: { - backgroundColor: colors.bgRaised, - paddingHorizontal: spacing.sm + 2, - paddingVertical: spacing.xs, - borderRadius: radii.button, - minWidth: 36, - alignItems: 'center' - }, - accessoryKeyPressed: { - backgroundColor: colors.borderSubtle - }, - accessoryKeyActive: { - backgroundColor: colors.textPrimary - }, - customAccessoryKey: { - borderWidth: 1, - borderColor: colors.borderSubtle - }, - accessoryKeyDisabled: { - opacity: 0.35 - }, - accessoryKeyText: { - color: colors.textSecondary, - fontSize: 12, - fontFamily: typography.monoFamily - }, - accessoryKeyTextActive: { - color: colors.bgBase, - fontWeight: '700' - }, - accessoryKeyTextDisabled: { - color: colors.textMuted - }, - inputBar: { - flexDirection: 'row', - alignItems: 'center', - minHeight: 46, - paddingVertical: spacing.xs + 2, - paddingHorizontal: spacing.md, - borderTopWidth: 1, - borderTopColor: colors.borderSubtle, - backgroundColor: colors.bgPanel - }, - textInput: { - flex: 1, - height: 34, - backgroundColor: colors.bgRaised, - color: colors.textPrimary, - borderRadius: radii.input, - paddingHorizontal: spacing.md, - paddingVertical: 0, - fontSize: 14, - fontFamily: typography.monoFamily, - marginRight: spacing.sm - }, - liveInputBar: { - gap: spacing.sm - }, - - liveInputHint: { - flex: 1, - color: colors.textSecondary, - fontSize: typography.metaSize, - fontFamily: typography.monoFamily - }, - liveInputCapture: { - position: 'absolute', - opacity: 0, - width: 1, - height: 1, - color: colors.textPrimary - }, - sendButton: { - backgroundColor: colors.bgRaised, - width: 34, - height: 34, - borderRadius: 17, - alignItems: 'center', - justifyContent: 'center' - }, - dictationButton: { - backgroundColor: colors.bgRaised, - width: 34, - height: 34, - borderRadius: 17, - borderWidth: 1, - borderColor: 'transparent', - alignItems: 'center', - justifyContent: 'center', - marginRight: spacing.sm - }, - dictationButtonActive: { - backgroundColor: colors.bgPanel, - borderColor: colors.textSecondary - }, - sendButtonDisabled: { - opacity: 0.35 - } -}) diff --git a/mobile/app/h/[hostId]/session/mobile-session-command-input-styles.ts b/mobile/app/h/[hostId]/session/mobile-session-command-input-styles.ts new file mode 100644 index 00000000000..829078e3a9f --- /dev/null +++ b/mobile/app/h/[hostId]/session/mobile-session-command-input-styles.ts @@ -0,0 +1,178 @@ +import { StyleSheet } from 'react-native' + +import { colors, spacing, radii, typography } from '../../../../src/theme/mobile-theme' + +export const mobileSessionCommandInputStyles = StyleSheet.create({ + createWarningBanner: { + flexDirection: 'row', + alignItems: 'flex-start', + gap: spacing.sm, + backgroundColor: colors.bgPanel, + borderBottomWidth: StyleSheet.hairlineWidth, + borderBottomColor: colors.borderSubtle, + paddingHorizontal: spacing.md, + paddingVertical: spacing.sm + }, + createWarningText: { + flex: 1, + color: colors.textPrimary, + fontSize: 12, + lineHeight: 16 + }, + createWarningDismiss: { + width: 24, + height: 24, + alignItems: 'center', + justifyContent: 'center', + marginTop: -4 + }, + emptyState: { + flex: 1, + alignItems: 'center', + justifyContent: 'center', + padding: spacing.xl + }, + emptyText: { + color: colors.textSecondary, + fontSize: typography.bodySize, + marginBottom: spacing.lg + }, + createError: { + color: colors.statusRed, + fontSize: 13, + marginBottom: spacing.sm + }, + emptyActions: { + flexDirection: 'row', + flexWrap: 'wrap', + justifyContent: 'center', + gap: spacing.sm + }, + createButton: { + backgroundColor: colors.bgRaised, + borderWidth: 1, + borderColor: colors.borderSubtle, + paddingHorizontal: spacing.xl, + paddingVertical: spacing.sm + 2, + borderRadius: radii.button + }, + createButtonDisabled: { + opacity: 0.5 + }, + createButtonText: { + color: colors.textPrimary, + fontSize: typography.bodySize, + fontWeight: '600' + }, + commandDock: { + zIndex: 20 + }, + accessoryBar: { + borderTopWidth: 1, + borderTopColor: colors.borderSubtle, + backgroundColor: colors.bgPanel + }, + accessoryContent: { + paddingHorizontal: spacing.sm, + paddingVertical: spacing.xs, + gap: spacing.xs + }, + accessoryKey: { + backgroundColor: colors.bgRaised, + paddingHorizontal: spacing.sm + 2, + paddingVertical: spacing.xs, + borderRadius: radii.button, + minWidth: 36, + alignItems: 'center' + }, + accessoryKeyPressed: { + backgroundColor: colors.borderSubtle + }, + accessoryKeyActive: { + backgroundColor: colors.textPrimary + }, + customAccessoryKey: { + borderWidth: 1, + borderColor: colors.borderSubtle + }, + accessoryKeyDisabled: { + opacity: 0.35 + }, + accessoryKeyText: { + color: colors.textSecondary, + fontSize: 12, + fontFamily: typography.monoFamily + }, + accessoryKeyTextActive: { + color: colors.bgBase, + fontWeight: '700' + }, + accessoryKeyTextDisabled: { + color: colors.textMuted + }, + inputBar: { + flexDirection: 'row', + alignItems: 'center', + minHeight: 46, + paddingVertical: spacing.xs + 2, + paddingHorizontal: spacing.md, + borderTopWidth: 1, + borderTopColor: colors.borderSubtle, + backgroundColor: colors.bgPanel + }, + textInput: { + flex: 1, + height: 34, + backgroundColor: colors.bgRaised, + color: colors.textPrimary, + borderRadius: radii.input, + paddingHorizontal: spacing.md, + paddingVertical: 0, + fontSize: 14, + fontFamily: typography.monoFamily, + marginRight: spacing.sm + }, + liveInputBar: { + gap: spacing.sm + }, + + liveInputHint: { + flex: 1, + color: colors.textSecondary, + fontSize: typography.metaSize, + fontFamily: typography.monoFamily + }, + liveInputCapture: { + position: 'absolute', + opacity: 0, + width: 1, + height: 1, + color: colors.textPrimary + }, + sendButton: { + backgroundColor: colors.bgRaised, + width: 34, + height: 34, + borderRadius: 17, + alignItems: 'center', + justifyContent: 'center' + }, + dictationButton: { + backgroundColor: colors.bgRaised, + width: 34, + height: 34, + borderRadius: 17, + borderWidth: 1, + borderColor: 'transparent', + alignItems: 'center', + justifyContent: 'center', + marginRight: spacing.sm + }, + dictationButtonActive: { + backgroundColor: colors.bgPanel, + borderColor: colors.textSecondary + }, + sendButtonDisabled: { + opacity: 0.35 + } +}) diff --git a/mobile/app/h/[hostId]/session/mobile-session-frame-styles.ts b/mobile/app/h/[hostId]/session/mobile-session-frame-styles.ts new file mode 100644 index 00000000000..850fed362c5 --- /dev/null +++ b/mobile/app/h/[hostId]/session/mobile-session-frame-styles.ts @@ -0,0 +1,162 @@ +import { StyleSheet } from 'react-native' + +import { colors, spacing, radii, typography } from '../../../../src/theme/mobile-theme' + +export const mobileSessionFrameStyles = StyleSheet.create({ + container: { + flex: 1, + backgroundColor: colors.bgBase + }, + kavInner: { + flex: 1 + }, + sessionChrome: { + backgroundColor: colors.bgPanel, + borderBottomWidth: 1, + borderBottomColor: colors.borderSubtle + }, + sessionTopBar: { + minHeight: 44, + flexDirection: 'row', + alignItems: 'center', + paddingHorizontal: spacing.sm, + paddingVertical: spacing.xs + }, + backButton: { + width: 36, + height: 36, + borderRadius: 18, + alignItems: 'center', + justifyContent: 'center', + marginRight: spacing.xs + }, + backButtonPressed: { + backgroundColor: colors.bgRaised + }, + filesButton: { + width: 36, + height: 36, + borderRadius: radii.button, + alignItems: 'center', + justifyContent: 'center', + marginLeft: spacing.xs + }, + filesButtonPressed: { + backgroundColor: colors.bgRaised + }, + sessionTitleBlock: { + flex: 1, + minWidth: 0 + }, + sessionTitle: { + color: colors.textPrimary, + fontSize: 14, + fontWeight: '600' + }, + sessionMetaRow: { + flexDirection: 'row', + alignItems: 'center', + marginTop: 2 + }, + sessionMetaText: { + flexShrink: 1, + color: colors.textSecondary, + fontSize: typography.metaSize + }, + tabBar: { + flexDirection: 'row', + alignItems: 'center', + borderTopWidth: 1, + borderTopColor: colors.borderSubtle + }, + tabScroll: { + flex: 1, + maxHeight: 36 + }, + tabContent: { + paddingLeft: spacing.sm, + paddingRight: spacing.sm + }, + tab: { + width: 128, + maxWidth: 128, + minHeight: 36, + alignItems: 'center', + justifyContent: 'center', + paddingHorizontal: spacing.sm, + paddingVertical: spacing.sm, + borderBottomWidth: 2, + borderBottomColor: 'transparent' + }, + tabActive: { + borderBottomColor: colors.accentBlue + }, + tabLabelRow: { + maxWidth: '100%', + flexDirection: 'row', + alignItems: 'center', + gap: spacing.xs + }, + tabText: { + flexShrink: 1, + color: colors.textSecondary, + fontSize: 13 + }, + tabTextActive: { + color: colors.textPrimary + }, + newTerminalButton: { + width: 40, + height: 36, + alignItems: 'center', + justifyContent: 'center', + borderBottomWidth: 2, + borderBottomColor: 'transparent' + }, + newTerminalButtonPressed: { + backgroundColor: colors.bgRaised + }, + newTerminalButtonDisabled: { + opacity: 0.45 + }, + terminalFrame: { + flex: 1, + minHeight: 0, + position: 'relative', + overflow: 'hidden' + }, + terminalPane: { + ...StyleSheet.absoluteFillObject + }, + terminalPaneHidden: { + opacity: 0 + }, + terminalWebView: { + flex: 1 + }, + markdownFrame: { + flex: 1, + minHeight: 0, + backgroundColor: colors.bgBase + }, + browserFrame: { + flex: 1, + minHeight: 0, + backgroundColor: colors.bgBase + }, + markdownEditor: { + flex: 1, + position: 'relative' + }, + markdownState: { + flex: 1, + alignItems: 'center', + justifyContent: 'center', + padding: spacing.xl, + gap: spacing.md + }, + markdownError: { + color: colors.statusRed, + fontSize: typography.bodySize + } +}) diff --git a/mobile/app/h/[hostId]/session/mobile-session-reader-styles.ts b/mobile/app/h/[hostId]/session/mobile-session-reader-styles.ts new file mode 100644 index 00000000000..8ca1770eead --- /dev/null +++ b/mobile/app/h/[hostId]/session/mobile-session-reader-styles.ts @@ -0,0 +1,121 @@ +import { Platform, StyleSheet } from 'react-native' + +import { colors, spacing, radii, typography } from '../../../../src/theme/mobile-theme' + +export const mobileSessionReaderStyles = StyleSheet.create({ + markdownTextInput: { + flex: 1, + minHeight: 0, + color: colors.textPrimary, + backgroundColor: colors.bgBase, + paddingHorizontal: spacing.lg, + paddingTop: spacing.lg, + paddingBottom: spacing.xl * 3, + fontSize: typography.bodySize, + lineHeight: 22, + fontFamily: Platform.select({ ios: 'Menlo', android: 'monospace', default: 'monospace' }) + }, + filePreviewScroll: { + flex: 1, + minHeight: 0, + backgroundColor: colors.editorSurface + }, + filePreviewContent: { + paddingHorizontal: spacing.lg, + paddingTop: spacing.lg, + paddingBottom: spacing.xl + }, + filePreviewText: { + color: colors.textPrimary, + fontSize: typography.bodySize, + lineHeight: 22, + fontFamily: Platform.select({ ios: 'Menlo', android: 'monospace', default: 'monospace' }) + }, + diffNotesToolbar: { + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'space-between', + gap: spacing.sm, + paddingHorizontal: spacing.lg, + paddingVertical: spacing.sm, + borderBottomWidth: StyleSheet.hairlineWidth, + borderBottomColor: colors.borderSubtle, + backgroundColor: colors.bgPanel + }, + diffNotesTitleRow: { + minWidth: 0, + flex: 1, + flexDirection: 'row', + alignItems: 'center', + gap: spacing.xs + }, + diffNotesTitle: { + color: colors.textSecondary, + fontSize: typography.metaSize, + fontWeight: '600' + }, + diffNotesActions: { + flexDirection: 'row', + alignItems: 'center', + gap: spacing.xs + }, + diffNotesActionButton: { + minHeight: 30, + flexDirection: 'row', + alignItems: 'center', + gap: spacing.xs, + borderWidth: 1, + borderColor: colors.borderSubtle, + borderRadius: radii.button, + paddingHorizontal: spacing.sm, + backgroundColor: colors.bgRaised + }, + diffNotesActionText: { + color: colors.textSecondary, + fontSize: typography.metaSize, + fontWeight: '600' + }, + diffLineBlock: { + marginBottom: spacing.xs + }, + diffLine: { + flexDirection: 'row', + alignItems: 'flex-start', + borderLeftWidth: 2, + borderLeftColor: colors.editorSurface, + paddingRight: spacing.sm + }, + diffLineAdded: { + backgroundColor: colors.diffAddedBg, + borderLeftColor: colors.gitDecorationAdded + }, + diffLineDeleted: { + backgroundColor: colors.diffDeletedBg, + borderLeftColor: colors.gitDecorationDeleted + }, + diffGutter: { + width: 42, + paddingRight: spacing.sm, + textAlign: 'right', + color: colors.textMuted, + fontSize: typography.metaSize, + lineHeight: 22, + fontFamily: Platform.select({ ios: 'Menlo', android: 'monospace', default: 'monospace' }) + }, + diffText: { + flex: 1, + color: colors.textPrimary, + fontSize: typography.bodySize, + lineHeight: 22, + fontFamily: Platform.select({ ios: 'Menlo', android: 'monospace', default: 'monospace' }) + }, + diffPrefix: { + color: colors.textMuted + }, + diffPrefixAdded: { + color: colors.gitDecorationAdded + }, + diffPrefixDeleted: { + color: colors.gitDecorationDeleted + } +}) diff --git a/mobile/app/h/[hostId]/session/mobile-session-review-comment-styles.ts b/mobile/app/h/[hostId]/session/mobile-session-review-comment-styles.ts new file mode 100644 index 00000000000..b9d19578b83 --- /dev/null +++ b/mobile/app/h/[hostId]/session/mobile-session-review-comment-styles.ts @@ -0,0 +1,189 @@ +import { StyleSheet } from 'react-native' + +import { colors, spacing, radii, typography } from '../../../../src/theme/mobile-theme' + +export const mobileSessionReviewCommentStyles = StyleSheet.create({ + diffCommentAddButton: { + width: 26, + height: 22, + alignItems: 'center', + justifyContent: 'center', + borderRadius: radii.button + }, + diffCommentAddButtonPressed: { + backgroundColor: colors.bgPanel + }, + diffCommentButtonDisabled: { + opacity: 0.45 + }, + diffCommentList: { + gap: spacing.xs, + marginLeft: 44, + marginRight: spacing.sm, + marginTop: spacing.xs + }, + diffCommentCard: { + borderWidth: 1, + borderColor: colors.borderSubtle, + borderRadius: radii.button, + backgroundColor: colors.bgPanel, + paddingHorizontal: spacing.sm, + paddingVertical: spacing.xs + }, + diffCommentHeader: { + flexDirection: 'row', + alignItems: 'center', + gap: spacing.xs, + marginBottom: 2 + }, + diffCommentMeta: { + flex: 1, + color: colors.textMuted, + fontSize: typography.metaSize, + fontWeight: '600' + }, + diffCommentDeleteButton: { + width: 22, + height: 22, + alignItems: 'center', + justifyContent: 'center', + borderRadius: 11 + }, + diffCommentBody: { + color: colors.textPrimary, + fontSize: typography.metaSize, + lineHeight: 17 + }, + diffCommentComposer: { + gap: spacing.xs, + marginLeft: 44, + marginRight: spacing.sm, + marginTop: spacing.xs, + borderWidth: 1, + borderColor: colors.borderSubtle, + borderRadius: radii.button, + backgroundColor: colors.bgPanel, + padding: spacing.sm + }, + diffCommentInput: { + minHeight: 70, + height: 70, + marginRight: 0, + paddingTop: spacing.sm, + paddingBottom: spacing.sm + }, + diffCommentComposerActions: { + flexDirection: 'row', + justifyContent: 'flex-end', + gap: spacing.xs + }, + diffCommentSecondaryAction: { + minHeight: 30, + justifyContent: 'center', + borderRadius: radii.button, + paddingHorizontal: spacing.md + }, + diffCommentSecondaryText: { + color: colors.textSecondary, + fontSize: typography.metaSize, + fontWeight: '600' + }, + diffCommentPrimaryAction: { + minHeight: 30, + justifyContent: 'center', + borderRadius: radii.button, + backgroundColor: colors.bgRaised, + paddingHorizontal: spacing.md + }, + diffCommentPrimaryText: { + color: colors.textPrimary, + fontSize: typography.metaSize, + fontWeight: '700' + }, + markdownRefreshButton: { + alignSelf: 'flex-start', + flexDirection: 'row', + alignItems: 'center', + gap: spacing.xs, + backgroundColor: colors.bgRaised, + borderWidth: 1, + borderColor: colors.borderSubtle, + borderRadius: radii.button, + paddingHorizontal: spacing.md, + paddingVertical: spacing.xs + }, + markdownButtonDisabled: { + opacity: 0.45 + }, + markdownRefreshText: { + color: colors.textPrimary, + fontSize: 13, + fontWeight: '600' + }, + markdownFloatingBar: { + position: 'absolute', + left: spacing.md, + right: spacing.md, + bottom: spacing.lg, + alignItems: 'flex-end', + gap: spacing.xs + }, + markdownFloatingStatus: { + maxWidth: '100%', + alignSelf: 'flex-end', + overflow: 'hidden', + color: colors.textSecondary, + backgroundColor: colors.bgPanel, + borderWidth: 1, + borderColor: colors.borderSubtle, + borderRadius: radii.button, + paddingHorizontal: spacing.sm, + paddingVertical: spacing.xs, + fontSize: typography.metaSize + }, + markdownFloatingActions: { + flexDirection: 'row', + flexWrap: 'wrap', + justifyContent: 'flex-end', + gap: spacing.xs + }, + markdownFloatingButton: { + minHeight: 34, + flexDirection: 'row', + alignItems: 'center', + gap: spacing.xs, + backgroundColor: colors.bgPanel, + borderWidth: 1, + borderColor: colors.borderSubtle, + borderRadius: radii.button, + paddingHorizontal: spacing.md, + paddingVertical: spacing.xs + }, + markdownSaveButton: { + backgroundColor: colors.bgRaised + }, + markdownFloatingButtonText: { + color: colors.textPrimary, + fontSize: 13, + fontWeight: '600' + }, + toast: { + position: 'absolute', + bottom: spacing.lg, + alignSelf: 'center', + left: 0, + right: 0, + alignItems: 'center' + }, + toastText: { + backgroundColor: colors.bgRaised, + borderWidth: StyleSheet.hairlineWidth, + borderColor: colors.borderSubtle, + color: colors.textPrimary, + fontSize: 13, + paddingHorizontal: spacing.lg, + paddingVertical: spacing.sm, + borderRadius: radii.button, + overflow: 'hidden' + } +}) diff --git a/mobile/app/h/[hostId]/session/mobile-session-styles.ts b/mobile/app/h/[hostId]/session/mobile-session-styles.ts new file mode 100644 index 00000000000..0f1baae476e --- /dev/null +++ b/mobile/app/h/[hostId]/session/mobile-session-styles.ts @@ -0,0 +1,11 @@ +import { mobileSessionCommandInputStyles } from './mobile-session-command-input-styles' +import { mobileSessionFrameStyles } from './mobile-session-frame-styles' +import { mobileSessionReaderStyles } from './mobile-session-reader-styles' +import { mobileSessionReviewCommentStyles } from './mobile-session-review-comment-styles' + +export const styles = { + ...mobileSessionFrameStyles, + ...mobileSessionReaderStyles, + ...mobileSessionReviewCommentStyles, + ...mobileSessionCommandInputStyles +}