PreferencesRepository
Component Detail
Description
Provides encrypted local persistence for user preference data using the Drift database, abstracting all read and write operations behind a typed interface. It handles serialisation and deserialisation of preference entries and ensures the local store is initialised with sensible defaults on first access. The repository is the single point of contact for any code that needs to read or write preferences from local storage.
preferences-repository
Sources & reasoning
The source explicitly lists Settings as a named screen type and specifies hamburger menu access as the entry point. The design token system requirement at line 305 confirms the settings surface must honour accessibility constraints. Blueprint marks this MVP and all workshop organizations expect standard app configurability from launch. Fase 1 core mobile scope implies MVP delivery with no later phase evidence.
-
docs/source/likeperson.md · line 292Settings accessible from hamburger menu
-
docs/source/likeperson.md · line 300Settings and preferences
-
docs/source/likeperson.md · line 305Design token system (colors, typography, spacing, radii, sizing) - WCAG 2.2 AA compliant
Responsibilities
- Store and retrieve user preferences as typed key-value entries in the encrypted Drift database
- Initialise default preference values when a key is accessed for the first time
- Expose transactional write operations to ensure atomic preference updates
- Provide a stream or observable for reactive UI updates when preferences change
Interfaces
get(key: string): Promise<unknown>
set(key: string, value: unknown): Promise<void>
getAll(): Promise<UserPreferences>
watch(key: string): Stream<unknown>
clear(): Promise<void>