Skip to content

Conversation

@efremidze
Copy link
Owner

@efremidze efremidze commented Aug 29, 2025

Checklist

Motivation and Context

Description

Summary by CodeRabbit

  • New Features

    • Added a saturation control to VisualEffectView and its SwiftUI wrapper, letting you adjust blur saturation (defaults to 1; <1 desaturates, >1 boosts). SwiftUI initializer accepts saturation and previews show usage.
  • Documentation

    • README Customization updated to document the saturation property, default behavior, and usage guidance.

@coderabbitai
Copy link

coderabbitai bot commented Aug 29, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adds a public saturation property to the UIKit VisualEffectView, exposes it through the SwiftUI VisualEffect wrapper and initializer, documents the property in README, bumps podspec to 5.0.8, updates CHANGELOG, and removes several MARKETING_VERSION entries from the Xcode project file.

Changes

Cohort / File(s) Summary
UIKit API: Saturation support
Sources/VisualEffectView/VisualEffectView.swift
Adds open var saturation: CGFloat backed by internal .saturationDeltaFactor key; getter returns existing key value or 1.0; setter writes via existing key accessors; docs indicate behavior above/below 1.0.
SwiftUI wrapper: Propagate saturation
Sources/VisualEffectView/VisualEffectView+SwiftUI.swift
Adds let saturation: CGFloat to VisualEffect; updates public init(..., saturation: CGFloat = 1, ...); assigns view.saturation in makeUIView and uiView.saturation in updateUIView; preview updated.
Documentation
README.md
Documents var saturation: CGFloat // saturation factor. default is 1 under Customization (inserted after existing properties).
Packaging & Changelog
VisualEffectView.podspec, CHANGELOG.md
Bumps podspec s.version from 5.0.75.0.8; adds top-level changelog entry "Readded saturation".
Project metadata
VisualEffectView.xcodeproj/project.pbxproj
Removes several MARKETING_VERSION = ...; lines from multiple XCBuildConfiguration blocks; no other build settings changed.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Dev as Developer (uses SwiftUI)
  participant SW as VisualEffect (SwiftUI wrapper)
  participant UI as VisualEffectView (UIKit)

  Dev->>SW: init(..., saturation: CGFloat = 1, ...)
  SW->>UI: makeUIView(...) and set UI.saturation = saturation
  note right of UI: saturation defaults to 1.0\napplied to .saturationDeltaFactor
  Dev->>SW: update with new parameters
  SW->>UI: updateUIView(...) and set UI.saturation = saturation
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

A little hop, a color gleam,
I tweak the blur to tune the beam.
Saturation set to one (or more),
I nudge the view, then hop out the door.
— the rabbit dev, with paint-splattered paws 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 4a29e0a and cdb22df.

📒 Files selected for processing (3)
  • CHANGELOG.md (1 hunks)
  • VisualEffectView.podspec (1 hunks)
  • VisualEffectView.xcodeproj/project.pbxproj (0 hunks)
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch release/5.0.8

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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

🧹 Nitpick comments (1)
README.md (1)

53-53: Clarify range and mirror SwiftUI docs; update example.

  • Add acceptable range (e.g., >= 0) to avoid misuse.
  • Also document in the SwiftUI Usage section and reflect in the example initializer.

Apply this edit to the declaration line:

-var saturation: CGFloat // saturation factor. default is 1
+var saturation: CGFloat // saturation factor (>= 0). default is 1

And update the SwiftUI example later in the file to include the new parameter (outside this hunk), e.g.:

VisualEffect(colorTint: .white, colorTintAlpha: 0.5, blurRadius: 10, saturation: 1, scale: 1)
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 44e5055 and 4a29e0a.

📒 Files selected for processing (3)
  • README.md (1 hunks)
  • Sources/VisualEffectView/VisualEffectView+SwiftUI.swift (5 hunks)
  • Sources/VisualEffectView/VisualEffectView.swift (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
README.md (2)
Example/ContentView.swift (1)
  • blurRadius (12-47)
Sources/VisualEffectView/UIViewEffectView+Helpers.swift (2)
  • backdropView (10-30)
  • prepareForChanges (23-26)
Sources/VisualEffectView/VisualEffectView.swift (1)
Sources/VisualEffectView/UIViewEffectView+Helpers.swift (3)
  • prepareForChanges (23-26)
  • backdropView (10-30)
  • applyChanges (27-29)
Sources/VisualEffectView/VisualEffectView+SwiftUI.swift (2)
Example/ContentView.swift (1)
  • blurRadius (12-47)
Sources/VisualEffectView/UIViewEffectView+Helpers.swift (2)
  • prepareForChanges (23-26)
  • backdropView (10-30)
🔇 Additional comments (7)
Sources/VisualEffectView/VisualEffectView.swift (2)

118-118: Key added correctly.

The KVC key saturationDeltaFactor matches the property and keeps parity with existing keys.


63-73: Clamp input and skip no-op saturation updates

-    open var saturation: CGFloat {
-        get { return _value(forKey: .saturationDeltaFactor) ?? 1.0 }
-        set { _setValue(newValue, forKey: .saturationDeltaFactor) }
-    }
+    open var saturation: CGFloat {
+        get { return _value(forKey: .saturationDeltaFactor) ?? 1.0 }
+        set {
+            let clamped = max(0, newValue.isFinite ? newValue : 1.0)
+            guard clamped != saturation else { return }
+            _setValue(clamped, forKey: .saturationDeltaFactor)
+        }
+    }

Please verify on iOS 14–18 that setting saturation via KVC still takes effect without an explicit prepareForChanges()/applyChanges() call; if not, restore the prepare/apply pattern after _setValue.

Sources/VisualEffectView/VisualEffectView+SwiftUI.swift (5)

40-47: Good docs for the new parameter.

Clear behavior description and default noted.


83-84: Propagation in makeUIView looks correct.

Property is set alongside other knobs.


95-95: Propagation in updateUIView looks correct.

Updates track state changes as expected.


106-106: Nice preview coverage.

Example showcases the new parameter.


66-72: No positional argument usage found; initializer remains source-compatible.

@efremidze efremidze merged commit 405baa5 into master Aug 29, 2025
3 checks passed
@efremidze efremidze deleted the release/5.0.8 branch August 29, 2025 17:56
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