Skip to content

Conversation

@transphorm
Copy link
Member

@transphorm transphorm commented Jan 10, 2026

Description

A brief description of the changes, what and how is being changed.

Tested

Explain how the change has been tested (for example by manual testing, unit tests etc) or why it's not necessary (for example version bump).

How to QA

How can the change be tested in a repeatable manner?

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced button state transitions with improved scroll-to-read prompts when content scrolling is required
    • Improved wallet badge positioning as a fixed element above scrollable content
  • Bug Fixes

    • Better handling of duplicate entries in proof history operations
  • Style

    • Updated loading indicator colors for visual consistency
  • Tests

    • Added test coverage for duplicate data entry scenarios

✏️ Tip: You can customize this high-level summary in your review settings.

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 10, 2026

📝 Walkthrough

Walkthrough

This PR enhances proof request verification UI by introducing scroll-state detection that feeds into button behavior, restructures badge rendering as a non-scrollable fixed element, and adds defensive handling for duplicate database insertions with improved loading indicators throughout the flow.

Changes

Cohort / File(s) Summary
UI Component Props
app/src/components/proof-request/BottomVerifyBar.tsx, app/src/components/proof-request/ProofRequestCard.tsx, packages/mobile-sdk-alpha/src/components/buttons/HeldPrimaryButtonProveScreen.tsx
Added isScrollable prop to BottomVerifyBar; added connectedWalletBadge prop to ProofRequestCard; added isScrollable prop to HeldPrimaryButtonProveScreen with expanded state transitions and refactored LoadingContent component.
Proof Request Screens
app/src/screens/verification/ProveScreen.tsx, app/src/screens/verification/DocumentSelectorForProvingScreen.tsx, app/src/screens/verification/ProvingScreenRouter.tsx
Implemented scroll detection threshold logic (contentHeight + 50 buffer); moved ConnectedWalletBadge and DisclosureItems rendering into ProofRequestCard via new props; changed ActivityIndicator color from blue600 to black; adjusted disclosure spacing.
Database Handling & Tests
app/src/stores/database.ts, app/tests/src/stores/database.test.ts, app/tests/src/stores/proofHistoryStore.test.ts
Added null-guard for insertId in INSERT OR IGNORE scenarios (returns '0' when insertId undefined); added test cases for duplicate sessionId and rowsAffected = 0 paths; updated store logic to skip updates when insertion is ignored.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

codex

Suggested reviewers

  • remicolin
  • shazarre

Poem

🎨 A badge floats free, no scroll in sight,
State machines dance with fresh delight,
Buffers catch duplicates with care,
Loading spins with flair to spare! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description contains only the template placeholders with no substantive content, leaving all required sections (Description, Tested, How to QA) empty. Fill in all three sections with concrete details: summarize the specific UI/behavior changes, explain testing approach, and provide QA reproduction steps.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title references SELF-1754 and mentions 'polish for document selection for proving flow', which aligns with the changes to DocumentSelectorForProvingScreen and related proof request components.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@transphorm transphorm changed the title Justin/self 1754 follow up verify button behavior SELF-1754: document selection for proving flow polish Jan 10, 2026
@transphorm transphorm changed the title SELF-1754: document selection for proving flow polish SELF-1754: polish for document selection for proving flow Jan 10, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/mobile-sdk-alpha/src/components/buttons/HeldPrimaryButtonProveScreen.tsx (1)

17-24: Major: verifying doesn’t exit on session change + button is enabled while verifying + new required prop is a breaking SDK API.

  • Line 166-168: verifying only transitions out when selectedAppSessionId is falsy; if it changes to a different non-null session, the machine can remain in verifying.
  • Line 221-222: keeping the button enabled in verifying risks repeated long-press interactions/telemetry (even if onLongPress is guarded).
  • Line 21-22: making isScrollable required is a breaking mobile-sdk-alpha API change.
