feat(mobile): add card picker sheet with QR card switching persistence#81
Open
rohtheroos-84 wants to merge 8 commits into
Open
feat(mobile): add card picker sheet with QR card switching persistence#81rohtheroos-84 wants to merge 8 commits into
rohtheroos-84 wants to merge 8 commits into
Conversation
…haring functionality
… unmount handling
…age and improve API integration
There was a problem hiding this comment.
Pull request overview
Adds a reusable card-picker bottom sheet to the mobile app, integrates it into ScanScreen to switch the displayed QR card, and persists the last selected card across sessions. Also updates RN app bootstrap and Jest setup to support new native dependencies, plus fixes broken imports / API usage in a couple of screens so the mobile app/tests run cleanly.
Changes:
- Introduced
CardPickerSheetbottom-sheet UI and added unit tests for rendering/selection. - Updated
ScanScreento fetch cards, switch QR payload by selected card, and persist the last selection viaAsyncStorage. - Added required RN setup/deps for bottom-sheet (gesture-handler, reanimated) and adjusted Jest config/mocks to support these deps.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Locks newly added mobile dependencies (bottom sheet, async storage, gesture handler, reanimated, typings). |
| apps/mobile/src/components/CardPickerSheet.tsx | New reusable bottom-sheet card picker component. |
| apps/mobile/src/screens/ScanScreen.tsx | Fetches cards, shows share QR section, opens picker, persists selected card id. |
| apps/mobile/src/screens/ViewsScreen.tsx | Fixes imports/auth usage and switches to direct fetch with token. |
| apps/mobile/src/screens/ConnectPlatformsScreen.tsx | Fixes imports/auth usage and switches to direct fetch with token. |
| apps/mobile/package.json | Adds bottom sheet + async storage + gesture handler + reanimated deps and vector-icons types. |
| apps/mobile/jest.setup.js | Adds mocks/setup for bottom-sheet, reanimated, gesture-handler, async storage, etc. |
| apps/mobile/jest.config.js | Wires Jest setup file and adjusts transforms for RN/@gorhom modules. |
| apps/mobile/index.js | Imports react-native-gesture-handler at entry for proper initialization. |
| apps/mobile/babel.config.js | Adds react-native-reanimated/plugin required by Reanimated. |
| apps/mobile/App.tsx | Wraps app with GestureHandlerRootView + BottomSheetModalProvider. |
| apps/mobile/tests/CardPickerSheet.test.tsx | Adds tests for picker rendering, selection callback, and single-card empty state. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: rohit <rohit84.official@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a reusable bottom-sheet card picker in the mobile app and wires a Scan-screen “Switch Card” flow that updates the QR code and persists the last selected card. It also updates the mobile test setup to handle new native deps and fixes two screens with broken imports so the app/test suite runs cleanly.
Closes #34
Type of Change
What Changed
CardPickerSheetbottom sheet component and integrated it intoScanScreenwith QR switching andAsyncStoragepersistence (CardPickerSheet.tsx,ScanScreen.tsx).index.js,App.tsx,babel.config.js,package.json).CardPickerSheetand updated Jest setup/mocks to support RN ESM dependencies. Fixed broken imports and API helpers inConnectPlatformsScreen.tsxandViewsScreen.tsxto prevent runtime/test crashes (CardPickerSheet.test.tsx,jest.config.js,jest.setup.js).How to Test
pnpm --filter @devcard/mobile testVerify mobile app flow:
"Create another card in Cards tab"Checklist
pnpm -r run lintpasses).pnpm -r run typecheck).pnpm -r run test).console.logor debug statements left in the code.Screenshots
All Tests passing:
Additional Context
/devcard/{id}?card={id}to avoid requiring web/backend changes./u/{username}?card={id}support is preferred later, it can be added separately.