From 685cddf7c283bbd997b8c5f92a6701a20ba063e3 Mon Sep 17 00:00:00 2001 From: "mr. m" Date: Fri, 1 May 2026 19:11:12 +0200 Subject: [PATCH] no-bug: Add space button --- locales/en-US/browser/browser/zen-general.ftl | 2 + .../base/content/zen-panels/spaces-search.inc | 23 +++ .../base/content/zen-popupset.inc.xhtml | 1 + src/zen/common/moz.build | 1 + src/zen/common/sys/ZenSearchPopup.sys.mjs | 152 ++++++++++++++++++ src/zen/folders/ZenFolders.mjs | 106 ++---------- src/zen/little-window/ZenLittleWindow.sys.mjs | 2 + src/zen/little-window/ZenSpacesSearch.sys.mjs | 142 ++++++++++++++++ src/zen/little-window/moz.build | 1 + src/zen/little-window/zen-little-window.css | 124 +++++++++++++- 10 files changed, 459 insertions(+), 95 deletions(-) create mode 100644 src/browser/base/content/zen-panels/spaces-search.inc create mode 100644 src/zen/common/sys/ZenSearchPopup.sys.mjs create mode 100644 src/zen/little-window/ZenSpacesSearch.sys.mjs diff --git a/locales/en-US/browser/browser/zen-general.ftl b/locales/en-US/browser/browser/zen-general.ftl index d1229b04f..fa55d4811 100644 --- a/locales/en-US/browser/browser/zen-general.ftl +++ b/locales/en-US/browser/browser/zen-general.ftl @@ -151,3 +151,5 @@ zen-window-sync-migration-dialog-accept = Got It zen-appmenu-new-blank-window = .label = New blank window +zen-spaces-search-placeholder = + .placeholder = Search your spaces... diff --git a/src/browser/base/content/zen-panels/spaces-search.inc b/src/browser/base/content/zen-panels/spaces-search.inc new file mode 100644 index 000000000..1b676c2dd --- /dev/null +++ b/src/browser/base/content/zen-panels/spaces-search.inc @@ -0,0 +1,23 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + diff --git a/src/browser/base/content/zen-popupset.inc.xhtml b/src/browser/base/content/zen-popupset.inc.xhtml index 9d6e1c06c..c19efc783 100644 --- a/src/browser/base/content/zen-popupset.inc.xhtml +++ b/src/browser/base/content/zen-popupset.inc.xhtml @@ -5,6 +5,7 @@ #include zen-panels/theme-picker.inc #include zen-panels/emojis-picker.inc #include zen-panels/folders-search.inc +#include zen-panels/spaces-search.inc #include zen-panels/site-data.inc #include zen-panels/popups.inc diff --git a/src/zen/common/moz.build b/src/zen/common/moz.build index 115234dad..27dfec3c4 100644 --- a/src/zen/common/moz.build +++ b/src/zen/common/moz.build @@ -5,6 +5,7 @@ EXTRA_JS_MODULES += [ "sys/ZenActorsManager.sys.mjs", "sys/ZenCustomizableUI.sys.mjs", + "sys/ZenSearchPopup.sys.mjs", "sys/ZenUIMigration.sys.mjs", ] diff --git a/src/zen/common/sys/ZenSearchPopup.sys.mjs b/src/zen/common/sys/ZenSearchPopup.sys.mjs new file mode 100644 index 000000000..3f36410cc --- /dev/null +++ b/src/zen/common/sys/ZenSearchPopup.sys.mjs @@ -0,0 +1,152 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* + * Generic searchable XUL driver. One instance owns one panel + + * its search input + list + (optional) no-results element, and exposes + * `populate(items)` and `open(anchor, options)`. + * + * Each item passed to `populate` is `{ label, render?, onPick }`: + * - label: string used for the data-label search filter. + * - render: optional () => Element factory. If omitted a bare hbox + * with a