Skip to content

feat: Implement all Compose views#42

Open
sidorchukandrew wants to merge 15 commits intomainfrom
as/kotlin-widget-view
Open

feat: Implement all Compose views#42
sidorchukandrew wants to merge 15 commits intomainfrom
as/kotlin-widget-view

Conversation

@sidorchukandrew
Copy link
Copy Markdown
Collaborator

Description

This brings the Android side of the RN SDK up to date with the Swift SDK. There are still a few UI bugs that occur when the components load. However, those can be tackled in future work.

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation update
  • refactor: Code refactoring (no functional changes)
  • perf: Performance improvement
  • test: Test additions or updates
  • build: Build system or dependency changes
  • ci: CI configuration changes
  • chore: Other changes (maintenance, etc.)

Checklist

  • My code follows the project's code style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • All commit messages follow conventional commits format
  • I have updated the appropriate section in documentation (if needed)

@sidorchukandrew sidorchukandrew self-assigned this Apr 1, 2026
@sidorchukandrew sidorchukandrew requested a review from mic-mart April 1, 2026 01:20
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 1, 2026

Greptile Summary

This PR brings the Android Compose views up to parity with the Swift SDK — BibleReader, BibleText, BibleWidget, SignInWithYouVersionButton, and VotdView are all wired through their respective modules with correct prop mapping. Most prior review concerns have been addressed (VerseTappedEvent fields, @RequiresApi annotation, versionId fallback).

  • VotdView JS API is incomplete: onSharePress, onFullChapterPress, isCompact, and showIcon are implemented on Android but absent from VotdViewProps/NativeProps in TypeScript — share/chapter callbacks and the compact variant are unreachable from JS.
  • paragraphSpacing is silently dropped in textOptions() despite being accepted as a prop on both platforms.

Confidence Score: 4/5

Safe to merge with minor follow-up needed; VotdView JS API has functional gaps

Two P1 issues: share/full-chapter events and compact mode are unreachable from JS due to missing TypeScript props. Most prior concerns are resolved (VerseTappedEvent, @RequiresApi, versionId fallback, onTap for BibleText). Score 4 because the VotdView JS API gap is a real functional defect preventing users from subscribing to callbacks or using the compact variant.

src/components/VotdView.tsx — missing onSharePress, onFullChapterPress, isCompact, showIcon props

Important Files Changed

Filename Overview
android/src/main/java/com/youversion/reactnativesdk/views/YVPBibleReaderView.kt Implements BibleReader composable with reference construction helpers; no issues found
android/src/main/java/com/youversion/reactnativesdk/views/YVPBibleTextView.kt fontFamily still hardcoded to Serif (prior comment); paragraphSpacing silently dropped from textOptions()
android/src/main/java/com/youversion/reactnativesdk/views/YVPBibleWidgetView.kt isDark computed but not passed to BibleCard (prior comment, acknowledged); prop mapping otherwise correct
android/src/main/java/com/youversion/reactnativesdk/views/YVPSignInWithYouVersionButton.kt onTap not forwarded to SDK composable (prior comment, deferred intentionally for auth work); prop mapping correct
android/src/main/java/com/youversion/reactnativesdk/views/YVPVotdView.kt Kotlin implementation is correct; JS API gap exists in the TypeScript layer (missing callbacks, isCompact, showIcon)
android/src/main/java/com/youversion/reactnativesdk/api/YVPRecords.kt VerseTappedEvent fields fixed; BibleReferenceRecord and all other records look correct
android/src/main/java/com/youversion/reactnativesdk/RNBibleReaderViewModule.kt Simple module wrapper with no events; no issues
android/src/main/java/com/youversion/reactnativesdk/RNBibleTextViewModule.kt onTap now correctly wired via EventDispatcher to YVPBibleTextView
android/src/main/java/com/youversion/reactnativesdk/RNBibleWidgetViewModule.kt Simple module wrapper; no issues
android/src/main/java/com/youversion/reactnativesdk/RNSignInWithYouVersionButtonModule.kt onTap dispatched but not forwarded to native composable (acknowledged in prior review thread)
android/src/main/java/com/youversion/reactnativesdk/RNVotdViewModule.kt Declares onSharePress/onFullChapterPress events but these are unreachable from the JS/TypeScript layer
src/components/BibleTextView.tsx Correctly wires onTap/onPress from native event to JS callback; types look correct
src/components/BibleWidgetView.tsx Correct reference spreading and prop forwarding; no issues
src/components/VotdView.tsx Missing onSharePress, onFullChapterPress, isCompact, showIcon in VotdViewProps and NativeProps
src/types.ts urlScheme and footnotes now optional; OnBibleTextPressEvent contract looks correct cross-platform

Sequence Diagram

sequenceDiagram
    participant JS as JS (React Native)
    participant TS as VotdView.tsx
    participant RN as RNVotdViewModule
    participant Compose as YVPVotdView
    participant SDK as VerseOfTheDay SDK

    JS->>TS: render VotdView bibleVersionId=3034
    TS->>RN: NativeView (bibleVersionId, colorScheme only)
    RN->>Compose: YVPVotdView(props, onSharePress, onFullChapterPress)
    Compose->>SDK: VerseOfTheDay(onShareClick, onFullChapterClick)
    SDK-->>Compose: user taps Share button
    Compose-->>RN: onSharePress() triggers EventDispatcher
    RN--xJS: event dropped — onSharePress not in VotdViewProps/NativeProps
    Note over JS,TS: isCompact and showIcon also unreachable from JS
Loading

Reviews (6): Last reviewed commit: "chore: make urlScheme and footnotes opti..." | Re-trigger Greptile

Copy link
Copy Markdown
Collaborator

@camrun91 camrun91 left a comment

Choose a reason for hiding this comment

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

A few changes and the greptile issues look legit too.

@sidorchukandrew sidorchukandrew requested a review from camrun91 April 3, 2026 01:41
Base automatically changed from as/new-kotlin-version to main April 7, 2026 00:22
@sidorchukandrew sidorchukandrew force-pushed the as/kotlin-widget-view branch from 96ac894 to 74d74e3 Compare April 7, 2026 00:59
Copy link
Copy Markdown
Collaborator

@bmanquen bmanquen left a comment

Choose a reason for hiding this comment

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

Thank you for all of this. Nothing blocking, just a nitpick, a possible abstraction that can be made.

I only saw it in 2 or 3 places, so I am fine either way.

return BibleTextOptions(fontSize = props.fontSize.sp)
}

fun bibleReference(props: BibleWidgetViewProps): BibleReference {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should these be like a utility function abstracted away from these view files? It seems like you have used the same function multiple times.

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.

3 participants