feat(client): native clipboard via expo-clipboard (#218) #247
No reviewers
Labels
No labels
area:auth
area:ci
area:db
area:infra
area:native
area:pwa
area:service
epic
feature
foundation
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
james/carol!247
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "218-native-clipboard"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Closes #218.
Adds a write-only platform shim for the clipboard so the PAT "Copy" button on
/accountworks on native, not just on the PWA. Inlinenavigator.clipboardwas wrapped in a Platform-check that no-op'd on Android.Shim shape
apps/client/lib/clipboard.ts:navigator.clipboard.writeText.expo-clipboard'ssetStringAsync— bridges toClipboardManager.setPrimaryClipon Android (no manifest permission required, confirmed in upstream docs) andUIPasteboardon iOS.Call sites swept
apps/client/app/(app)/account.tsx— theRevealBanner"Copy" button on the PAT plaintext reveal. The plaintext stays on screen as a manual-copy fallback in casewriteText/setStringAsyncrejects.grep -rn "navigator.clipboard"onapps/client/is otherwise clean.Dep
expo-clipboard@~56.0.4— matches the Expo SDK 56 line (latest dist-tag for the SDK-56 branch).Test plan
pnpm install --frozen-lockfilepnpm -F @carol/client typecheck/lint/test/export:webpnpm -F @carol/api typecheck/lint/testpnpm -F @carol/api-client typecheck/lint/test/checktests/clipboard.test.tsexercises both branches via mocks (expo-clipboardmocked on native;navigator.clipboardredefined viaObject.definePropertyon web).Platform.OS === "web"branch still callsnavigator.clipboard.writeText, and the export still bundles clean.expo-clipboarddoesn't add a permission).Acceptance
📊 Test coverage
Patch coverage: no testable lines changed.
Overall (
app/,lib/,db/, excluding UI per ADR-0019):Soft thresholds per ADR-0019. Coverage is informational and does not block merge.
771cd7d68b55fc1fc583