Skip to content

Fix/gh 12076 f6 float urlbar - #14697

Open
saberoueslati wants to merge 4 commits into
zen-browser:devfrom
saberoueslati:fix/gh-12076-f6-float-urlbar
Open

Fix/gh 12076 f6 float urlbar#14697
saberoueslati wants to merge 4 commits into
zen-browser:devfrom
saberoueslati:fix/gh-12076-f6-float-urlbar

Conversation

@saberoueslati

@saberoueslati saberoueslati commented Jul 24, 2026

Copy link
Copy Markdown

Description

Fixes the URL bar not floating when focused with F6 while using the Always Floating URL bar behavior.

F6 focuses the URL bar through a focus event, but UrlbarView.autoOpen() previously only opened the view for mouse, click, and command events. This change adds an explicit opt-in path for focus events and enables it only for Zen's floating URL bar behavior, leaving the existing behavior unchanged in other modes.

A browser regression test now synthesizes F6 and verifies that the URL bar enters its floating state.

Closes #12076

Video of manual test here :

Screencast.from.2026-07-24.10-25-44.webm

Testing

Added regression coverage to zen/tests/urlbar/browser_floating_urlbar.js.

cd engine
./mach test zen/tests/urlbar/browser_floating_urlbar.js

<!-- codesmith:footer -->
---
<a href="https://app.blacksmith.sh/zen-browser/codesmith/desktop/pr/14697"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v2.svg"><source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-light-v2.svg"><img alt="View with [code]smith" src="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v2.svg"></picture></a> <a href="https://backend.blacksmith.sh/track/enable-autofix?expires=1787477622&installation_model_id=4703&pr_number=14697&repository=zen-browser%2Fdesktop&return_to=https%3A%2F%2Fgithub.com%2Fzen-browser%2Fdesktop%2Fpull%2F14697&signature=88d7781d281b3348cc8e421f9e275a50666f1b5d055d438005a40bb8854a4635"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-light.svg"><img alt="Autofix with [code]smith" src="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"></picture></a>
<sup>Need help on this PR? Tag <code>@codesmith-bot</code> with what you need. Autofix is disabled.</sup>

<!-- codesmith:autofix:disabled -->
<!-- /codesmith:footer -->

…ng mode

Keyboard focus (e.g. F6) only set the "focused" attribute without
opening the results view, so startLayoutExtend() never ran and
zen-floating-urlbar was never set. Clicking/typing floated correctly
because both open the view. Extend the autoOpen condition in
_on_focus to also open the view when zenUrlbarBehavior is "float",
reusing the existing open/close -> float/unfloat machinery.
@saberoueslati
saberoueslati requested a review from mr-cheffy as a code owner July 24, 2026 09:33
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. Bug labels Jul 24, 2026
@mr-cheffy

Copy link
Copy Markdown
Member

AI

@mr-cheffy mr-cheffy closed this Jul 24, 2026
@saberoueslati

saberoueslati commented Jul 24, 2026

Copy link
Copy Markdown
Author

@mr-cheffy yes I did use AI to help me specially write comments and the PR description but took the time to read its output and specially took the time to test thoroughly the solution, evidenced by the video I made of me testing.

Otherwise I also looked in the contributing guidelines, there's no mention of an anti AI or LLM policy, If I've seen that I would've not used it all.

Can you please clarify the stance of this repo concerning LLM and AI so I can be compliant ?, thank you.

@mr-cheffy mr-cheffy reopened this Jul 24, 2026
*
* @param {object} options Options object
* @param {Event} options.event The event associated with the call to autoOpen.
+ * @param {boolean} [options.allowFocusEvent] Whether a focus event is allowed

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.

No need for this comment, we try make patches small

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I deleted that comment

* @returns {boolean} Whether the view was opened.
*/
- autoOpen({ event, suppressFocusBorder = true }) {
+ autoOpen({

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.

No need to indent it, for the same reason

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Removed the indentation

@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jul 28, 2026
@saberoueslati
saberoueslati force-pushed the fix/gh-12076-f6-float-urlbar branch from 58ba0f0 to 8d5e9c1 Compare July 28, 2026 21:22
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Jul 28, 2026
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jul 28, 2026
@saberoueslati
saberoueslati requested a review from mr-cheffy August 3, 2026 23:22
@saberoueslati

Copy link
Copy Markdown
Author

@mr-cheffy made the changes asked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

F6 doesn't float url bar

2 participants