Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Add autofill credential create confirm screen to improve UX (#771)

Leendert de Borst96b7b4cc9798
diff --git a/mobile-app/app/(tabs)/credentials/_layout.tsx b/mobile-app/app/(tabs)/credentials/_layout.tsx
index 751b0f578..6f7420952 100644
--- a/mobile-app/app/(tabs)/credentials/_layout.tsx
+++ b/mobile-app/app/(tabs)/credentials/_layout.tsx
@@ -25,6 +25,17 @@ export default function CredentialsLayout() {
gestureEnabled: true,
}}
/>
+ <Stack.Screen
+ name="autofill-confirmation"
+ options={{
+ title: 'Autofill Confirmation',
+ presentation: Platform.OS === 'ios' ? 'modal' : 'card',
+ headerShown: true,
+ headerStyle: {
+ backgroundColor: colors.headerBackground,
+ },
+ }}
+ />
<Stack.Screen
name="[id]"
options={{
diff --git a/mobile-app/app/(tabs)/credentials/add-edit.tsx b/mobile-app/app/(tabs)/credentials/add-edit.tsx
index bf7007f7c..4c4623125 100644
--- a/mobile-app/app/(tabs)/credentials/add-edit.tsx
+++ b/mobile-app/app/(tabs)/credentials/add-edit.tsx
@@ -17,6 +17,7 @@ import NativeVaultManager from '@/specs/NativeVaultManager';
import { useAuth } from '@/context/AuthContext';
import { FaviconExtractModel } from '@/utils/types/webapi/FaviconExtractModel';
import * as FileSystem from 'expo-file-system';
+import { AliasVaultToast } from '@/components/Toast';
type CredentialMode = 'random' | 'manual';
interface VaultPostResponse {
@@ -38,8 +39,8 @@ export default function AddEditCredentialScreen() {
Id: "",
Username: "",
Password: "",
- ServiceName: "test",
- ServiceUrl: "https://google.com",
+ ServiceName: "",
+ ServiceUrl: "",
Notes: "",
Alias: {
FirstName: "",
@@ -343,16 +344,25 @@ export default function AddEditCredentialScreen() {
if (response.status === 0) {
await NativeVaultManager.setCurrentVaultRevisionNumber(response.newRevisionNumber);
- Toast.show({
- type: 'success',
- text1: isEditMode ? 'Credential updated successfully' : 'Credential created successfully',
- position: 'bottom'
- });
-
// Emit an event to notify list and detail views to refresh
emitter.emit('credentialChanged', credentialToSave.Id);
- router.back();
+ // If this was created from autofill (serviceUrl param), show confirmation screen
+ if (serviceUrl && !isEditMode) {
+ router.replace('/credentials/autofill-confirmation');
+
+ } else {
+ // Show this toast after 200ms to ensure it appears after this component is navigated away from.
+ setTimeout(() => {
+ Toast.show({
+ type: 'success',
+ text1: isEditMode ? 'Credential updated successfully' : 'Credential created successfully',
+ position: 'bottom'
+ });
+ }, 200);
+
+ router.back();
+ }
} else if (response.status === 1) {
throw new Error('Vault merge required. Please login via the web app to merge the multiple pending updates to your vault.');
} else {
@@ -606,6 +616,7 @@ export default function AddEditCredentialScreen() {
)}
</ScrollView>
</ThemedView>
+ <AliasVaultToast />
</ThemedSafeAreaView>
);
}
\ No newline at end of file
diff --git a/mobile-app/app/(tabs)/credentials/autofill-confirmation.tsx b/mobile-app/app/(tabs)/credentials/autofill-confirmation.tsx
new file mode 100644
index 000000000..ab5925651
--- /dev/null
+++ b/mobile-app/app/(tabs)/credentials/autofill-confirmation.tsx
@@ -0,0 +1,84 @@
+import { StyleSheet, View, TouchableOpacity, Platform } from 'react-native';
+import { useNavigation, useRouter } from 'expo-router';
+import { ThemedText } from '@/components/ThemedText';
+import { ThemedView } from '@/components/ThemedView';
+import { ThemedSafeAreaView } from '@/components/ThemedSafeAreaView';
+import { useColors } from '@/hooks/useColorScheme';
+import MaterialIcons from '@expo/vector-icons/MaterialIcons';
+import { useEffect } from 'react';
+
+export default function AutofillConfirmationScreen() {
+ const router = useRouter();
+ const colors = useColors();
+ const navigation = useNavigation();
+
+ // Set header buttons
+ useEffect(() => {
+ navigation.setOptions({
+ headerRight: () => (
+ <View style={{ flexDirection: 'row' }}>
+ <TouchableOpacity
+ onPress={handleStayInApp}
+ style={{ padding: 10, paddingRight: 0 }}
+ >
+ <ThemedText style={{ color: colors.primary }}>Dismiss</ThemedText>
+ </TouchableOpacity>
+ </View>
+ ),
+ });
+ }, [navigation]);
+
+ const handleStayInApp = () => {
+ router.back();
+ };
+
+ const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ },
+ content: {
+ flex: 1,
+ padding: 20,
+ alignItems: 'center',
+ justifyContent: 'center',
+ },
+ iconContainer: {
+ marginBottom: 30,
+ },
+ title: {
+ fontSize: 24,
+ fontWeight: 'bold',
+ textAlign: 'center',
+ marginBottom: 20,
+ },
+ message: {
+ fontSize: 16,
+ textAlign: 'center',
+ marginBottom: 30,
+ lineHeight: 24,
+ },
+ });
+
+ return (
+ <ThemedSafeAreaView style={styles.container}>
+ <ThemedView style={styles.content}>
+ <View style={styles.iconContainer}>
+ <MaterialIcons
+ name="task-alt"
+ size={80}
+ color={colors.primary}
+ />
+ </View>
+
+ <ThemedText style={styles.title}>Credential Created Successfully!</ThemedText>
+
+ <ThemedText style={styles.message}>
+ Your new credential has been created and is now available for password autofill.
+ </ThemedText>
+ <ThemedText style={[styles.message, { fontWeight: 'bold', marginTop: 20 }]}>
+ Switch back to your browser to continue.
+ </ThemedText>
+ </ThemedView>
+ </ThemedSafeAreaView>
+ );
+}
\ No newline at end of file