Skip to content

fix: align codegen contract across native and JS (audit PR 4/6)#123

Merged
sbaiahmed1 merged 1 commit into
mainfrom
fix/pr4-codegen-contract
Jul 16, 2026
Merged

fix: align codegen contract across native and JS (audit PR 4/6)#123
sbaiahmed1 merged 1 commit into
mainfrom
fix/pr4-codegen-contract

Conversation

@sbaiahmed1

@sbaiahmed1 sbaiahmed1 commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Part 4 of 6 in the July 2026 audit remediation. Stacked on fix/ios-pr3-lifecycle.

Codegen contract alignment across native and JS.

  • AND-03 BlurSwitchManager adopts the generated codegen delegate (props flow through codegen like the other two managers).
  • AND-04 unify the blurAmount→radius mapping. Per maintainer decision the two blur views keep their current 1:1 strength and BlurSwitch is brought up to match (no rendering change for the blur views); misleading "0-25" comments removed.
  • AND-05 native blurRounds default set to 5 (single source of truth).
  • TS-03 ignoreSafeArea JSDoc/default fixes; TS-07 spacing WithDefault + missing default exports; IOS-NEW-4 progressive init compares the correct default.

Deferred by decision: TS-NEW-1 (ColorValue-typed colour props).

Verified: Android + iOS build; tsc clean; the switch renders + toggles through the new delegate.

Summary by CodeRabbit

  • New Features

    • Increased maximum blur intensity for Android blur switches.
    • Added default imports for LiquidGlassContainer and VibrancyView.
    • Added a default spacing value of 0 for liquid glass containers.
  • Bug Fixes

    • Improved blur behavior and default blur-round consistency across platforms.
    • Corrected iOS initial blur-type handling.
    • Updated inaccurate safe-area documentation and prop defaults.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5be77995-1a8c-42ef-854b-071d8d1ea353

📥 Commits

Reviewing files that changed from the base of the PR and between 7185545 and 8e56b17.

📒 Files selected for processing (10)
  • android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeBlurSwitch.kt
  • android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeBlurSwitchManager.kt
  • android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeBlurView.kt
  • android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeProgressiveBlurView.kt
  • ios/ReactNativeProgressiveBlurView.mm
  • src/BlurView.tsx
  • src/LiquidGlassContainer.tsx
  • src/LiquidGlassView.tsx
  • src/ReactNativeLiquidGlassContainerNativeComponent.ts
  • src/VibrancyView.tsx

📝 Walkthrough

Walkthrough

Changes

The Android blur pipeline now uses 0–100 radius mapping and five default blur rounds, with switch manager delegation updates. iOS initialization recognizes Regular as the default blur type. TypeScript components gain default exports, corrected documentation, and a default spacing value.

Android blur and delegation

Layer / File(s) Summary
Switch manager delegation
android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeBlurSwitchManager.kt
Adds ViewManagerDelegate wiring, interface overrides, and removes the explicit blurAmount annotation default.
Blur mapping and defaults
android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeBlurSwitch.kt, android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeBlurView.kt, android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeProgressiveBlurView.kt
Expands blur radius mapping to 0–100, changes default blur rounds from 3 to 5, and updates related documentation and logging.

iOS blur initialization

Layer / File(s) Summary
Default blur type handling
ios/ReactNativeProgressiveBlurView.mm
Uses Regular when deciding whether the initial blur type update is needed.

TypeScript component API

Layer / File(s) Summary
Exports, codegen defaults, and documentation
src/ReactNativeLiquidGlassContainerNativeComponent.ts, src/LiquidGlassContainer.tsx, src/VibrancyView.tsx, src/BlurView.tsx, src/LiquidGlassView.tsx
Adds default exports, gives spacing a codegen default of 0, and corrects ignoreSafeArea documentation.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: danielaraldi

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/pr4-codegen-contract

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


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.

@sbaiahmed1
sbaiahmed1 force-pushed the fix/ios-pr3-lifecycle branch from 8da9bb5 to a6ee4e2 Compare July 16, 2026 19:07
Base automatically changed from fix/ios-pr3-lifecycle to main July 16, 2026 19:08
Addresses the PR 4 batch from the July 2026 audit.

- AND-03: ReactNativeBlurSwitchManager now implements the generated
  ReactNativeBlurSwitchManagerInterface and installs the generated delegate via
  getDelegate(), so props flow through codegen (matching the other two
  managers) instead of the reflection-based generic delegate. The direct
  onValueChange event wiring is kept for the interop layer.
- AND-04: unify the blurAmount->radius mapping. Per maintainer decision the two
  blur views keep their current 1:1 (0-100) strength, and BlurSwitch is brought
  up to match (MAX_BLUR_RADIUS 25 -> 100) so the same blurAmount renders the
  same strength everywhere. Misleading "0-25" comments/logs removed and the
  ProgressiveBlur divisor corrected to MAX_BLUR_AMOUNT (numerically identical).
- AND-05: set the native DEFAULT_BLUR_ROUNDS to 5 in BlurView and
  ProgressiveBlurView to match the JS wrapper and codegen default (one source
  of truth). The wrapper always sends blurRounds, so the previous internal 3
  was unreachable; a consumer can still lower it explicitly.
- IOS-NEW-4: ProgressiveBlurView compares the initial blurType against its real
  default (Regular) instead of Xlight before skipping the initial apply.
- TS-03: fix the LiquidGlassView ignoreSafeArea JSDoc (@default false -> true,
  now matching the codegen default and behaviour) and the copy-pasted BlurView
  ignoreSafeArea @description.
- TS-07: give the spacing prop a WithDefault<Double, 0> (the only optional prop
  that lacked one) and add the missing default exports to VibrancyView and
  LiquidGlassContainer.

Deferred by decision: TS-NEW-1 (ColorValue-typed colour props) to a later PR.

Verified: Android and iOS both build; TS typecheck passes; on the Android
emulator the BlurSwitch renders and toggles through the new delegate path with
no exceptions in logcat.
@sbaiahmed1
sbaiahmed1 force-pushed the fix/pr4-codegen-contract branch from 0064591 to 8e56b17 Compare July 16, 2026 19:08
@sbaiahmed1
sbaiahmed1 merged commit 52af0ef into main Jul 16, 2026
0 of 5 checks passed
@sbaiahmed1
sbaiahmed1 deleted the fix/pr4-codegen-contract branch July 16, 2026 19:09
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.

1 participant