Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 13 minutes and 26 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Greptile SummaryThis PR refactors the pre-compositing logic for the split-button backdrop from an inline closure in the view body into a reusable
Confidence Score: 3/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["View body: showSplitButtons == true"] --> B["Call Self.precompositedPaneBackground(for: appearance, focused: isFocused)"]
B --> C["Get chrome = TabBarColors.nsColorPaneBackground(for: appearance)"]
B --> D["Get winBg = NSColor.windowBackgroundColor"]
C & D --> E{"Convert both to .sRGB"}
E -- "conversion fails" --> F["Return chrome.withAlphaComponent(1.0)"]
E -- "success: fg, bk" --> G["Compute alpha 'a'\n(focused ? fg.alpha : fg.alpha × 0.95)"]
G --> H["Blend: r/g/b = fg×a + bk×(1−a)"]
H --> I["⚠️ NSColor(red:green:blue:alpha:)\ncalibratedRGB — should be sRGBRed:"]
I --> J["Color(nsColor:) → SwiftUI Color 'bg'"]
J --> K["LinearGradient + Rectangle backdrop\nusing 'bg'"]
K --> L["ZStack: backdrop + splitButtons overlay"]
Reviews (1): Last reviewed commit: "Pre-composite pane bg over window bg for..." | Re-trigger Greptile |
| let r = fg.redComponent * a + bk.redComponent * oneMinusA | ||
| let g = fg.greenComponent * a + bk.greenComponent * oneMinusA | ||
| let b = fg.blueComponent * a + bk.blueComponent * oneMinusA | ||
| return NSColor(red: r, green: g, blue: b, alpha: 1.0) |
There was a problem hiding this comment.
Wrong
NSColor initializer changes color space from sRGB to calibratedRGB
The extracted function blends components after converting both inputs to .sRGB (lines 537–538), so r, g, and b are sRGB-space values. The original inline code used NSColor(sRGBRed:green:blue:alpha:) to correctly wrap those values back into the sRGB color space.
The new code uses NSColor(red:green:blue:alpha:), which creates an NSCalibratedRGBColorSpace color — a different color space. The same numeric component values interpreted in calibrated RGB will render at a slightly different color than intended, reintroducing the compositing mismatch the PR aims to fix.
| return NSColor(red: r, green: g, blue: b, alpha: 1.0) | |
| return NSColor(sRGBRed: r, green: g, blue: b, alpha: 1.0) |
Summary by cubic
Pre-composites the tab bar pane background over the window background and uses the flat color for the split-button backdrop. This removes double-compositing mismatches so the overlay matches the bar fill in both focused and unfocused states.
Written for commit 07e8fa0. Summary will update on new commits.