fix: Fixed compact mode hovering showing the urlbar for a moment, b=no-bug, c=workspaces, compact-mode, tests

This commit is contained in:
mr. m
2025-08-11 18:48:36 +02:00
parent 3229126f14
commit bf69ac13b2
6 changed files with 25 additions and 22 deletions

View File

@@ -66,4 +66,4 @@ zen-workspace-creation-header = Create a Space
zen-workspace-creation-label = Spaces are used to organize your tabs and sessions.
zen-workspaces-delete-workspace-title = Delete Space?
zen-workspaces-delete-workspace-body = Are you sure you want to delete this space? This action cannot be undone.
zen-workspaces-delete-workspace-body = Are you sure you want to delete { $name }? This action cannot be undone.

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/urlbar/UrlbarProviderPlaces.sys.mjs b/browser/components/urlbar/UrlbarProviderPlaces.sys.mjs
index 815734d9a5a589174ac33cb15ff9988d13e78b8c..227511238b13155f70d305bcbaa84dcd45a66e1c 100644
index 815734d9a5a589174ac33cb15ff9988d13e78b8c..adbd1e99987a92c9b79af8bcde204543e46e181f 100644
--- a/browser/components/urlbar/UrlbarProviderPlaces.sys.mjs
+++ b/browser/components/urlbar/UrlbarProviderPlaces.sys.mjs
@@ -40,11 +40,13 @@ function defaultQuery(conditions = "") {
@@ -7,7 +7,7 @@ index 815734d9a5a589174ac33cb15ff9988d13e78b8c..227511238b13155f70d305bcbaa84dcd
SELECT h.url, h.title, ${SQL_BOOKMARK_TAGS_FRAGMENT}, h.id, t.open_count,
${lazy.PAGES_FRECENCY_FIELD} AS frecency, t.userContextId,
- h.last_visit_date, t.groupId
+ h.last_visit_date, t.groupId, zp.title AS pinned_title, zp.url AS pinned_url
+ h.last_visit_date, t.groupId, zp.url AS pinned_url, zp.title AS pinned_title
FROM moz_places h
LEFT JOIN moz_openpages_temp t
ON t.url = h.url
@@ -30,7 +30,7 @@ index 815734d9a5a589174ac33cb15ff9988d13e78b8c..227511238b13155f70d305bcbaa84dcd
? lazy.PlacesUtils.toDate(lastVisitPRTime).getTime()
: undefined;
let tabGroup = row.getResultByName("groupId");
+ let pinnedTitle = row.getResultByIndex("pinned_title");
+ let pinnedTitle = row.getResultByIndex(12);
+ let pinnedUrl = row.getResultByIndex("pinned_url");
let match = {

View File

@@ -520,8 +520,6 @@ var gZenCompactModeManager = {
addMouseActions() {
gURLBar.textbox.addEventListener('mouseenter', (event) => {
if (event.target.closest('#urlbar[zen-floating-urlbar]')) {
// Ignore sidebar mouse enter if the urlbar is floating
this.clearFlashTimeout('has-hover' + gZenVerticalTabsManager._hasSetSingleToolbar);
window.requestAnimationFrame(() => {
this.sidebar.removeAttribute('zen-has-hover');
});
@@ -537,14 +535,16 @@ var gZenCompactModeManager = {
if (event.type === 'mouseenter' && !event.target.matches(':hover')) return;
// Dont register the hover if the urlbar is floating and we are hovering over it
this.clearFlashTimeout('has-hover' + target.id);
if (
document.documentElement.getAttribute('supress-primary-adjustment') === 'true' ||
this._hasHoveredUrlbar
) {
return;
}
window.requestAnimationFrame(() => target.setAttribute('zen-has-hover', 'true'));
}, 0);
window.requestAnimationFrame(() => {
if (
document.documentElement.getAttribute('supress-primary-adjustment') === 'true' ||
this._hasHoveredUrlbar
) {
return;
}
target.setAttribute('zen-has-hover', 'true');
});
}, this.HOVER_HACK_DELAY);
};
const onLeave = (event) => {
@@ -585,6 +585,7 @@ var gZenCompactModeManager = {
gZenVerticalTabsManager._hasSetSingleToolbar) ||
this._hasHoveredUrlbar
) {
delete this._hasHoveredUrlbar;
return;
}
@@ -641,12 +642,6 @@ var gZenCompactModeManager = {
}
}, this.HOVER_HACK_DELAY);
});
gURLBar.textbox.addEventListener('mouseleave', () => {
setTimeout(() => {
delete this._hasHoveredUrlbar;
}, 0);
});
},
_getCrossedEdge(posX, posY, element = document.documentElement, maxDistance = 10) {

View File

@@ -48,6 +48,11 @@ add_task(async function test_Search_Pinned_Title() {
'https://example.com/1',
`Should have the found result '${url}' in the expected list of entries`
);
Assert.equal(
result?.title,
customLabel,
`Should have the found result '${result?.title}' in the expected list of entries`
);
BrowserTestUtils.removeTab(gBrowser.selectedTab);
resolvePromise();

View File

@@ -2550,7 +2550,10 @@ var gZenWorkspaces = new (class extends nsZenMultiWindowFeature {
const workspaceId = this.#contextMenuData?.workspaceId || this.activeWorkspace;
const [title, body] = await document.l10n.formatValues([
{ id: 'zen-workspaces-delete-workspace-title' },
{ id: 'zen-workspaces-delete-workspace-body' },
{
id: 'zen-workspaces-delete-workspace-body',
args: { name: this.getWorkspaceFromId(workspaceId).name },
},
]);
if (Services.prompt.confirm(null, title, body)) {
await this.removeWorkspace(workspaceId);

View File

@@ -19,7 +19,7 @@
"brandShortName": "Zen",
"brandFullName": "Zen Browser",
"release": {
"displayVersion": "1.14.11b",
"displayVersion": "1.14.12b",
"github": {
"repo": "zen-browser/desktop"
},