Proposed fix (make isScrollable non-breaking + disable during verifying + reset verifying on session change)
 interface HeldPrimaryButtonProveScreenProps {
   onVerify: () => void;
   selectedAppSessionId: string | undefined | null;
   hasScrolledToBottom: boolean;
-  isScrollable: boolean;
+  isScrollable?: boolean;
   isReadyToProve: boolean;
   isDocumentExpired: boolean;
 }

 interface ButtonContext {
   selectedAppSessionId: string | undefined | null;
   hasScrolledToBottom: boolean;
   isReadyToProve: boolean;
   onVerify: () => void;
   isDocumentExpired: boolean;
+  verifyingSessionId: string | undefined | null;
 }

   context: ({ input }: { input: { onVerify: () => void } }) => ({
     selectedAppSessionId: null as string | undefined | null,
     hasScrolledToBottom: false,
     isReadyToProve: false,
     onVerify: input.onVerify,
     isDocumentExpired: false,
+    verifyingSessionId: null as string | undefined | null,
   }),

+// add a new action type
   types: {} as {
     context: ButtonContext;
     events: ButtonEvent;
-    actions: { type: 'callOnVerify' } | { type: 'updateContext' };
+    actions:
+      | { type: 'callOnVerify' }
+      | { type: 'updateContext' }
+      | { type: 'markVerifyingSession' };
   },

   ready: {
     on: {
-      VERIFY: 'verifying',
+      VERIFY: { target: 'verifying', actions: 'markVerifyingSession' },
     },
     ...
   },

   verifying: {
     entry: 'callOnVerify',
     always: {
       target: 'waitingForSession',
-      guard: ({ context }) => !context.selectedAppSessionId,
+      guard: ({ context }) =>
+        !context.selectedAppSessionId ||
+        context.selectedAppSessionId !== context.verifyingSessionId,
     },
   },

 actions: {
+  markVerifyingSession: assign(({ context }) => ({
+    verifyingSessionId: context.selectedAppSessionId,
+  })),
   updateContext: assign(({ context, event }) => {
     ...
-    return context;
+    return context;
   }),
   callOnVerify: ({ context }) => {
     context.onVerify();
   },
 },

 export const HeldPrimaryButtonProveScreen: React.FC<HeldPrimaryButtonProveScreenProps> = ({
   onVerify,
   selectedAppSessionId,
   hasScrolledToBottom,
-  isScrollable,
+  isScrollable = true,
   isReadyToProve,
   isDocumentExpired,
 }) => {

-  const isDisabled = !state.matches('ready') && !state.matches('verifying');
+  const isDisabled = !state.matches('ready');

Also applies to: 72-169, 199-274

🧹 Nitpick comments (2)
app/tests/src/stores/database.test.ts (1)

177-212: Nice regression test for duplicate sessionId; recommend switching to shared SQLite mocks + slightly stronger assertion.
Per repo learnings, DB tests should mock SQLite via tests/__setup__/databaseMocks.ts to keep behavior consistent across suites. Also, this test currently allows any parameter array—consider asserting the full bound-values list (like earlier tests) so a reordering/column mismatch can’t slip through.

Based on learnings, mock SQLite operations with executeSql utilities from tests/__setup__/databaseMocks.ts.

app/src/stores/database.ts (1)

130-135: Refactor to eliminate duplication and clarify INSERT OR IGNORE semantics using rowsAffected.

The pattern at lines 130–135, 158–163, and 187–192 appears three times identically in error handlers. The fallback '0' id is safe because proofHistoryStore.ts:120 correctly checks rowsAffected > 0 before using the id, but the current approach is semantically opaque. Consolidate into a helper function that derives id from rowsAffected > 0 && insertId != null, matching the caller's intent more clearly.

Proposed refactor

Extract a helper:

function buildInsertResult(insertResult, timestamp) {
  return {
    id:
      insertResult.rowsAffected > 0 && insertResult.insertId != null
        ? String(insertResult.insertId)
        : '0',
    timestamp,
    rowsAffected: insertResult.rowsAffected,
  };
}

Then replace all three return blocks with return buildInsertResult(insertResult, timestamp);

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e1d06b5 and fdfe334.

📒 Files selected for processing (9)
  • app/src/components/proof-request/BottomVerifyBar.tsx
  • app/src/components/proof-request/ProofRequestCard.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/stores/database.ts
  • app/tests/src/stores/database.test.ts
  • app/tests/src/stores/proofHistoryStore.test.ts
  • packages/mobile-sdk-alpha/src/components/buttons/HeldPrimaryButtonProveScreen.tsx
🧰 Additional context used
📓 Path-based instructions (30)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{js,jsx,ts,tsx}: NEVER log sensitive data including PII (names, DOB, passport numbers, addresses), credentials, tokens, API keys, private keys, or session identifiers.
ALWAYS redact/mask sensitive fields in logs using consistent patterns (e.g., ***-***-1234 for passport numbers, J*** D*** for names).

Files:

  • app/tests/src/stores/database.test.ts
  • app/src/components/proof-request/ProofRequestCard.tsx
  • app/src/components/proof-request/BottomVerifyBar.tsx
  • app/tests/src/stores/proofHistoryStore.test.ts
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • packages/mobile-sdk-alpha/src/components/buttons/HeldPrimaryButtonProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/stores/database.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx,js,jsx}: Use React Navigation with createStaticNavigation for type-safe navigation in React Native applications.
Implement platform-specific handling with Platform.OS === 'ios' ? 'iOS' : 'Android' checks before platform-specific code in React Native.
Initialize native modules with initializeNativeModules() before any native operations in React Native.
Implement lazy loading for screens using React.lazy() in React Native applications.
Implement custom modal system with useModal hook and callback registry in React Native.
Integrate haptic feedback using useHapticNavigation hook in React Native navigation.
Use platform-specific initial routes: web uses 'Home', mobile uses 'Splash' in React Navigation.
Use Zustand for global state management in React Native applications.
Use custom hooks for complex state (useModal, useHapticNavigation) instead of inline logic.
Use AsyncStorage for simple data, SQLite for complex data, and Keychain for sensitive data in React Native.
Use @/ alias for src imports and @tests/ alias for test imports in TypeScript/JavaScript files.
Use conditional rendering with Platform.OS for platform-specific code in React Native.
Use Tamagui for UI components in React Native applications.
Do not log sensitive data in production, including identity verification and passport information.
Use Keychain for secure storage of sensitive data in React Native.
Implement proper cleanup of sensitive data after use.
Implement certificate validation for passport data verification.
Always use try-catch for async operations in React Native and TypeScript code.
Implement graceful degradation when native modules fail in React Native.
Provide user-friendly error messages in UI and error handlers.
Lazy load screens and components to optimize bundle size in React Native.
Prevent memory leaks in native modules in React Native.

