Skip to content

fix: respect sidebar decoration color in macos window (#587)#588

Open
rubenRoehner wants to merge 1 commit intomacosui:devfrom
rubenRoehner:fix/sidebar-background-color
Open

fix: respect sidebar decoration color in macos window (#587)#588
rubenRoehner wants to merge 1 commit intomacosui:devfrom
rubenRoehner:fix/sidebar-background-color

Conversation

@rubenRoehner
Copy link
Copy Markdown

Fixes #587.

  • Respect Sidebar.decoration.color when provided; otherwise keep the macOS sidebar transparent to preserve blur/tint, and use theme.canvasColor on web.
  • Remove the hard-coded black fill that caused a dark strip at the top/bottom when wallpaper tinting was disabled/light mode was active.
  • Bump version and update CHANGELOG.

Pre-launch checklist:

  • Version bumped and CHANGELOG updated
  • Imports organized
  • Analyzer clean

Copy link
Copy Markdown

Copilot AI left a 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 fixes macOS sidebar background painting in MacosWindow by honoring Sidebar.decoration.color when provided and otherwise preserving native transparency (to keep blur/tint behavior), addressing issue #587. It also bumps the package version and documents the fix in the changelog.

Changes:

  • Update MacosWindow sidebar background logic to use Sidebar.decoration.color when set, and keep macOS sidebar transparent by default (with a web fallback to theme.canvasColor).
  • Remove the hard-coded black fill that caused visible dark strips when wallpaper tinting was disabled/light mode was active.
  • Bump version to 2.2.3 and add a 2.2.3 changelog entry.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
pubspec.yaml Version bump to 2.2.3.
lib/src/layout/window.dart Adjust sidebar background painting rules and remove hard-coded black fill.
CHANGELOG.md Document the sidebar background fix for 2.2.3.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +327 to +331
(sidebar.decoration ?? const BoxDecoration())
.copyWith(
// Only paint if the caller set a color; null preserves native transparency.
color: sidebarBackgroundColor,
),
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

In the non-web branch, AnimatedContainer already paints sidebarBackgroundColor via its color:. The new DecoratedBox also applies sidebarBackgroundColor as the BoxDecoration.color, which will effectively paint the color twice when the caller provides a semi-transparent Sidebar.decoration.color (making it appear darker than requested). Consider having only a single widget paint the background color (e.g., move the sidebar.decoration/color onto AnimatedContainer.decoration and drop the inner color paint) so opacity is applied exactly once.

Suggested change
(sidebar.decoration ?? const BoxDecoration())
.copyWith(
// Only paint if the caller set a color; null preserves native transparency.
color: sidebarBackgroundColor,
),
sidebar.decoration ?? const BoxDecoration(),

Copilot uses AI. Check for mistakes.
Comment on lines 204 to +206
// Respect the sidebar color override from parent if one is given
if (sidebar?.decoration?.color != null) {
sidebarBackgroundColor = sidebar!.decoration!.color!;
} else {
sidebarBackgroundColor = MacosColors.transparent;
}
sidebarBackgroundColor =
sidebar?.decoration?.color ?? (kIsWeb ? theme.canvasColor : null);
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

This change introduces new sidebar background behavior across platforms (transparent on macOS unless Sidebar.decoration.color is set; theme.canvasColor on web). Since test/layout/window_test.dart already covers MacosWindow/Sidebar, it would be good to add a widget test asserting the expected background paint behavior for (1) no decoration color vs (2) a provided decoration color, to prevent regressions like the black strip issue.

Copilot uses AI. Check for mistakes.
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.

SideBar Bottom Background Color

3 participants