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 9 minutes and 9 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 adds a debug mechanism for testing 6 different backdrop color strategies for the split-button overlay in Key changes:
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["TabBarView overlay renders"] --> B{"showSplitButtons?"}
B -->|No| Z["No overlay"]
B -->|Yes| C["Read @AppStorage\n'debugFadeColorStyle'\n→ fadeColorStyle: Int"]
C --> D["buttonBackdropColor(appearance, focused, style)"]
D --> E{style}
E -->|0 / default| F["precompositedPaneBackground\n(paneBackground ⊕ windowBg)"]
E -->|1| G["paneBackground\nforced opaque"]
E -->|2| H["barBackground\nforced opaque"]
E -->|3| I["NSColor.windowBackgroundColor"]
E -->|4| J["NSColor.controlBackgroundColor"]
E -->|5| K["pre-composited barBackground\nover windowBg"]
F & G & H & I & J & K --> L["Color(nsColor:) → bg\nused for fade gradient & solid fill"]
|
| } | ||
|
|
||
|
|
||
| private static func buttonBackdropColor( | ||
| for appearance: BonsplitConfiguration.Appearance, | ||
| focused: Bool, | ||
| style: Int | ||
| ) -> NSColor { | ||
| switch style { | ||
| case 1: // raw paneBackground forced opaque | ||
| return TabBarColors.nsColorPaneBackground(for: appearance).withAlphaComponent(1.0) | ||
| case 2: // barBackground (tab bar chrome) | ||
| let c = NSColor(TabBarColors.barBackground(for: appearance)) | ||
| return (c.usingColorSpace(.sRGB) ?? c).withAlphaComponent(1.0) | ||
| case 3: // windowBackgroundColor | ||
| return NSColor.windowBackgroundColor.withAlphaComponent(1.0) | ||
| case 4: // controlBackgroundColor | ||
| return NSColor.controlBackgroundColor.withAlphaComponent(1.0) | ||
| case 5: // pre-composited barBackground over windowBg | ||
| let chrome = NSColor(TabBarColors.barBackground(for: appearance)) | ||
| let winBg = NSColor.windowBackgroundColor | ||
| guard let fg = chrome.usingColorSpace(.sRGB), | ||
| let bk = winBg.usingColorSpace(.sRGB) else { | ||
| return chrome.withAlphaComponent(1.0) | ||
| } | ||
| let a: CGFloat = focused ? fg.alphaComponent : fg.alphaComponent * 0.95 | ||
| let oneMinusA = 1.0 - a | ||
| 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) | ||
| default: // 0: pre-composited paneBackground over windowBg | ||
| return precompositedPaneBackground(for: appearance, focused: focused) | ||
| } | ||
| } |
There was a problem hiding this comment.
style parameter as raw Int — silent no-op for out-of-range values
Any value outside 0–5 silently falls through to default (style 0). While that's safe today with exactly 6 cases, a raw Int makes it easy to pass an out-of-range value (e.g. an incrementing counter misaligned with case count) without a compile-time error or runtime warning.
If this ever graduates from debug to a real setting, consider a typed enum:
enum BackdropStyle: Int {
case precompositedPane = 0
case rawPaneOpaque = 1
case barBackground = 2
case windowBackground = 3
case controlBackground = 4
case precompositedBar = 5
}This also makes the switch exhaustive and removes the need for the default fallback.
Summary by cubic
Add six switchable backdrop color styles for the tab bar split buttons to compare visuals and avoid compositing mismatches. The overlay now computes an opaque backdrop based on
fadeColorStyleand focus.fadeColorStylefor quick toggling.Written for commit 37de3ce. Summary will update on new commits.