Files:

  • app/tests/src/stores/database.test.ts
  • app/src/components/proof-request/ProofRequestCard.tsx
  • app/src/components/proof-request/BottomVerifyBar.tsx
  • app/tests/src/stores/proofHistoryStore.test.ts
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • packages/mobile-sdk-alpha/src/components/buttons/HeldPrimaryButtonProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/stores/database.ts
**/*.test.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.test.{ts,tsx,js,jsx}: Use renderHook for testing custom React hooks instead of rendering components.
Mock console.error in tests to avoid test output clutter while testing error scenarios.
Test error boundaries and recovery mechanisms in React components.
Mock SQLite operations with executeSql method in database tests using utilities from tests/__setup__/databaseMocks.ts.

**/*.test.{ts,tsx,js,jsx}: Never use require('react-native') in test files; use ES6 import statements instead to avoid nested require() calls that cause out-of-memory errors in CI/CD pipelines
Never use require('react') in test files; use ES6 import React from 'react' instead to avoid nested require() calls that cause out-of-memory errors

Files:

  • app/tests/src/stores/database.test.ts
  • app/tests/src/stores/proofHistoryStore.test.ts
**/*.{tsx,jsx,ts,js}

📄 CodeRabbit inference engine (.cursorrules)

Implement proper cleanup in useEffect and component unmount hooks in React.

Files:

  • app/tests/src/stores/database.test.ts
  • app/src/components/proof-request/ProofRequestCard.tsx
  • app/src/components/proof-request/BottomVerifyBar.tsx
  • app/tests/src/stores/proofHistoryStore.test.ts
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • packages/mobile-sdk-alpha/src/components/buttons/HeldPrimaryButtonProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/stores/database.ts
**/{mobile,client,app,time,verification}/**/*.{ts,tsx,js,swift,kt}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Use server-signed time tokens or chain block timestamps for trusted time in mobile clients, do not trust device wall-clock alone

