Skip to content

Conversation

@transphorm
Copy link
Member

@transphorm transphorm commented Oct 11, 2025

Summary by CodeRabbit

  • Documentation

    • Expanded installation and migration guides, added peer-dependency install instructions, clarified asset linking and iOS setup, plus SDK initialization, events examples, and style customization guidance.
  • Style

    • Updated typography colors for improved readability and consistency across BodyText, Caption, and Title.
  • Refactor

    • Improved long-press button animation stability and optimized typography rendering for more predictable styling.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 11, 2025

Walkthrough

Documentation expanded with installation, linking, migration, initialization, styling, and SDK events guidance. Typography components updated to apply new colors and use flattened styles. A web-only button now perserves animation state via a ref to Animated.Value. No public API signatures changed.

Changes

Cohort / File(s) Summary
Documentation updates
packages/mobile-sdk-alpha/README.md
Adds peer-dependency install steps (react-native-svg), clarifies autolinking vs. asset linking (including react-native.config.js and npx/yarn dlx instructions), manual Android linking flow, SDK initialization/adapters, migration from Tamagui, style customization guidance, SDK events examples, and updated usage snippets.
Animation state persistence (web button)
packages/mobile-sdk-alpha/src/components/buttons/PrimaryButtonLongHold.web.tsx
Replaces direct new Animated.Value(0) usage with useRef(new Animated.Value(0)) to persist animation value across renders; imports updated to include useRef.
Typography style flattening & colors
packages/mobile-sdk-alpha/src/components/typography/BodyText.tsx, packages/mobile-sdk-alpha/src/components/typography/Caption.tsx, packages/mobile-sdk-alpha/src/components/typography/Title.tsx
Adds/uses color tokens (slate500, slate400, black), introduces StyleSheet.flatten/useMemo to compute flattened styles for Caption and Title, and applies explicit color to BodyText. Component APIs unchanged.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant App
  participant SDK
  participant ScannerAdapter
  participant NetworkAdapter
  participant CryptoAdapter
  participant Storage(No-op)
  participant Logger(No-op)

  App->>SDK: initialize({ scanner, network, crypto, storage?, clock?, logger? })
  activate SDK
  SDK->>ScannerAdapter: configure
  SDK->>NetworkAdapter: configure
  SDK->>CryptoAdapter: configure
  Note over SDK,Storage: Defaults to no-op storage/clock/logger if omitted
  SDK-->>App: ready()
  deactivate SDK
Loading
sequenceDiagram
  autonumber
  participant AppUI
  participant SDK
  participant EventBus

  AppUI->>SDK: user selects document
  SDK->>EventBus: emit(DocumentSelected, payload)
  AppUI-->>AppUI: update UI

  AppUI->>SDK: start verification flow
  SDK->>EventBus: emit(VerificationStarted)
  SDK->>EventBus: emit(VerificationProgress|Error|Completed)
  AppUI-->>AppUI: respond to events
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

codex

Suggested reviewers

  • RamsesAupart

Poem

Slate and black on pages new,
A button keeps its steady hue.
Docs unfold migration charts,
Events and adapters play their parts.
Small refactors—steady crew.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title precisely captures the core change of updating default text colors in the migrated components and is neither vague nor misleading.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch justin/bugfix-caption-component-bug-fixes

📜 Recent 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 cbbcf8b and 8c74892.

