feat(glance): Add Ctrl/Cmd+O shortcut to expand Glance; user-configurable via Keyboard Shortcuts; tooltips, p=#10271

This commit is contained in:
Kyle Kincer
2025-09-11 12:02:55 -04:00
committed by GitHub
parent 5933c55c13
commit 7fb6c78784
2 changed files with 31 additions and 2 deletions

View File

@@ -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);

View File

@@ -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;
}
}