feat(mobile): surface offline queue readiness

This commit is contained in:
saravanakumardb1 2026-03-10 09:22:20 -07:00
parent 9d4271308c
commit a10709f33a
3 changed files with 29 additions and 2 deletions

View File

@ -75,6 +75,7 @@ Stack: React Native + Expo + TypeScript
- Home/search/capture now use active workspace context for more useful mobile browsing.
- Note detail now supports lightweight local editing plus basic artifact metadata viewing.
- Inbox now supports simple approval/reject flows and a lightweight activity feed.
- Capture now surfaces offline queue readiness details for the current mobile scaffold.
- Mobile currently uses provisional product config and fallback note/workspace data until product identity and backend contract details are finalized.
# Open Questions

View File

@ -3,6 +3,7 @@ import { Pressable, StyleSheet, Text, TextInput, View } from 'react-native';
import type { MobileWorkspace } from '../../api/workspaces';
import { useNotesStore, type NotesState } from '../../store/notes-store';
import { useWorkspaceStore, type WorkspaceState } from '../../store/workspace-store';
import { OFFLINE_QUEUE_MAX_RETRIES, OFFLINE_QUEUE_MAX_SIZE } from '../../lib/offline-queue';
import { colors } from '../../theme';
export default function CaptureScreen() {
@ -55,6 +56,11 @@ export default function CaptureScreen() {
<Text style={styles.buttonText}>Save draft</Text>
</Pressable>
{saved ? <Text style={styles.saved}>Draft saved locally in this scaffold step.</Text> : null}
<View style={styles.card}>
<Text style={styles.cardTitle}>Offline queue readiness</Text>
<Text style={styles.cardBody}>Queue capacity: {OFFLINE_QUEUE_MAX_SIZE} items</Text>
<Text style={styles.cardBody}>Retry policy: {OFFLINE_QUEUE_MAX_RETRIES} attempts</Text>
</View>
</View>
);
}
@ -103,4 +109,21 @@ const styles = StyleSheet.create({
fontSize: 14,
fontWeight: '600',
},
card: {
backgroundColor: colors.surfaceCard,
borderRadius: 14,
borderWidth: 1,
borderColor: colors.borderDefault,
padding: 14,
gap: 6,
},
cardTitle: {
color: colors.textPrimary,
fontSize: 16,
fontWeight: '700',
},
cardBody: {
color: colors.textSecondary,
fontSize: 14,
},
});

View File

@ -1,12 +1,15 @@
import { createOfflineQueue } from '@bytelyst/offline-queue';
import { mmkvStorage } from '../store/mmkv-storage';
export const OFFLINE_QUEUE_MAX_RETRIES = 5;
export const OFFLINE_QUEUE_MAX_SIZE = 50;
export const noteOfflineQueue = createOfflineQueue({
storageKey: 'bytelyst-notes-offline-queue',
storage: {
getItem: (key: string) => mmkvStorage.getItem(key),
setItem: (key: string, value: string) => mmkvStorage.setItem(key, value),
},
maxRetries: 5,
maxQueueSize: 50,
maxRetries: OFFLINE_QUEUE_MAX_RETRIES,
maxQueueSize: OFFLINE_QUEUE_MAX_SIZE,
});