Files:

  • app/tests/src/stores/database.test.ts
  • app/src/components/proof-request/ProofRequestCard.tsx
  • app/src/components/proof-request/BottomVerifyBar.tsx
  • app/tests/src/stores/proofHistoryStore.test.ts
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/stores/database.ts
**/{mobile,client,app,proof,zk}/**/*.{ts,tsx,js,swift,kt}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

**/{mobile,client,app,proof,zk}/**/*.{ts,tsx,js,swift,kt}: Include trusted time anchor in proof generation and verify time anchor authenticity before proof generation in mobile implementations
Achieve proof generation in <60 seconds on mid-tier mobile devices

Files:

  • app/tests/src/stores/database.test.ts
  • app/src/components/proof-request/ProofRequestCard.tsx
  • app/src/components/proof-request/BottomVerifyBar.tsx
  • app/tests/src/stores/proofHistoryStore.test.ts
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/stores/database.ts
{app,packages/mobile-sdk-alpha}/**/*.{test,spec}.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Never create nested require('react-native') calls in tests as this causes out-of-memory errors in CI/CD pipelines; use ES6 import statements instead and avoid dynamic require() calls in beforeEach/afterEach hooks

Files:

  • app/tests/src/stores/database.test.ts
  • app/tests/src/stores/proofHistoryStore.test.ts
app/**/*.{ts,tsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

Ensure yarn types passes (TypeScript validation) before creating a PR

Files:

  • app/tests/src/stores/database.test.ts
  • app/src/components/proof-request/ProofRequestCard.tsx
  • app/src/components/proof-request/BottomVerifyBar.tsx
  • app/tests/src/stores/proofHistoryStore.test.ts
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/stores/database.ts
app/**/*.test.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

app/**/*.test.{ts,tsx,js,jsx}: Ensure yarn test passes (unit tests) before creating a PR
Avoid nested require('react') or require('react-native') calls in test files - use ES6 import statements instead
Put all imports at the top of test files - avoid dynamic imports in hooks
Never use require() calls in beforeEach/afterEach hooks in test files
Verify no memory leaks introduced, including test memory patterns
Use ES6 import statements exclusively - never use require('react') or require('react-native') in test files

Files:

  • app/tests/src/stores/database.test.ts
  • app/tests/src/stores/proofHistoryStore.test.ts
app/tests/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

Do not create nested require('react-native') calls in tests - causes OOM in CI

Files:

  • app/tests/src/stores/database.test.ts
  • app/tests/src/stores/proofHistoryStore.test.ts
app/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

app/**/*.{ts,tsx,js,jsx}: Ensure web build succeeds with yarn web before creating a PR
Do not include sensitive data in logs - avoid logging PII, credentials, and tokens
Use react-native-dotenv for environment configuration via @env import
Confirm no sensitive data exposed before PR merge

Files:

  • app/tests/src/stores/database.test.ts
  • app/src/components/proof-request/ProofRequestCard.tsx
  • app/src/components/proof-request/BottomVerifyBar.tsx
  • app/tests/src/stores/proofHistoryStore.test.ts
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/stores/database.ts
**/*.{test,spec}.{ts,js,tsx,jsx}

⚙️ CodeRabbit configuration file

**/*.{test,spec}.{ts,js,tsx,jsx}: Review test files for:

  • Test coverage completeness
  • Test case quality and edge cases
  • Mock usage appropriateness
  • Test readability and maintainability

Files:

  • app/tests/src/stores/database.test.ts
  • app/tests/src/stores/proofHistoryStore.test.ts
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursorrules)

Implement comprehensive error boundaries in React components.

Files:

  • app/src/components/proof-request/ProofRequestCard.tsx
  • app/src/components/proof-request/BottomVerifyBar.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • packages/mobile-sdk-alpha/src/components/buttons/HeldPrimaryButtonProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/ProveScreen.tsx
app/src/**/*.{ts,tsx,js,jsx}

⚙️ CodeRabbit configuration file

app/src/**/*.{ts,tsx,js,jsx}: Review React Native TypeScript code for:

  • Component architecture and reusability
  • State management patterns
  • Performance optimizations
  • TypeScript type safety
  • React hooks usage and dependencies
  • Navigation patterns

