Skip to content

Respect bookmark-bar-ntp flag and also "Always Show Bookmarks Bar" menu option#1639

Open
vuon9 wants to merge 1 commit into
imputnet:mainfrom
vuon9:fix/respect-bookmark-bar-pref-ntp
Open

Respect bookmark-bar-ntp flag and also "Always Show Bookmarks Bar" menu option#1639
vuon9 wants to merge 1 commit into
imputnet:mainfrom
vuon9:fix/respect-bookmark-bar-pref-ntp

Conversation

@vuon9
Copy link
Copy Markdown
Contributor

@vuon9 vuon9 commented May 9, 2026

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
    (an approved feature request, or confirmed bug).
  • 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

Allow completely toggling the bookmarks bar appearance in new tabs, respecting the ungoogled-chromium flag: #bookmark-bar-ntp and also "Always Show Bookmarks Bar". So it's basically a pull request to change behavior of upstream ungoogled-chromium's flag behavior, it doesn't kill the flag itself but expands to control the bookmarks bar better.

I used AI to debug and create this patch. To address this issue: #1349
Demo: Toggling Cmd+Shift+B on new tabs

Outcome matrix based on combination of flag #bookmark-bar-ntp and View > Always Show Bookmarks Bar option:

flag: bookmark-bar-ntp menu: Always Show Bookmarks Bar regular tab new tab
Default ON ✅ shown ✅ shown
Default OFF ⭕ hidden ✅ shown if bookmarks
Never ON ✅ shown ✅ shown
Never OFF ⭕ hidden ⭕ hidden

Demos:

  • When: bookmark-bar-ntp = default
bookmark-bar-ntp-default.mov
  • When: bookmark-bar-ntp = never
bookmark-bar-ntp-never.mov

Fixes #1349

Comment thread patches/helium/core/respect-bookmark-bar-visibility-pref.patch Outdated
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 9, 2026

Reviews (1): Last reviewed commit: "fix: respect bookmark bar visibility pre..." | Re-trigger Greptile

Comment thread patches/helium/core/respect-bookmark-bar-visibility-pref.patch Outdated
@vuon9 vuon9 force-pushed the fix/respect-bookmark-bar-pref-ntp branch 2 times, most recently from 90e0ebb to 31c08eb Compare May 9, 2026 12:07
@vuon9 vuon9 changed the title Allow completely toggling bookmarks bar appearance in new tab. Respect bookmark-bar-ntp flag May 9, 2026
@vuon9
Copy link
Copy Markdown
Contributor Author

vuon9 commented May 9, 2026

Updated and added outcome metrix + demo videos to align with the ungoogled-chromium flag.

@vuon9 vuon9 requested a review from dumbmoron May 9, 2026 13:06
@vuon9 vuon9 force-pushed the fix/respect-bookmark-bar-pref-ntp branch from 31c08eb to 38399d8 Compare May 9, 2026 13:16
When kShowBookmarkBar pref is false, ShouldShowBookmarkBar() now
returns false before reaching the NTP special-case, hiding the bar
on new tab pages regardless of bookmark count.
@vuon9 vuon9 force-pushed the fix/respect-bookmark-bar-pref-ntp branch from 38399d8 to 2375d6c Compare May 15, 2026 12:08
Comment on lines +7 to +20
- if (base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII("bookmark-bar-ntp") == "never") {
- return false;
- }
-
Profile* profile = browser_->GetProfile();
if (profile->IsGuestSession()) {
return false;
@@ -200,6 +196,10 @@
return false;
}

+ if (base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII("bookmark-bar-ntp") == "never") {
+ return false;
+ }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

could you explain how the behavior differs after moving the if() down here? i don't really understand what this does

Copy link
Copy Markdown
Contributor Author

@vuon9 vuon9 May 15, 2026

Choose a reason for hiding this comment

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

Setting 'bookmark-bar-ntp' to 'never' will consistently hide the bookmarks bar, overriding the 'menu: Always Show Bookmarks Bar' setting. By this move, the bookmarks bar will be hidden if 'menu: Always Show Bookmarks Bar' is unchecked. Please see the matrix table i have in the description to see each case.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

flags are meant to be the highest priority, which is why to me it makes sense when it is on the top of the function. i think the original solution made sense, where we always apply based on prefs::kShowBookmarkBar regardless of if the page is NTP or not

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, you're right, the original one is actually for highest priority. But do you think that makes more sense if we adjust like this, actually it can handle more cases, including the issue i have mentioned.

@vuon9 vuon9 changed the title Respect bookmark-bar-ntp flag Respect bookmark-bar-ntp flag and also "Always Show Bookmarks Bar" menu option May 15, 2026
@shell-surfer
Copy link
Copy Markdown

This issue #1349 does not happen in a newly created profile. But old profiles does have this issue.

@shell-surfer
Copy link
Copy Markdown

If no bookmarks (in any folder on the bookmarks bar, including other bookmarks folder) and no tab groups are present, it can be toggled on NTP in old profiles.

This is why it works as expected in new profiles since we never create any bookmarks/tab groups in the demo profile. If you do create any of these, the issue appears there as well.

@vuon9
Copy link
Copy Markdown
Contributor Author

vuon9 commented May 20, 2026

If no bookmarks (in any folder on the bookmarks bar, including other bookmarks folder) and no tab groups are present, it can be toggled on NTP in old profiles.

This is why it works as expected in new profiles since we never create any bookmarks/tab groups in the demo profile. If you do create any of these, the issue appears there as well.

I was confused about the first comment, but I understand now. My PR is actually about addressing the issue that I want to toggle show/hide the bookmarks bar by the browser menu option (also respecting the flag) no matter it has items or not, but it's not forcing to show/hide by the flag itself.

To be honest, I hope the default Chromium feature will be like this.
Also updated the description of PR to make it more clear.

@shell-surfer
Copy link
Copy Markdown

shell-surfer commented May 21, 2026

This issue #1349 is fixed in 0.12.4

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]: Allow toggling bookmark bar in NTP

3 participants