📒 Files selected for processing (2)
  • packages/mobile-sdk-alpha/src/components/typography/Caption.tsx (2 hunks)
  • packages/mobile-sdk-alpha/src/components/typography/Title.tsx (3 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
packages/mobile-sdk-alpha/**/*.{ts,tsx}

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

packages/mobile-sdk-alpha/**/*.{ts,tsx}: Use strict TypeScript type checking across the codebase
Follow ESLint TypeScript-specific rules
Avoid introducing circular dependencies

Files:

  • packages/mobile-sdk-alpha/src/components/typography/Caption.tsx
  • packages/mobile-sdk-alpha/src/components/typography/Title.tsx
**/*.{js,ts,tsx,jsx,sol,nr}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{js,ts,tsx,jsx,sol,nr}: 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:

  • packages/mobile-sdk-alpha/src/components/typography/Caption.tsx
  • packages/mobile-sdk-alpha/src/components/typography/Title.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/typography/Caption.tsx
  • packages/mobile-sdk-alpha/src/components/typography/Title.tsx
🧬 Code graph analysis (2)
packages/mobile-sdk-alpha/src/components/typography/Caption.tsx (3)
packages/mobile-sdk-demo/tests/mocks/react-native.ts (1)
  • StyleSheet (27-29)
packages/mobile-sdk-alpha/src/constants/colors.ts (1)
  • slate400 (39-39)
packages/mobile-sdk-alpha/src/components/typography/BodyText.tsx (1)
  • BodyText (12-14)
packages/mobile-sdk-alpha/src/components/typography/Title.tsx (2)
packages/mobile-sdk-alpha/src/constants/colors.ts (1)
  • black (8-8)
packages/mobile-sdk-demo/tests/mocks/react-native.ts (2)
  • StyleSheet (27-29)
  • Text (31-31)
⏰ 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). (6)
  • GitHub Check: build-deps
  • GitHub Check: android-build-test
  • GitHub Check: e2e-ios
  • GitHub Check: analyze-android
  • GitHub Check: analyze-ios
  • GitHub Check: ios-e2e
🔇 Additional comments (2)
packages/mobile-sdk-alpha/src/components/typography/Title.tsx (1)

6-10: LGTM! Memoization correctly implemented.

The flattened style is now properly memoized with the correct dependencies [size, style]. The implementation correctly avoids recomputation on every render while still responding to prop changes. The addition of color: black aligns with the PR objective to update default text colors for migrated components.

Note: The dependency array [size, style] is correct here — including baseStyle or largeStyle would be counterproductive since they're inline objects that would trigger recomputation on every render despite containing only constant values.

Also applies to: 23-23, 34-35, 37-37

packages/mobile-sdk-alpha/src/components/typography/Caption.tsx (1)

6-7: LGTM! Memoization correctly implemented.

The flattened style is now properly memoized with the correct dependencies [fontSize, style]. This prevents unnecessary style recomputation on every render while ensuring updates when props change. The implementation follows the same pattern as Title.tsx and properly addresses the past review feedback.

Also applies to: 18-18, 20-20


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.

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: 2

📜 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 8fc3191 and cbbcf8b.

📒 Files selected for processing (5)
  • packages/mobile-sdk-alpha/README.md (3 hunks)
  • packages/mobile-sdk-alpha/src/components/buttons/PrimaryButtonLongHold.web.tsx (2 hunks)
  • packages/mobile-sdk-alpha/src/components/typography/BodyText.tsx (1 hunks)
  • packages/mobile-sdk-alpha/src/components/typography/Caption.tsx (2 hunks)
  • packages/mobile-sdk-alpha/src/components/typography/Title.tsx (3 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
packages/mobile-sdk-alpha/**/*.{ts,tsx}

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

packages/mobile-sdk-alpha/**/*.{ts,tsx}: Use strict TypeScript type checking across the codebase
Follow ESLint TypeScript-specific rules
Avoid introducing circular dependencies

Files:

  • packages/mobile-sdk-alpha/src/components/buttons/PrimaryButtonLongHold.web.tsx
  • packages/mobile-sdk-alpha/src/components/typography/Caption.tsx
  • packages/mobile-sdk-alpha/src/components/typography/Title.tsx
  • packages/mobile-sdk-alpha/src/components/typography/BodyText.tsx
**/*.{js,ts,tsx,jsx,sol,nr}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{js,ts,tsx,jsx,sol,nr}: 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:

  • packages/mobile-sdk-alpha/src/components/buttons/PrimaryButtonLongHold.web.tsx
  • packages/mobile-sdk-alpha/src/components/typography/Caption.tsx
  • packages/mobile-sdk-alpha/src/components/typography/Title.tsx
  • packages/mobile-sdk-alpha/src/components/typography/BodyText.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/PrimaryButtonLongHold.web.tsx
  • packages/mobile-sdk-alpha/src/components/typography/Caption.tsx
  • packages/mobile-sdk-alpha/src/components/typography/Title.tsx
  • packages/mobile-sdk-alpha/src/components/typography/BodyText.tsx
packages/mobile-sdk-alpha/README.md

📄 CodeRabbit inference engine (.cursor/rules/mobile-sdk-migration.mdc)

Document new/updated SDK modules and usage in packages/mobile-sdk-alpha/README.md

Files:

  • packages/mobile-sdk-alpha/README.md
🧠 Learnings (1)
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to packages/mobile-sdk-alpha/README.md : Document new/updated SDK modules and usage in packages/mobile-sdk-alpha/README.md

Applied to files:

  • packages/mobile-sdk-alpha/README.md
🧬 Code graph analysis (3)
packages/mobile-sdk-alpha/src/components/typography/Caption.tsx (3)
packages/mobile-sdk-demo/tests/mocks/react-native.ts (1)
  • StyleSheet (27-29)
packages/mobile-sdk-alpha/src/constants/colors.ts (1)
  • slate400 (39-39)
packages/mobile-sdk-alpha/src/components/typography/BodyText.tsx (1)
  • BodyText (12-14)
packages/mobile-sdk-alpha/src/components/typography/Title.tsx (2)
packages/mobile-sdk-alpha/src/constants/colors.ts (1)
  • black (8-8)
packages/mobile-sdk-demo/tests/mocks/react-native.ts (2)
  • StyleSheet (27-29)
  • Text (31-31)
packages/mobile-sdk-alpha/src/components/typography/BodyText.tsx (2)
packages/mobile-sdk-alpha/src/utils/fonts.ts (1)
  • dinot (8-8)
packages/mobile-sdk-alpha/src/constants/colors.ts (1)
  • slate500 (43-43)
🪛 markdownlint-cli2 (0.18.1)
packages/mobile-sdk-alpha/README.md

137-137: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


143-143: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


149-149: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)

⏰ 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). (7)
  • GitHub Check: build-deps
  • GitHub Check: analyze-android
  • GitHub Check: analyze-ios
  • GitHub Check: e2e-ios
  • GitHub Check: android-build-test
  • GitHub Check: android-e2e
  • GitHub Check: ios-e2e
🔇 Additional comments (7)
packages/mobile-sdk-alpha/src/components/buttons/PrimaryButtonLongHold.web.tsx (1)

5-5: LGTM! Proper fix for Animated.Value persistence.

Using useRef to persist the Animated.Value across renders is the correct pattern. This prevents the value from being recreated on every render, which would break the animation state and cause performance issues.

The implementation is clean:

  • The ref is initialized once with new Animated.Value(0)
  • The current value is extracted for convenient access
  • It's used consistently throughout the component

Also applies to: 17-18

packages/mobile-sdk-alpha/src/components/typography/BodyText.tsx (2)

9-9: LGTM! Default color addition aligns with bugfix objective.

The addition of slate500 as the default text color is appropriate for this base typography component. The style merging order correctly allows user-provided styles to override the default color.

Note: BodyText retains inline array style merging while Title and Caption use StyleSheet.flatten. This difference is acceptable since BodyText is a primitive component with minimal style logic.

Also applies to: 13-13


9-9: LGTM! Default color applied correctly.

The addition of the slate500 color constant provides a consistent default text color for the BodyText component, aligning with the PR objective to update migrated component colors.

Also applies to: 13-13

packages/mobile-sdk-alpha/src/components/typography/Title.tsx (3)

22-22: Default color addition looks good.

Adding black as the default text color for Title components is appropriate and aligns with the PR's bugfix objective.


7-7: LGTM! Default color and style imports added correctly.

The addition of StyleSheet and black color imports, along with the explicit color: black in the base style, ensures consistent default styling for Title components.

Also applies to: 9-9, 22-22


33-34: LGTM! Style flattening applied correctly.

The use of StyleSheet.flatten consolidates the style array into a single style object, which aligns with the PR's approach to centralized style merging across typography components.

Also applies to: 36-36

packages/mobile-sdk-alpha/src/components/typography/Caption.tsx (1)

6-6: LGTM! Style flattening and color override implemented correctly.

The use of StyleSheet.flatten with slate400 color ensures Caption properly overrides the default slate500 color from the underlying BodyText component, providing the correct visual hierarchy for caption text.

Also applies to: 17-17, 19-19

@transphorm transphorm merged commit 38e2bea into dev Oct 11, 2025
29 checks passed
@transphorm transphorm deleted the justin/bugfix-caption-component-bug-fixes branch October 11, 2025 19:20
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