VOOZH about

URL: https://phabricator.services.mozilla.com/D301405

⇱ ⚙ D301405 Bug 2044082 - Add updates for dynamic compact mode based on a configurable threshold pref


Bug 2044082 - Add updates for dynamic compact mode based on a configurable threshold pref
ClosedPublic

Authored by kcochrane on Tue, May 19, 8:25 PM.
Referenced Files
F72960155: D301405.1781832203.diff
Thu, Jun 18, 1:23 AM
F72894024: D301405.1781759280.diff
Wed, Jun 17, 5:08 AM
Unknown Object (File)
Tue, Jun 16, 9:57 PM
Unknown Object (File)
Tue, Jun 16, 9:57 PM
Unknown Object (File)
Tue, Jun 16, 9:57 PM
Unknown Object (File)
Tue, Jun 16, 12:09 PM
Unknown Object (File)
Tue, Jun 16, 12:07 PM
Unknown Object (File)
Tue, Jun 16, 4:31 AM
Subscribers

Details

Test Plan

Don't update the to be anything other than the default of 0. That will essentially turn on compact mode regardless of any other factors.
To test, resize the window up and down to see compact mode be enabled and disabled. You can adjust the if needed, but it will be set to a default of based on feedback from UX and product.

Diff Detail

Event Timeline

kcochrane created this revision.
kcochrane updated the bug number.
kcochrane added a reviewer: sfoster.
Comment Actions

Left some thoughts. Apart from exposing my age related macular degeneration even more than I thought, it looks promising.
I think for the purpose of testing, you want that reference ratio in a pref, so people can tweak it and see what threshold feels right to them and maybe we'll find a good-enough consensus. It might even be justified to keep it in a pref for the power users and config tweakers.

browser/base/content/browser.js
3191

You could also make this a ratio of tabstrip height to window height. E.g. 0.04:1.
Personally and very subjectively, I didn't find this cut-off useful fwiw. I had to bump my resolution to a crazy size to get uidensity to *not* be compact.

3203

Is the compact mode also dynamic based on window size, or just screen size?
That may be scope creep, but if we are doing in in browser.js (i.e. per window) I would think it should be window-size dependant and so you'd want to watch for resize events as well. Maybe that's a different bug and discussion though.

3284

Do we really want the tabstrip height as ratio of screen width? I suspect we dont need to look at the width at all actually - as compact mode doesn't really help much with narrow windows. If we do, we should compare against a reference width not height.

Again, in my head this is a ratio, so H / screen.width = 0.04444 or whatever, so we express the threshold as when the tabstrip is taking up more than its fair share of the vertical space, i.e. it exceeds some proportion of the window height. More than 4% means we engage compact mode. But either works.

kcochrane updated this revision to Diff 1279306.
Comment Actions

Made some adjustments based on feedback from @sfoster. I've also gated this behind the browser.nova.enabled pref as Ania requested that.

I've added a new pref for set to by default.

kcochrane updated this revision to Diff 1285841.
kcochrane retitled this revision from WIP: compact mode to WIP: Add updates for dynamic ompact mode based on a configurable threshold pref.
kcochrane retitled this revision from WIP: Add updates for dynamic ompact mode based on a configurable threshold pref to WIP: Add updates for dynamic compact mode based on a configurable threshold pref.Mon, Jun 1, 2:15 PM
kcochrane retitled this revision from WIP: Add updates for dynamic compact mode based on a configurable threshold pref to Bug 2044082 - Add updates for dynamic compact mode based on a configurable threshold pref.Mon, Jun 1, 4:01 PM
kcochrane removed a reviewer: Restricted Project.
kcochrane removed a subscriber: flod.
dao requested changes to this revision.Mon, Jun 1, 5:45 PM
dao added a subscriber: dao.
dao added inline comments.
browser/app/profile/firefox.js
261–271

I think this should be an absolute number, because it's absolute pixels that constrain us in terms of being able to fit buttons on the toolbar etc. This would be in line with our pre-existing logic here (which I think we should be able to simplify based on your work here): https://searchfox.org/firefox-main/rev/e28b34ab33dbf49364999070168cbb7e11e8e5bd/browser/themes/shared/toolbarbuttons.css#7-33

This revision now requires changes to proceed.Mon, Jun 1, 5:45 PM
browser/app/profile/firefox.js
261–271

@dao Are you suggesting we use separate prefs for height and width?

dao added inline comments.
browser/app/profile/firefox.js
261–271

We've discussed this separately. The toolbar button logic I linked to above is somewhat orthogonal to this patch, although there's likely room for consolidation that would be good to look into in a follow-up. For now we can carry on with this current approach of having a relative threshold.

Comment Actions

The auto-compact logic here looks good. But is there another bug that implements more compacting? I have to be honest, although the measurements show the compact is 6px shorter, I wasn't really able to see the difference. I had to check initially to make sure I was looking at compact mode. It is a bit more noticeable in the sidebar launcher width.

Are you planning a test in follow-up? We definitely want test coverage for this.

Comment Actions

The auto-compact logic here looks good. But is there another bug that implements more compacting? I have to be honest, although the measurements show the compact is 6px shorter, I wasn't really able to see the difference. I had to check initially to make sure I was looking at compact mode. It is a bit more noticeable in the sidebar launcher width.

Are you planning a test in follow-up? We definitely want test coverage for this.

Screen Recording 2026-06-04 at 11.24.49 AM.mov3 MBDownload

I also find it a bit hard to tell what state we're in unless/until we enter/exit the compact mode state. That transition between the two is quite obvious (I've attached a screen recording). I was basing it off of pre-existing compact mode to be honest thinking that's as far as we can take it, but perhaps there's more room we can shave off at some point.

I'll add a test here, thanks for bringing that up!

phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".Thu, Jun 4, 8:26 PM
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
sclements added a project: testing-approved.
sclements added a subscriber: sclements.
Comment Actions

r+ for the tabbrowser change.

This revision is now accepted and ready to land.Mon, Jun 8, 1:50 PM
This revision is now accepted and ready to land.Wed, Jun 10, 11:21 PM

Revision Contents

PathSize
browser/
app/
profile/
11 lines
base/
content/
112 lines
components/
customizableui/
test/
2 lines
397 lines
sidebar/
8 lines
themes/
shared/
11 lines
tabbrowser/
9 lines
CommitTreeParentsAuthorSummaryDate
69e7b8a242060e567ab99d30Kelly Cochrane
Bug 2044082 - Add updates for dynamic compact mode based on a configurable… (Show More…)

Diff 1297684

browser/app/profile/firefox.js

Loading...

browser/base/content/browser.js

Loading...

browser/components/customizableui/test/browser.toml

Loading...

browser/components/customizableui/test/browser_uidensity_auto_compact.js

Loading...

browser/components/sidebar/sidebar-main.css

Loading...

browser/themes/shared/sidebar.css

Loading...

browser/themes/shared/tabbrowser/tabs.css

Loading...