Commit 7d53b31
authored
refactor(app): migrate to shared/features structure and harden popup flows (#178)
* refactor: modal config, settings flow, features/shared structure, folder rules
- Modal screens: helpers (modalFlow, slideFromRight, modalWithBlur, cardFade,
fullScreenModal, modalTransparent), remove redundant defaults, fix transaction
detail header (headerShown: true)
- Settings flow: add _layout as group flow, slideFromRight animation, fix drawer
nav path (no leading slash)
- Camera: fix scan overlay corners (inline styles for consistency)
- Folder structure: add .cursor/rules/folder-structure.mdc, update AGENTS.md and
code-quality architecture boundaries
- Features/shared migration: components, hooks, helper, stores, providers moved
to features/ and shared/
Made-with: Cursor
* refactor: consolidate utils, reorganize shared/ui
- Migrate utils/nip17 → shared/lib/nostr/nip17, remove duplicate
- Consolidate map utils (utils/ + features/map/utils/) → shared/lib/map/
- Move hero-transition → shared/providers/hero-transition/
- Move transfer → shared/blocks/transfer/
- Remove utils/ and features/map/utils/ directories
- docs: update folder-structure (utils deprecated, providers/blocks rules)
- docs: fix theme-system-architecture (helper/themeEngine → shared/lib/themeEngine)
Made-with: Cursor
* refactor(features): consolidate transactions imports across screens
Made-with: Cursor
* refactor(popup): migrate action sheets to HeroUI BottomSheet
- Replace react-native-actions-sheet with HeroUI BottomSheet for profile
switcher, emoji picker, and button handler
- Redesign profile switcher to scrollable-with-snap-points layout:
Select profile header, scrollable list, fixed footer with Generate new
account and Import nsec
- Add named popup functions (profileSwitcherPopup, emojiPickerPopup,
buttonHandlerPopup) aligned with popups.ts API
- Add actionSheetTypes and bridge for custom sheet payloads
- Metro resolver for heroui-native; PopupHost handles custom sheets
Made-with: Cursor
* refactor: consolidate popup imports and minor formatting
- Group popup imports in SendTokenScreen and UserMessagesScreen
- Simplify ImportNsec return in profileSwitcher
Made-with: Cursor
* refactor(popup): unify actionable sheets under button-handler
Migrate remaining actionable popup button sheets to buttonHandlerPopup, add nested pushSheet support for SendToken emoji flow, and fix bottom-sheet reopen behavior by syncing close events reliably in PopupHost.
Made-with: Cursor
* refactor(popup): unify sheet headers, content layout, and fix formatting
- Add SheetHeader and SheetContent for consistent action sheet layout
- Remove horizontal padding from profile-style sheets (px-0)
- Fix import nsec form field padding (move Description outside TextField)
- Use AmountFormatter for profile selector balances to match wallet header
- Add IMPORT_NSEC_LABEL constant to avoid duplication
Made-with: Cursor
* docs(rules): align rule docs and paths with shared/ layout
- Update popup, code-quality, zustand, secure-storage, text, theme, git rules
- Fix globs and path refs: helper/* → shared/lib/*, components/* → shared/*
- Replace DevPopupPanel refs with Wallet __DEV__ test buttons
- Update knip.json ignoreIssues paths
- Fix @module JSDoc in shared/ui, engine, utils, colorUtils
- Add @fileoverview to profileSessionOrchestrator
Made-with: Cursor
* refactor(settings): remove storage screen, add widget target
- Remove SettingsStorageScreen and storage route from settings flow
- Add iOS widget target (Info.plist, Swift entry, expo-target.config)
- Update settings layout, keyring screen, and explore screen
- Update importNsec sheet and .gitignore
Made-with: Cursor
* fix(profile): scope profile stores by pubkey instead of account index
- createProfileScopedStorage() now uses active profile pubkey for keys
- Key format: {name}:profile:{pubkey} for all profiles (no index collision)
- Add migrateProfileScopedKeys() one-time migration from index-based keys
- clearAllProfileScopedData() now accepts pubkeys instead of indexes
- Wire migration in MigrationGate (runs on every launch, idempotent)
- Fixes imported profiles seeing swap/other data from wrong accounts
Made-with: Cursor
* fix(popup): move PopupHost outside account-scoped providers and guard CocoManager cleanup race
Move PopupHost outside AccountScopedProviders so it is never unmounted
during profile switches, preventing the BottomSheet from being torn down
mid-animation which would leave a native overlay blocking touches.
Add pendingCleanup tracking to CocoManager so initialize() awaits any
in-flight cleanup() before proceeding, avoiding race conditions during
hot reload or rapid profile switches.
Made-with: Cursor
* feat(settings): add storage inventory screen and debug lib
- Add storage route and SettingsStorageScreen for debug inspection
- Add shared/lib/debug/storageInventory for AsyncStorage, SecureStore, coco DB
- Refactor payments: skeleton loading, display contacts before decryption
- Update assets: optimize images, remove unused blue.jpg and initializing.png
Made-with: Cursor
* refactor: theme tokens and component styling across features
- Update theme system architecture docs
- Apply semantic tokens to feed, mint, payments, settings, transactions, user, wallet
- Avatar gradient and profile switcher updates
- Wallet header and mint balance display refinements
Made-with: Cursor
* refactor(settings): remove Recovery section and Free Reserved Proofs from dev menu
Made-with: Cursor
* refactor(popup): add payment status toasts and refactor modal config
- Add PaymentStatusToast, CompactToast, usePaymentStatusListener
- Add paymentStatusStore and parsePaymentError
- Refactor popup engine, bridge, PopupHost
- Update receive/send/wallet screens
- Add .easignore
Made-with: Cursor
* refactor(popup): split popups by domain, rename profile-switcher, update docs
- Split popups.ts into popups/ domain modules (copy, payment, token, etc.)
- Rename profileSwitcher/ to profile-switcher/ for kebab-case consistency
- Extract liveSheetTypes.ts for circular import fix
- Update popup-toast-sheet-guidelines.mdc with current structure
- Remove withSheetProvider HOC and app/message dead code
Made-with: Cursor
* refactor(send,receive): transfer chain, history entry hook, popup config
- Extract AnimatedCheckpointDot, simplify TransferStepChain
- Add useReceiveHistoryEntry hook for receive flow
- Refactor HistoryEntryTimeline, ReceiveTokenScreen, MeltQuoteScreen
- Add send popup exports to popups barrel
Made-with: Cursor
* Update widgets.swift
* fix(profile): comprehensive profile scoping audit and safety improvements
Close SQLite connections on CocoManager cleanup, capture accountIndex at
render time in SendTokenScreen, add cancellation guard to payment status
listener, clear payment status store before profile reload, gate
profile-scoped store hydration on profileStore readiness, guard
CocoManager access from popup host, pass accountIndex as prop to
NostrNDKProvider, document rehydrateProfileStores as reserved, and add
periodic safety/security audit rule for profile-scoped code.
Made-with: Cursor
* fix(profile): redesign profile management with native restart and nuclear delete
Profile switching, creation, import, and deletion were unreliable because
Updates.reloadAsync() silently fails in production (no expo-updates config),
the WalletScreen action queue lost actions when navigation/focus failed,
FullWindowOverlay ghost windows captured touches after JS reload, and
deleteAccount called clearAllSecureData which nuked the root mnemonic
causing new identities to appear instead of deleting.
- Add react-native-restart for reliable native app restarts
- Create appRestart.ts with priority chain (DevSettings → RNRestart → Updates)
- Rewrite profileSessionOrchestrator with AsyncStorage-based transition guard,
registered controls pattern, and direct orchestrator calls from drawer
- Delete profileActionStore and remove WalletScreen action queue
- Disable FullWindowOverlay on PopupHost to prevent ghost windows
- Add clearPerProfileSecureData() that preserves root mnemonic
- Nuclear deleteAllProfiles: CocoManager.completeReset + clearAllSecureData +
AsyncStorage.clear + Redux purge — nothing survives
- DeleteScreen always calls deleteAllProfiles for full wipe
- Register transition controls and key derivation in app/_layout.tsx
Made-with: Cursor
* fix(profile): unblock first-session derivation and pin import vectors
Profile creation could fail on the first session after a fresh wipe because
NostrKeysProvider generated and stored the root mnemonic during initialization,
but getKeysForAccount still depended on stale hook state and returned null until
a later refresh or relaunch. This makes account derivation fall back to reading
SecureStore directly and refreshes the mnemonic after generation so create flows
work immediately.
It also adds a dev-only deterministic mnemonic override for fresh wallets via
Expo config and simplifies the key derivation test suite around the one root
mnemonic and imported nsec path the app actually relies on, including pinned
Cashu values for imported profiles.
Made-with: Cursor
* chore(dev): simplify debug mnemonic override
The dev mnemonic override did not need the extra Expo config plumbing.
Use EXPO_PUBLIC_DEBUG_MNEMONIC directly in secureStorage and keep the
package script focused on restarting Expo with a clean cache.
Made-with: Cursor
* fix(popup): render sheets above native modals
Re-enable HeroUI's full-window overlay for PopupHost so button-handler sheets stack above modal and form-sheet presentations. Update the popup and profile-safety docs to preserve that layering behavior while still tearing sheets down before restart.
Made-with: Cursor
* chore(redux): mark legacy migration files as deprecated
Rename the remaining Redux migration files to explicit deprecated paths so their migration-only role is obvious. Trim dead legacy exports at the same time so knip stays clean without hiding real issues.
Made-with: Cursor
* refactor(feed): prune legacy UI and relocate shared primitives
Remove unused feed image-overlay, stories, and note components while moving shared container and scroll offset helpers to clearer homes. This keeps exports aligned with the current feature structure and trims dead code surfaced by the cleanup tooling.
Made-with: Cursor
* style: normalize wrapped imports and declarations
Apply formatting cleanup to wrapped imports, exports, and type declarations so generated and hand-edited files stay consistent with the current code style.
Made-with: Cursor1 parent d78d988 commit 7d53b31
483 files changed
Lines changed: 20567 additions & 19293 deletions
File tree
- .cursor/rules
- __tests__
- app
- (drawer)
- (tabs)
- example
- explore
- feed
- index
- payments
- (filter-flow)
- (map-flow)
- (mint-flow)
- (receive-flow)
- (send-flow)
- (settings-flow)
- (stories-flow)
- (transactions-flow)
- (user-flow)
- message
- components
- settings-pages
- assets
- icons
- images
- icons
- videos
- components
- blocks
- contacts
- payments
- popup
- sheets
- buttonHandler
- routes
- emoji-picker
- routes
- profileSwitcher
- routes
- overlays
- ui
- config
- features
- auth
- components
- screens
- camera
- hooks
- screens
- explore
- screens
- feed
- components
- nostr
- image-overlay
- hooks
- screens
- health
- components
- hooks
- lib
- screens
- map
- screens
- mint
- components
- distribution
- rebalance
- hooks
- screens
- onboarding
- components
- screens
- payments
- components
- screens
- receive
- hooks
- screens
- send
- hooks
- screens
- settings
- screens
- transactions
- components
- detail
- hooks
- screens
- user
- components/routstr
- hooks
- screens
- wallet
- components
- hooks
- lib
- screens
- helper
- popup
- hocs
- hooks
- redux
- cashu
- nostr
- settings
- store
- scripts
- stores
- targets/widget
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
36 | 62 | | |
37 | 63 | | |
38 | 64 | | |
39 | 65 | | |
40 | 66 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
51 | 84 | | |
52 | 85 | | |
53 | 86 | | |
54 | 87 | | |
55 | 88 | | |
56 | 89 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
61 | 94 | | |
62 | 95 | | |
63 | 96 | | |
| |||
66 | 99 | | |
67 | 100 | | |
68 | 101 | | |
69 | | - | |
| 102 | + | |
70 | 103 | | |
71 | | - | |
| 104 | + | |
72 | 105 | | |
73 | 106 | | |
74 | 107 | | |
| |||
100 | 133 | | |
101 | 134 | | |
102 | 135 | | |
103 | | - | |
| 136 | + | |
104 | 137 | | |
105 | 138 | | |
106 | 139 | | |
| |||
111 | 144 | | |
112 | 145 | | |
113 | 146 | | |
114 | | - | |
| 147 | + | |
115 | 148 | | |
116 | 149 | | |
117 | 150 | | |
| |||
120 | 153 | | |
121 | 154 | | |
122 | 155 | | |
123 | | - | |
| 156 | + | |
124 | 157 | | |
125 | | - | |
| 158 | + | |
126 | 159 | | |
127 | 160 | | |
128 | 161 | | |
| |||
150 | 183 | | |
151 | 184 | | |
152 | 185 | | |
153 | | - | |
| 186 | + | |
154 | 187 | | |
155 | 188 | | |
156 | 189 | | |
| |||
163 | 196 | | |
164 | 197 | | |
165 | 198 | | |
166 | | - | |
| 199 | + | |
167 | 200 | | |
168 | 201 | | |
169 | 202 | | |
| |||
201 | 234 | | |
202 | 235 | | |
203 | 236 | | |
204 | | - | |
| 237 | + | |
205 | 238 | | |
206 | 239 | | |
207 | 240 | | |
| |||
231 | 264 | | |
232 | 265 | | |
233 | 266 | | |
234 | | - | |
| 267 | + | |
235 | 268 | | |
236 | 269 | | |
237 | 270 | | |
238 | 271 | | |
239 | 272 | | |
240 | | - | |
| 273 | + | |
0 commit comments