Skip to content

Conversation

@chingweih
Copy link

@chingweih chingweih commented Dec 28, 2025

For your pull request to not get closed without review, please confirm that:

  • An issue exists where the maintainers agreed that this should be implemented.
    If such issue did not exist before, I opened one. (I've opened [FR]: Reduce Side Panel Minimum Width #673)
  • I tested that my contribution works locally, and does not break anything,
    otherwise I have marked my PR as draft.
  • If my contribution is non-trivial, I did not use AI to write most of it.
  • I understand that I will be permanently banned from interacting with this
    organization if I lied by checking any of these checkboxes.

Tested on (check one or more):

  • Windows
  • macOS
  • Linux

closes #673

I've add a patch that decrease the minimum side panel width from 360px to 260px, so that it will not take up too many horizontal spaces on a laptop screen. The default width is kept the same as 360px and I've also added snapping to default width on resizing.

This is done by adding a constant kSidePanelMinimumContentWidth that defines the fixed minimum width in chrome/browser/ui/views/side_panel/side_panel_entry.h to 260(px). Then use this constant in GetMinimumSize() function in side_panel.cc so it only affects the minimum width while the default width stays the same.

Snapping is done by adding a function GetDefaultSize() that uses kSidePanelMinimumContentWidth to calculate width, and update the OnResize function to see if the proposed_width is close enough to the default width, if so then snap to that width.

This change should allow user to define a smaller extension side panel width if they wish, while keeping the default to not break existing extensions.

Thanks again for this wonderful browser!

Screenshots

Default Chromium 360px

Screenshot 2025-12-28 at 1 14 10 PM

Updated 260px

Screenshot 2025-12-28 at 1 17 37 PM

Snapping to default width

Screen.Recording.2026-01-01.at.5.06.36.PM.mov

Copy link
Member

Choose a reason for hiding this comment

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

nit: could this be merged into helium/ui/side-panel.patch?

Copy link
Author

Choose a reason for hiding this comment

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

Updated in 0b58449

Comment on lines 6 to 8
// The default and minimum acceptable side panel content width.
- static constexpr int kSidePanelDefaultContentWidth = 360;
+ static constexpr int kSidePanelDefaultContentWidth = 260;
Copy link
Member

Choose a reason for hiding this comment

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

this change will break basically all side panels, because they're not optimized to be scaled this small. all of them will look bad by default.

"default" and "minimum" should be separated, and side panel size should snap to "default" while being resized back and forth.

Copy link
Author

Choose a reason for hiding this comment

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

Changed in 0285725 and 0e62615

@chingweih
Copy link
Author

Hi @wukko and @dumbmoron, thank you for taking time to review this PR during the holidays (Happy new year!), and pointing out the oversight by simply changing the default constant.

I've updated the patch to separate minimum from default, so that side panels use the original default width but are allowed to scale smaller if the user wish to do so. Snapping back to default width is also added.

Thanks again for your time and suggestions.

@chingweih chingweih force-pushed the ui/side-panel-minimum-width branch from 3b04ffb to 82766b8 Compare January 1, 2026 16:50
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.

[FR]: Reduce Side Panel Minimum Width

3 participants