mirror of
https://github.com/zen-browser/desktop.git
synced 2026-04-26 17:24:25 +00:00
feat(glance): Add Ctrl/Cmd+O shortcut to expand Glance; user-configurable via Keyboard Shortcuts; tooltips, p=#10271
This commit is contained in:
@@ -617,6 +617,10 @@
|
||||
}
|
||||
|
||||
async fullyOpenGlance({ forSplit = false } = {}) {
|
||||
// If there is no active glance, do nothing
|
||||
if (!this.#currentGlanceID || !this.#currentTab) {
|
||||
return;
|
||||
}
|
||||
this.animatingFullOpen = true;
|
||||
this.#currentTab.setAttribute('zen-dont-split-glance', true);
|
||||
|
||||
|
||||
@@ -773,7 +773,7 @@ class nsZenKeyboardShortcutsLoader {
|
||||
}
|
||||
|
||||
class nsZenKeyboardShortcutsVersioner {
|
||||
static LATEST_KBS_VERSION = 9;
|
||||
static LATEST_KBS_VERSION = 10;
|
||||
|
||||
constructor() {}
|
||||
|
||||
@@ -838,7 +838,14 @@ class nsZenKeyboardShortcutsVersioner {
|
||||
}
|
||||
|
||||
fixedKeyboardShortcuts(data) {
|
||||
return this.fillDefaultIfNotPresent(this.migrateIfNeeded(data));
|
||||
// Apply migrations and ensure defaults exist
|
||||
let out = this.fillDefaultIfNotPresent(this.migrateIfNeeded(data));
|
||||
|
||||
// Hard-remove deprecated or conflicting defaults regardless of version
|
||||
// - Remove the built-in "Open File" keybinding; menu item remains available
|
||||
out = out.filter((shortcut) => shortcut.getAction?.() !== 'Browser:OpenFile');
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
migrate(data, version) {
|
||||
@@ -993,6 +1000,24 @@ class nsZenKeyboardShortcutsVersioner {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (version < 10) {
|
||||
// Migrate from version 9 to 10
|
||||
// 1) Add shortcut to expand Glance into a full tab: Default Accel+O
|
||||
data.push(
|
||||
new KeyShortcut(
|
||||
'zen-glance-expand',
|
||||
'O',
|
||||
'',
|
||||
ZEN_OTHER_SHORTCUTS_GROUP,
|
||||
nsKeyShortcutModifiers.fromObject({ accel: true }),
|
||||
'cmd_zenGlanceExpand',
|
||||
''
|
||||
)
|
||||
);
|
||||
|
||||
// 2) Remove default Open File keybinding entirely (menu item remains available)
|
||||
data = data.filter((shortcut) => shortcut.getAction?.() !== 'Browser:OpenFile');
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user