-
Notifications
You must be signed in to change notification settings - Fork 7
IOS-11935 [Mistica] Allow transparent gradient color in MisticaGradient #483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IOS-11935 [Mistica] Allow transparent gradient color in MisticaGradient #483
Conversation
β¦void default white background
|
Screenshot tests report βοΈ All passing |
|
Record screenshots on PR comment: succeeded β
|
| } | ||
|
|
||
| func testGradientInView() { | ||
| func testOpaqueGradientInView() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed to opaque
| ) | ||
| } | ||
|
|
||
| func testTransparentGradientInView() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New test for transparent gradients (it consists on a fully red view with an overlay from blue with 10% of alpha to blue with 90% of alpha)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enables transparent gradients in MisticaGradient by setting clear backgrounds on the hosting view controller and its views, allowing content beneath transparent gradients to be visible.
Key changes:
- Set background colors to
.clearinGradientSwiftUIViewControllerfor both the main view and the hosting controller view - Added snapshot test for transparent gradients and renamed the existing opaque gradient test for clarity
Reviewed Changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Sources/MisticaCommon/Components/GradientView+UIKit.swift | Added .clear background colors to view controller and hosting controller to support transparent gradients |
| Tests/MisticaTests/UI/GradientTests.swift | Renamed existing test to testOpaqueGradientInView, added new testTransparentGradientInView test, and extracted gradient frame to constants |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| ) | ||
| } | ||
|
|
||
| func testTransparentGradientInView() { |
Copilot
AI
Oct 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'Transpatent' to 'Transparent' in function name.
|
π This PR is included in version 36.3.1 π The release is available on GitHub release Your semantic-release bot π¦π |
ποΈ Jira ticket
IOS-11935 Allow transparent gradient color in MisticaGradient
π₯ What's the goal?
During a fix to align Android and iOS start screen background overlay in Movistar, we've decided to use a gradient by code instead of an asset. But due to this gradient contains transparency, we've detected that the
GradientSwiftUIViewControllerview controller used to create the gradient has the default view controller background (which is white), not letting see the content under the gradientπ§ How do we do it?
.clearopaque)π§ͺ How can I verify this?
Unfortunately there is no way to test this in MisticaCatalog. However, you can check the snapshots. The old one (
testGradientInView1.png) has been renamed totestOpaqueGradientInView1.pngbecause it remains unchanged, while there is a new snapshottestTranspatentGradientInView1.pngthat consists in a fully red view with a gradient over it using colors from blue with 10% of trasnparency to blue with 90% of transparency