Skip to content

Use barBackground#83

Merged
lawrencecchen merged 1 commit intomainfrom
hstack-sibling-buttons
Mar 30, 2026
Merged

Use barBackground#83
lawrencecchen merged 1 commit intomainfrom
hstack-sibling-buttons

Conversation

@lawrencecchen
Copy link
Copy Markdown

@lawrencecchen lawrencecchen commented Mar 30, 2026

Summary by cubic

Use TabBarColors.barBackground(for: appearance) for the split-button backdrop in the tab bar. This aligns the overlay with the bar’s theme across appearances and removes the hard-coded color/alpha path.

Written for commit 7a0b752. Summary will update on new commits.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 30, 2026

Warning

Rate limit exceeded

@lawrencecchen has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 23 minutes and 50 seconds before requesting another review.

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 23 minutes and 50 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b66aa4cd-964d-4077-8907-d765ab72263e

📥 Commits

Reviewing files that changed from the base of the PR and between 2564166 and 7a0b752.

📒 Files selected for processing (1)
  • Sources/Bonsplit/Internal/Views/TabBarView.swift
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hstack-sibling-buttons

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@lawrencecchen lawrencecchen merged commit 77d6def into main Mar 30, 2026
2 of 3 checks passed
@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Mar 30, 2026

Greptile Summary

This PR replaces a manual Color(nsColor: TabBarColors.nsColorPaneBackground(for: appearance).withAlphaComponent(1.0)) construction with the dedicated TabBarColors.barBackground(for: appearance) helper for the split-button overlay backdrop in TabBarView.

  • Semantic alignment: The split-button fade/solid backdrop (bg) now uses the same color source as tabBarBackground (the actual bar fill at line 552), ensuring they always match visually rather than accidentally diverging.
  • Fallback color correction: The old code fell back to .textBackgroundColor (typically white in light mode) when no custom chrome color was set; the new code falls back to .windowBackgroundColor, which is the correct system color for a macOS window chrome/toolbar background.
  • Alpha handling: The explicit .withAlphaComponent(1.0) override is removed. If a custom chrome background hex includes an alpha channel (8-digit hex), the new code will respect it rather than forcing full opacity — a minor behavioral difference unlikely to cause visual issues in practice since the backdrop is intended to be a solid mask.

Confidence Score: 5/5

  • Safe to merge — the one-line change is a straightforward cleanup with no risk of regressions.
  • No logic bugs, security concerns, or correctness issues. The change is a focused refactor that aligns the split-button overlay color with the existing bar background helper already used everywhere else in the same file. All remaining observations are P2 or lower.
  • No files require special attention.

Important Files Changed

Filename Overview
Sources/Bonsplit/Internal/Views/TabBarView.swift Replaces manual NSColor pane-background construction with the dedicated barBackground(for:) helper, aligning the split-button overlay backdrop with the actual tab-bar background color.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[TabBarView renders] --> B{showSplitButtons?}
    B -- No --> Z[No overlay]
    B -- Yes --> C[Compute bg color]

    subgraph Before
        C1["nsColorPaneBackground(for: appearance)\n.withAlphaComponent(1.0)\n→ fallback: .textBackgroundColor"]
    end

    subgraph After
        C2["TabBarColors.barBackground(for: appearance)\n→ fallback: .windowBackgroundColor"]
    end

    C --> C1
    C --> C2

    C1 --> D[ZStack: fade gradient + solid rect backdrop]
    C2 --> D
    D --> E[Split buttons on top]

    T[tabBarBackground view] --> F["TabBarColors.barBackground(for: appearance)\n→ same helper as new bg"]
    F --> G[Tab bar fill]

    style C2 fill:#90EE90
    style C1 fill:#FFB6C1
Loading

Reviews (1): Last reviewed commit: "Use barBackground for button backdrop" | Re-trigger Greptile

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

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.

1 participant