Skip to content

chore(mobile): shared primitives for contact flows#372

Merged
yasin-ce merged 7 commits intomainfrom
contacts/02-primitives
Apr 25, 2026
Merged

chore(mobile): shared primitives for contact flows#372
yasin-ce merged 7 commits intomainfrom
contacts/02-primitives

Conversation

@yasin-ce
Copy link
Copy Markdown
Collaborator

@yasin-ce yasin-ce commented Apr 24, 2026

Description

Foundational building blocks shared by every downstream contacts screen, plus collateral fixes that rode along:

  • New `ConfirmActionBottomSheet` generic confirm dialog (with spec).
  • New `useImagePicker` hook wrapping `expo-image-picker` with EXIF stripped and a settings-redirect flow for denied permissions (with spec).
  • `QRScannerView` crash fix + permission-denied padding.
  • New icons (`contacts`, `pen-solid`) registered on PWIcon; `SHORT_ADDRESS_FORMAT` constant added to `@constants/ui`.
  • `expo-image-picker` dep + `app.config.js` photo permission plugin.

Related Issues

No ticket — shared primitives commit. Enables PERA-3930, PERA-3931, PERA-3932, PERA-4122.

Checklist

  • Have you tested your changes locally?
  • Have you reviewed the code for any potential issues?
  • Have you documented any necessary changes in the project's documentation?
  • Have you added any necessary tests for your changes?
  • Have you updated any relevant dependencies?

Additional Notes

Stacked on #371. No screen-level changes in this PR — only the reusable pieces.

- saveContact: insert-only → upsert (functional set).
- Schema: id and image optional so edits round-trip the id.
- deleteContact: simplified; setContacts removed (unused).
- ConfirmActionBottomSheet: generic confirmation sheet.
- useImagePicker: gallery picker with permission UX; strips EXIF.
- QRScannerView: pad empty state; re-enable scanner after unrecognized
  codes; guard requestPermission against unmount.
- PWIcon: register contacts + pen-solid; drop white fill on moon.
- Add SHORT_ADDRESS_FORMAT (9) to @constants/ui.
- iOS: photo-library permission + expo-image-picker plugin.
- Add expo-image-picker dep.
@yasin-ce yasin-ce requested review from fmsouza and wjbeau and removed request for wjbeau April 24, 2026 02:57
@yasin-ce yasin-ce self-assigned this Apr 24, 2026
@yasin-ce yasin-ce marked this pull request as ready for review April 24, 2026 03:04
Comment thread apps/mobile/src/components/ConfirmActionBottomSheet/styles.ts Outdated
Comment thread apps/mobile/src/hooks/useImagePicker.ts Outdated
… review

Instead of the UI hooks calling findContacts to guard against duplicate
addresses, saveContact now enforces uniqueness at the store layer and
throws DuplicateAddressError on conflict. Downstream hooks catch and
surface to form state.

Addresses PR #373 review comment to keep business rules in the package,
not the UI layer.
…er review

Replace the Alert.alert call in useImagePicker with a ConfirmActionBottomSheet,
consistent with the rest of the codebase which doesn't use Alert. Extract
PhotoPermissionDeniedSheet as a reusable component wrapping
ConfirmActionBottomSheet with the photo-specific i18n copy. The hook now
returns a permissionDenied state object (isVisible, close, openSettings)
that callers pair with <PhotoPermissionDeniedSheet /> at the screen root.

Also drops custom fontSize/lineHeight from ConfirmActionBottomSheet/styles.ts
in favor of the PWText body variant at the callsite.
Base automatically changed from contacts/01-fix-edit-duplicate to main April 25, 2026 00:13
@yasin-ce yasin-ce merged commit 32a3fae into main Apr 25, 2026
5 of 6 checks passed
@yasin-ce yasin-ce deleted the contacts/02-primitives branch April 25, 2026 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants