black7375 / black7375/Firefox-UI-Fix

Auto hide isn't working on new searchbar

Open
#1,171 0 comments 0 reactions 0 assignees View on GitHub
Class::Padding Component::URLbar Env::Windows Issue::Bug
Dominant language
SCSS
Stars
5.9k
Forks
202
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug

The new searchbar widget won't be hide when enable autohide nav-bar.

### Expected behavior

The searchbar is hide with the toolbar.

### Screenshots

_No response_

### OS

Windows 10

### OS - Others

_No response_

### Firefox Version

v149+

### Distribution

- [ ] [Original Lepton](https://github.com/black7375/Firefox-UI-Fix)
- [ ] [Lepton's photon style](https://github.com/black7375/Firefox-UI-Fix/tree/photon-style)
- [ ] [Lepton's proton style](https://github.com/black7375/Firefox-UI-Fix/tree/proton-style)

### Theme

- [ ] Light
- [ ] Dark
- [ ] Alpenglow (System: Light)
- [ ] Alpenglow (System: Dark)
- [ ] System Default
- [ ] Others: (e.g. [Photon Colors](https://addons.mozilla.org/en-US/firefox/addon/photon-colors/), [Google Chrome Dark](https://addons.mozilla.org/en-US/firefox/addon/google-chrome-dark/), [Fairytale Of Nature](https://addons.mozilla.org/en-US/firefox/addon/fairytale-of-nature/))

### Theme - More Info

_No response_

### `user.js` setup

user.js setup

```javascript
// Your settings
```

### Additional context

The new searchbar widget is a repurposed Url bar element.
So it need special treatment like url bar.

Workaround rule:
```css

/* fix new search widget auto hide */
@media -moz-pref("userChrome.autohide.tabbar") or -moz-pref("userChrome.autohide.navbar") {
@media -moz-pref("userChrome.autohide.navbar") or -moz-pref("userChrome.tabbar.one_liner") {
@media (prefers-reduced-motion: no-preference) {
#nav-bar:not([customizing]) #searchbar-new {
transition: opacity var(--uc-autohide-toolbar-speed) var(--animation-easing-function) var(--uc-autohide-toolbar-delay) !important;
}

#navigator-toolbox:is(:hover, :focus-within) #nav-bar:not([customizing]) #searchbar-new {
transition-delay: 0s !important;
}
}

@media -moz-pref("userChrome.autohide.navbar") {
@media not -moz-pref("userChrome.tabbar.one_liner") {
#navigator-toolbox:not(:hover, :focus-within) #nav-bar:not([customizing]) #searchbar-new {
pointer-events: none;
}

#nav-bar:not([customizing]) #searchbar-new {
opacity: 0;
will-change: margin-bottom, opacity;
}

#navigator-toolbox:is(:hover, :focus-within) #nav-bar:not([customizing]) #searchbar-new {
opacity: 1;
}
}
}
}
}

@media not -moz-pref("userChrome.urlView.as_commandbar") {
@media -moz-pref("userChrome.padding.urlbar") {
:root:not([uidensity="compact"]) #searchbar-new {
height: calc(var(--urlbar-height) - 2px) !important;
min-height: calc(var(--urlbar-min-height) - 2px) !important;
}
}
}
```

Contributor guide

Open the contributing guide

Research direction

Start by finding the SCSS rules that implement navbar autohide and compare their treatment of the URL bar with the new #searchbar-new widget. Reproduce the issue on Firefox 149+ with userChrome.autohide.navbar enabled, then verify that the searchbar hides and reappears with the toolbar without breaking the provided workaround behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
scss
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.