Respect kShowNever when side panel opens#33769
Open
orpheuslummis wants to merge 1 commit intobrave:masterfrom
Open
Respect kShowNever when side panel opens#33769orpheuslummis wants to merge 1 commit intobrave:masterfrom
orpheuslummis wants to merge 1 commit intobrave:masterfrom
Conversation
When "Show Sidebar" is set to "Never" in brave://settings/appearance, opening a side panel extension (or built-in panel) no longer forces the sidebar control strip (icon bar) to appear. Only the panel content is shown, matching the user's preference. Previously, ShowSidebarAll() unconditionally showed both the control view and the side panel, ignoring the kShowNever setting. This was reported as a UX issue for users who want side panel extensions (e.g., Claude, Page Sidebar) without the redundant icon strip. Changes: - ShowSidebar() accepts a new show_sidebar_control parameter - ShowSidebarAll() checks kShowNever before showing control view - CalculatePreferredSize() handles panel-only visible state - Layout() zeroes control width when control view is hidden - SetSidebarShowOption(kShowNever) hides control if panel is open Known limitation: BraveContentsViewUtil rounded corner radius on the panel-adjacent side uses window radius instead of border radius in kShowNever+panel mode (cosmetic only, suitable for follow-up). Resolves brave/brave-browser#51271
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When "Show Sidebar" is set to Never in
brave://settings/appearance, opening a side panel extension (or built-in panel like Bookmarks) no longer forces the sidebar control strip (icon bar) to appear. Only the panel content is shown.Resolves brave/brave-browser#51271
The Problem
ShowSidebarAll()unconditionally showed both the control view (icon strip) and the side panel, ignoringkShowNever. This forced a two-column layout (icon strip + panel) even when the user explicitly disabled the sidebar, wasting horizontal space—especially painful on smaller displays or when using side panel extensions like Claude or Page Sidebar.Changes
All changes are in
sidebar_container_view.cc/h(+ browsertest):ShowSidebar()bool show_sidebar_controlparameter (defaulttrue) controls whether the icon strip is shown alongside the panelShowSidebarAll()kShowNeverbefore passingshow_control— hides icon strip when sidebar is disabledCalculatePreferredSize(){0,0}→ panel got zero space)Layout()control_view_widthwhen control is not visible (follows existingIsFullscreenForCurrentEntry()pattern)SetSidebarShowOption()kShowNeverwhile a panel is open, hides just the control view and keeps the panelNo changes to
kShowAlwaysorkShowOnMouseOverbehavior — all existing code paths are unaffected.Verified Scenarios
Known Limitation
BraveContentsViewUtil::GetRoundedCornersForContentsViewchecksIsSidebarVisible()(which reports control-view visibility). In kShowNever+panel mode, the content area's lower corner on the panel side uses the window-corner radius instead of the border radius. This is cosmetic only and suitable for a follow-up.Test Plan
ShowNeverHidesControlViewWhenPanelOpensbrowsertestSwitchToShowNeverWhilePanelOpenbrowsertestSidebarContainerViewBrowserTesttests still pass