-
-
Notifications
You must be signed in to change notification settings - Fork 340
Fix Color.toGamma
and Color.toLinear
listener error
#2389
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
Conversation
WalkthroughThe changes in the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2389 +/- ##
==========================================
+ Coverage 69.50% 74.91% +5.40%
==========================================
Files 524 522 -2
Lines 27405 27355 -50
Branches 4100 4096 -4
==========================================
+ Hits 19049 20493 +1444
+ Misses 6852 6827 -25
+ Partials 1504 35 -1469
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
packages/math/src/Color.ts (2)
297-297
: Approve change and suggest optional chainingThe addition of
out._onValueChanged && out._onValueChanged();
correctly addresses the listener error inColor.toLinear
. This ensures that any listeners are notified when the output color object is modified.Consider using optional chaining for improved readability:
-out._onValueChanged && out._onValueChanged(); +out._onValueChanged?.();This change maintains the same functionality while making the code more concise.
🧰 Tools
Biome
[error] 297-297: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
310-310
: Approve change and suggest optional chainingThe addition of
out._onValueChanged && out._onValueChanged();
correctly addresses the listener error inColor.toGamma
. This ensures that any listeners are notified when the output color object is modified.Consider using optional chaining for improved readability:
-out._onValueChanged && out._onValueChanged(); +out._onValueChanged?.();This change maintains the same functionality while making the code more concise.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- packages/math/src/Color.ts (2 hunks)
🧰 Additional context used
Biome
packages/math/src/Color.ts
[error] 297-297: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
🔇 Additional comments not posted (1)
packages/math/src/Color.ts (1)
297-297
: Summary: Approve changes with minor refactor suggestionsThe changes in both
toLinear
andtoGamma
methods successfully address the listener error mentioned in the PR objectives. The implementation is consistent and correctly notifies listeners when the output color object is modified.These changes improve the functionality without introducing breaking changes. The suggested refactors to use optional chaining will further enhance code readability and maintainability.
Great job on fixing this issue! Once the optional chaining suggestions are addressed, this PR will be ready for merge.
Also applies to: 310-310
🧰 Tools
Biome
[error] 297-297: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
What is the current behavior? (You can also link to an open issue here)
What is the new behavior (if this is a feature change)?
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
Other information:
Summary by CodeRabbit