Files:

  • app/src/components/proof-request/ProofRequestCard.tsx
  • app/src/components/proof-request/BottomVerifyBar.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/stores/database.ts
**/{compliance,ofac,verification,identity}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

**/{compliance,ofac,verification,identity}/**/*.{ts,tsx,js,py}: Implement three-tier OFAC verification system: Passport Number Check (direct passport validation), Name + DOB Check (full name with exact date of birth), and Name + Year Check (name with year of birth, defaulting to Jan-01)
Apply Jaro–Winkler fuzzy matching algorithm with ≥0.92 threshold for OFAC name verification
Validate passport numbers by removing whitespace/punctuation and performing country-specific format validation
Protect all PII by committing via domain-separated hashes using Poseidon hash function with 'ofac-v1' domain separator
Implement per-issuer salt for additional privacy in OFAC hash commitments, with unique salt per issuing country

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{compliance,ofac,verification,identity,utils}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Normalize names using case-folding, Unicode NFKC normalization, and diacritics removal for OFAC matching

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{compliance,ofac,verification,identity,age}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Use ISO 8601 format (YYYY-MM-DD) for all date inputs in compliance verification

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{age,verification,identity,compliance}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Implement age verification with day-level precision for 'olderThan' checks accepting ISO 8601 date inputs

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{circuits,age,verification,zk,proof}/**/*.{circom,ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Implement zero-knowledge proof of age without disclosing actual date of birth

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{compliance,country,verification,identity}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

**/{compliance,country,verification,identity}/**/*.{ts,tsx,js,py}: Implement forbidden country validation using Bloom filter with false positive rate ≤1e-6
Validate country codes in ISO 3166-1 alpha-3 format for forbidden country checks

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{circuits,country,verification,zk,proof}/**/*.{circom,ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Implement zero-knowledge proof of country non-inclusion without revealing actual country code

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{compliance,country,verification}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Implement graceful degradation for country validation when filter is unavailable

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{compliance,verification,identity,age,country}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

**/{compliance,verification,identity,age,country}/**/*.{ts,tsx,js,py}: Use UTC timestamps only for all compliance verification operations
Allow ±5 minutes clock drift tolerance in timestamp validation for compliance checks

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{compliance,verification,proof}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Enforce 24-hour verification window with drift adjustment for compliance proof validity

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{compliance,verification,proof,zk,identity,age,country}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Maintain peak memory usage below 300MB for compliance verification operations

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{compliance,verification,service,api}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

**/{compliance,verification,service,api}/**/*.{ts,tsx,js,py}: Make all network calls idempotent with exponential backoff retry logic
Implement exponential backoff with jitter for compliance verification retry logic

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{compliance,audit,log,verification}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Maintain privacy-preserving audit logs for compliance verification operations

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/ProveScreen.tsx
packages/mobile-sdk-alpha/**/*.{ts,tsx}

📄 CodeRabbit inference engine (packages/mobile-sdk-alpha/AGENTS.md)

packages/mobile-sdk-alpha/**/*.{ts,tsx}: Check types across the codebase by running yarn types
Run yarn types or yarn typecheck to check TypeScript types across the codebase
Run yarn build to build the package for distribution
Before committing changes, ensure TypeScript types are valid by running yarn types
Before committing changes, ensure the build succeeds by running yarn build
Before creating a PR, ensure yarn types passes (TypeScript validation)
Before creating a PR, ensure yarn build succeeds (package builds correctly)
Ensure no breaking changes to public API or document them properly
Verify cross-platform compatibility for both React Native and Web environments
This package uses TypeScript with strict type checking
Use ESLint with TypeScript-specific rules
Use platform detection Platform.OS === 'web' when adding platform-specific code
Maintain type definitions that are complete and accurate

Files:

  • packages/mobile-sdk-alpha/src/components/buttons/HeldPrimaryButtonProveScreen.tsx
packages/mobile-sdk-alpha/**/*.{js,ts,tsx,jsx}

📄 CodeRabbit inference engine (packages/mobile-sdk-alpha/AGENTS.md)

Run yarn lint to check for linting issues or yarn lint:fix to automatically fix them

Files:

  • packages/mobile-sdk-alpha/src/components/buttons/HeldPrimaryButtonProveScreen.tsx
packages/mobile-sdk-alpha/**/*.{ts,tsx,js,jsx}

⚙️ CodeRabbit configuration file

packages/mobile-sdk-alpha/**/*.{ts,tsx,js,jsx}: Review alpha mobile SDK code for:

  • API consistency with core SDK
  • Platform-neutral abstractions
  • Performance considerations
  • Clear experimental notes or TODOs

Files:

  • packages/mobile-sdk-alpha/src/components/buttons/HeldPrimaryButtonProveScreen.tsx
🧠 Learnings (11)
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Mock SQLite operations with `executeSql` method in database tests using utilities from `tests/__setup__/databaseMocks.ts`.

Applied to files:

  • app/tests/src/stores/database.test.ts
📚 Learning: 2025-12-13T18:00:46.963Z
Learnt from: seshanthS
Repo: selfxyz/self PR: 1497
File: app/src/screens/verification/ProveScreen.tsx:125-161
Timestamp: 2025-12-13T18:00:46.963Z
Learning: In app/src/screens/verification/ProveScreen.tsx: The document expiration check using checkDocumentExpiration() is UX-only to prevent wasted gas and provide better user experience. The authoritative expiration validation is enforced in the circuits and smart contracts using trusted time sources (block timestamps), not device clock.

Applied to files:

  • app/src/components/proof-request/BottomVerifyBar.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • packages/mobile-sdk-alpha/src/components/buttons/HeldPrimaryButtonProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:07:28.188Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/compliance-verification.mdc:0-0
Timestamp: 2025-11-25T14:07:28.188Z
Learning: Applies to **/{mobile,client,app,proof,zk}/**/*.{ts,tsx,js,swift,kt} : Include trusted time anchor in proof generation and verify time anchor authenticity before proof generation in mobile implementations

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-10-23T12:08:55.529Z
Learnt from: shazarre
Repo: selfxyz/self PR: 1236
File: packages/mobile-sdk-alpha/src/flows/onboarding/document-nfc-screen.tsx:356-378
Timestamp: 2025-10-23T12:08:55.529Z
Learning: In packages/mobile-sdk-alpha/src/flows/onboarding/document-nfc-screen.tsx, the NFC native events emitted via NativeEventEmitter are generic status strings (e.g., "PACE succeeded", "BAC failed", "Reading DG1 succeeded") and do not contain sensitive MRZ data or passport numbers, so they do not require sanitization before logging.

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Test `isPassportDataValid()` with realistic, synthetic passport data (never use real user data)

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Verify `extractMRZInfo()` using published sample MRZ strings (e.g., ICAO examples)

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
📚 Learning: 2025-11-18T12:17:14.819Z
Learnt from: seshanthS
Repo: selfxyz/self PR: 1337
File: packages/mobile-sdk-alpha/src/processing/mrz.ts:189-194
Timestamp: 2025-11-18T12:17:14.819Z
Learning: In packages/mobile-sdk-alpha/src/processing/mrz.ts, the checkScannedInfo function and related TD1 extraction/validation logic are only reached on Android. iOS uses native Swift parsing (LiveMRZScannerView.swift) that bypasses this TypeScript layer.

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
📚 Learning: 2025-08-26T14:49:11.190Z
Learnt from: shazarre
Repo: selfxyz/self PR: 936
File: app/src/screens/passport/PassportNFCScanScreen.tsx:28-31
Timestamp: 2025-08-26T14:49:11.190Z
Learning: SelfClientProvider is wrapped in app/App.tsx, providing context for useSelfClient() hook usage throughout the React Native app navigation stacks.

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/index.{ts,tsx} : Run `yarn validate:exports` to verify that exports are properly configured

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Ensure no breaking changes to public API or document them properly

Applied to files:

  • packages/mobile-sdk-alpha/src/components/buttons/HeldPrimaryButtonProveScreen.tsx
📚 Learning: 2025-11-25T14:07:28.188Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/compliance-verification.mdc:0-0
Timestamp: 2025-11-25T14:07:28.188Z
Learning: Applies to **/{mobile,client,app,proof,zk}/**/*.{ts,tsx,js,swift,kt} : Achieve proof generation in <60 seconds on mid-tier mobile devices

Applied to files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
🧬 Code graph analysis (5)
app/tests/src/stores/database.test.ts (2)
app/src/stores/database.ts (1)
  • database (24-212)
app/src/stores/database.web.ts (1)
  • database (254-254)
app/src/components/proof-request/ProofRequestCard.tsx (3)
app/tests/__setup__/mocks/ui.js (3)
  • View (60-60)
  • View (95-95)
  • ScrollView (96-96)
app/src/components/proof-request/designTokens.ts (1)
  • proofRequestSpacing (34-40)
app/src/components/proof-request/index.ts (1)
  • proofRequestSpacing (67-67)
app/src/screens/verification/DocumentSelectorForProvingScreen.tsx (2)
packages/mobile-sdk-alpha/src/constants/colors.ts (1)
  • black (8-8)
app/src/components/proof-request/ConnectedWalletBadge.tsx (2)
  • ConnectedWalletBadge (25-88)
  • truncateAddress (94-103)
app/src/screens/verification/ProvingScreenRouter.tsx (3)
packages/mobile-sdk-demo/tests/mocks/react-native.ts (1)
  • ActivityIndicator (5-5)
packages/mobile-sdk-alpha/src/constants/colors.ts (1)
  • black (8-8)
packages/mobile-sdk-alpha/src/constants/index.ts (1)
  • black (24-24)
app/src/screens/verification/ProveScreen.tsx (2)
app/src/components/proof-request/ConnectedWalletBadge.tsx (2)
  • ConnectedWalletBadge (25-88)
  • truncateAddress (94-103)
app/src/components/proof-request/index.ts (2)
  • ConnectedWalletBadge (45-45)
  • truncateAddress (46-46)
⏰ Context from checks skipped due to timeout of 300000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: e2e-ios
🔇 Additional comments (6)
app/src/screens/verification/ProvingScreenRouter.tsx (1)

15-15: LGTM! Clean color update for loading indicator.

The ActivityIndicator color change from the previous blue to black is consistent with the PR's UI polish objectives and maintains good contrast on the white background.

Also applies to: 198-198

app/tests/src/stores/proofHistoryStore.test.ts (1)

160-187: Solid coverage for the “ignored insert” path (rowsAffected = 0).
This matches the store behavior (only prepend when rowsAffected > 0) and protects against accidental regressions where duplicates get added to in-memory state.

app/src/components/proof-request/ProofRequestCard.tsx (1)

28-42: Good separation of fixed badge vs scrollable content; please QA scroll/bottom detection with the new padding wrapper.
This layout change can subtly affect onLayout / onContentSizeChange measurements feeding scroll-state logic, so it’s worth validating on small screens and dynamic type.

Also applies to: 49-63, 119-156

app/src/screens/verification/DocumentSelectorForProvingScreen.tsx (1)

33-34: Looks consistent with the new connectedWalletBadge layout and updated loading color.

Also applies to: 344-345, 416-450

app/src/screens/verification/ProveScreen.tsx (1)

95-104: Scroll-state propagation looks coherent (single +50 tolerance), but please QA edge cases around “barely scrollable” content.
In particular: small screens + large font sizes where contentHeight fluctuates around scrollViewHeight + 50, and rotation (layout re-measure).

Also applies to: 256-287, 289-316, 318-369

app/src/components/proof-request/BottomVerifyBar.tsx (1)

13-21: All BottomVerifyBar call sites properly pass isScrollable prop.

Verified one usage in ProveScreen.tsx:360 includes the required prop. TypeScript enforcement on the interface ensures no missing implementations.

@transphorm transphorm merged commit 3ce1f26 into dev Jan 10, 2026
32 checks passed
@transphorm transphorm deleted the justin/self-1754-follow-up-verify-button-behavior branch January 10, 2026 07:52
jcortejoso pushed a commit that referenced this pull request Jan 15, 2026
* change spinner color

* fix disclosure scroll feedback

* fix type error

* fix button scrolling logic

* make the connected wallet static

* fix hold to verify button feedback timing

* formatting

* clean up tex
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