refactor: split mobile remote prompt styles

This commit is contained in:
lucaronin
2026-05-05 13:35:38 +02:00
parent 36560a7b8c
commit 217481dcee
5 changed files with 83 additions and 15 deletions

View File

@@ -19,7 +19,7 @@ export function MobileVaultRemotePrompt({
remoteUrl: string
}) {
return (
<View style={styles.createNotePrompt}>
<View style={styles.remotePrompt}>
<Text style={styles.remotePromptTitle}>Git remote</Text>
<TextInput
accessibilityLabel="Git remote URL"
@@ -30,14 +30,14 @@ export function MobileVaultRemotePrompt({
onSubmitEditing={onSubmit}
placeholder="https://github.com/owner/repo.git"
returnKeyType="done"
style={styles.createNoteInput}
style={styles.remotePromptInput}
value={remoteUrl}
/>
{!hasGitHubOAuthClientId ? (
<Text style={styles.createNoteError}>GitHub login needs EXPO_PUBLIC_GITHUB_OAUTH_CLIENT_ID</Text>
<Text style={styles.remotePromptError}>GitHub login needs EXPO_PUBLIC_GITHUB_OAUTH_CLIENT_ID</Text>
) : null}
{failed ? <Text style={styles.createNoteError}>Enter a valid Git remote URL</Text> : null}
<View style={styles.createNoteActions}>
{failed ? <Text style={styles.remotePromptError}>Enter a valid Git remote URL</Text> : null}
<View style={styles.remotePromptActions}>
<PromptButton label="Cancel" onPress={onCancel} />
<PromptButton label={isSaving ? 'Saving' : 'Save'} onPress={onSubmit} disabled={isSaving} primary />
</View>
@@ -61,13 +61,13 @@ function PromptButton({
disabled={disabled}
onPress={onPress}
style={({ pressed }) => [
styles.createNoteAction,
primary ? styles.createNoteActionPrimary : null,
disabled ? styles.createNoteActionDisabled : null,
styles.remotePromptAction,
primary ? styles.remotePromptActionPrimary : null,
disabled ? styles.remotePromptActionDisabled : null,
pressed ? styles.pressed : null,
]}
>
<Text style={[styles.createNoteActionText, primary ? styles.createNoteActionTextPrimary : null]}>{label}</Text>
<Text style={[styles.remotePromptActionText, primary ? styles.remotePromptActionTextPrimary : null]}>{label}</Text>
</Pressable>
)
}

View File

@@ -6,6 +6,7 @@ import { noteCreateStyles } from './styles/noteCreateStyles'
import { noteListStyles } from './styles/noteListStyles'
import { propertiesStyles } from './styles/propertiesStyles'
import { propertyChipStyles } from './styles/propertyChipStyles'
import { remotePromptStyles } from './styles/remotePromptStyles'
import { sidebarStyles } from './styles/sidebarStyles'
import { vaultLoadStyles } from './styles/vaultLoadStyles'
@@ -18,6 +19,7 @@ export const styles = {
...noteListStyles,
...propertiesStyles,
...propertyChipStyles,
...remotePromptStyles,
...sidebarStyles,
...vaultLoadStyles,
}

View File

@@ -61,9 +61,4 @@ export const noteCreateStyles = StyleSheet.create({
padding: spacing.md,
backgroundColor: colors.canvas,
},
remotePromptTitle: {
color: colors.text,
fontSize: 15,
fontWeight: '800',
},
})

View File

@@ -0,0 +1,66 @@
import { StyleSheet } from 'react-native'
import { colors, spacing } from '../theme'
export const remotePromptStyles = StyleSheet.create({
remotePrompt: {
position: 'absolute',
right: spacing.xl,
bottom: spacing.xl + 76,
width: 280,
gap: spacing.sm,
borderColor: colors.border,
borderWidth: StyleSheet.hairlineWidth,
borderRadius: 18,
padding: spacing.md,
backgroundColor: colors.canvas,
},
remotePromptAction: {
minWidth: 82,
alignItems: 'center',
justifyContent: 'center',
borderRadius: 16,
paddingHorizontal: spacing.md,
paddingVertical: spacing.sm,
backgroundColor: colors.primarySoft,
},
remotePromptActionDisabled: {
opacity: 0.55,
},
remotePromptActionPrimary: {
backgroundColor: colors.primary,
},
remotePromptActionText: {
color: colors.primary,
fontSize: 14,
fontWeight: '700',
},
remotePromptActionTextPrimary: {
color: colors.canvas,
},
remotePromptActions: {
flexDirection: 'row',
justifyContent: 'flex-end',
gap: spacing.sm,
},
remotePromptError: {
color: colors.textSoft,
fontSize: 13,
fontWeight: '600',
},
remotePromptInput: {
minHeight: 44,
borderColor: colors.border,
borderWidth: StyleSheet.hairlineWidth,
borderRadius: 14,
paddingHorizontal: spacing.md,
color: colors.text,
backgroundColor: colors.canvas,
fontSize: 16,
fontWeight: '600',
},
remotePromptTitle: {
color: colors.text,
fontSize: 15,
fontWeight: '800',
},
})

View File

@@ -95,12 +95,13 @@ This file is the resumable working log for Tolaria mobile. The strategy and road
- Wired remote-backed mobile sync status actions to credential loading and the GitHub OAuth flow, including visible syncing/failed status states when Connect is tapped.
- Added a mobile vault remote setup prompt behind the sidebar controls, with persisted remote URL metadata validation and removal by blanking the value.
- Exposed the missing `EXPO_PUBLIC_GITHUB_OAUTH_CLIENT_ID` requirement inside the mobile remote setup prompt and split the client-id detector away from native AuthSession imports.
- Separated the mobile Git remote setup prompt styles from note-creation prompt styles so vault-management UI can evolve without coupling to compose UI names.
## Next Action
Continue Phase 4 with editor durability:
1. Add a clearer mobile settings/vault-management surface around the remote setup prompt and consider moving the prompt out of the create-note popover styling.
1. Add a clearer mobile settings/vault-management surface around the remote setup prompt.
2. Continue TenTap Markdown serialization coverage for any editor output observed in simulator QA.
3. Retry the iOS development-client build after installing an iOS 26.2 simulator runtime in Xcode.
@@ -356,6 +357,10 @@ Continue Phase 4 with editor durability:
- `pnpm --filter @tolaria/mobile typecheck` passed after surfacing OAuth client-id state.
- CodeScene after surfacing OAuth client-id state: `apps/mobile/src/MobileApp.tsx`, `apps/mobile/src/MobileVaultRemotePrompt.tsx`, `apps/mobile/src/mobileGitHubOAuthClientId.ts`, `apps/mobile/src/mobileGitHubOAuthEnvironment.ts`, and `apps/mobile/src/mobileGitHubOAuthEnvironment.test.ts` scored `10`.
- `pnpm --filter @tolaria/mobile exec expo export --platform ios --output-dir /tmp/tolaria-mobile-export` passed after surfacing OAuth client-id state.
- `pnpm --filter @tolaria/mobile test -- src/mobileVaultRemoteSetup.test.ts src/mobileGitHubOAuthEnvironment.test.ts` passed after splitting mobile remote prompt styles: 39 files / 131 tests.
- `pnpm --filter @tolaria/mobile typecheck` passed after splitting mobile remote prompt styles.
- CodeScene after splitting mobile remote prompt styles: `apps/mobile/src/MobileVaultRemotePrompt.tsx`, `apps/mobile/src/styles/remotePromptStyles.ts`, and `apps/mobile/src/styles/noteCreateStyles.ts` scored `10`; `apps/mobile/src/styles.ts` returned no scorable code and no findings.
- `pnpm --filter @tolaria/mobile exec expo export --platform ios --output-dir /tmp/tolaria-mobile-export` passed after splitting mobile remote prompt styles.
## Risks / Watch Items