From d47ae66aa2cf02eb8b48c8a403984d82909e049c Mon Sep 17 00:00:00 2001 From: "burrito.space" Date: Wed, 29 Jul 2026 16:45:49 +0200 Subject: [PATCH] =?UTF-8?q?fix(desktop):=20remove=20the=20groups=20hotkey?= =?UTF-8?q?=20entirely=20=E2=80=94=20its=20manifest=20entry=20grabbed=20Co?= =?UTF-8?q?mmandOrControl+G=20OS-wide=20and=20stole=20macOS=20Find=20Again?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/desktop/features/groups/config.js | 17 +---- apps/desktop/features/groups/home.js | 73 +------------------ apps/desktop/features/groups/manifest.json | 8 +- .../features/groups/settings-schema.json | 12 +-- 4 files changed, 9 insertions(+), 101 deletions(-) diff --git a/apps/desktop/features/groups/config.js b/apps/desktop/features/groups/config.js index 47046d6a..fc955a47 100644 --- a/apps/desktop/features/groups/config.js +++ b/apps/desktop/features/groups/config.js @@ -2,9 +2,7 @@ const id = 'groups'; const labels = { name: 'Groups', - prefs: { - shortcutKey: 'Groups shortcut', - } + prefs: {} }; const prefsSchema = { @@ -13,14 +11,7 @@ const prefsSchema = { "title": "Groups preferences", "description": "Peek app Groups user preferences", "type": "object", - "properties": { - "shortcutKey": { - "description": "Global OS hotkey to open command panel", - "type": "string", - "default": "Option+Space" - }, - }, - "required": [ "shortcutKey"] + "properties": {} }; const schemas = { @@ -32,9 +23,7 @@ const storageKeys = { }; const defaults = { - prefs: { - shortcutKey: 'Option+g' - }, + prefs: {}, }; export { diff --git a/apps/desktop/features/groups/home.js b/apps/desktop/features/groups/home.js index 2376f20a..62491df9 100644 --- a/apps/desktop/features/groups/home.js +++ b/apps/desktop/features/groups/home.js @@ -19,7 +19,7 @@ import { } from 'peek://app/lib/tag-action-affordances.js'; import { createSearchResultCard } from 'peek://app/lib/search-result-card.js'; import { liveQuery } from 'peek://app/lib/live-query.js'; -import { labels, defaults } from './config.js'; +import { labels } from './config.js'; import { registerNoun, unregisterNoun } from 'peek://cmd/nouns.js'; const api = window.app; @@ -341,8 +341,8 @@ const setupCreateGroup = () => { // ============================================================================ // Background logic (inlined from background.js) // ============================================================================ -// Commands, shortcuts, bulk-open (openGroup), pins, close/switch/restore, -// settings load/save, and shutdown-related pubsub subscriptions. +// Commands, bulk-open (openGroup), pins, close/switch/restore, and +// shutdown-related pubsub subscriptions. // Runs once at module load (see bootstrap IIFE at bottom), NOT inside the // DOMContentLoaded init() — keeps UI init path clean. @@ -351,11 +351,6 @@ console.log('[ext:groups] background', labels.name); // Extension content is served from peek://groups/ const bgAddress = 'peek://groups/home.html'; -// In-memory settings cache (loaded from datastore during bg init) -let currentSettings = { - prefs: defaults.prefs -}; - // Track the groups window ID for mode cleanup (from bg-initiated opens) let groupsWindowId = null; @@ -366,23 +361,6 @@ let activeGroupName = null; // Track suspended (hidden) group windows: groupId -> [windowId, ...] const suspendedGroups = new Map(); -/** Load settings from datastore */ -const loadSettings = async () => { - const result = await api.settings.get('prefs'); - if (!result.error && result.value) { - return { prefs: result.value || defaults.prefs }; - } - return { prefs: defaults.prefs }; -}; - -/** Save settings to datastore */ -const saveSettings = async (settings) => { - const result = await api.settings.set('prefs', settings.prefs); - if (result.error) { - console.error('[ext:groups] Failed to save settings:', result.error); - } -}; - let isOpeningGroups = false; const openGroupsWindow = async () => { if (isOpeningGroups) return; @@ -790,15 +768,6 @@ const openGroup = async (groupName) => { // ===== Registration ===== -let registeredShortcut = null; -const LOCAL_SHORTCUT = 'CommandOrControl+G'; - -const initShortcut = (shortcut) => { - api.shortcuts.register(shortcut, () => { openGroupsWindow(); }, { global: true }); - registeredShortcut = shortcut; - api.shortcuts.register(LOCAL_SHORTCUT, () => { openGroupsWindow(); }); -}; - const initCommands = () => { registerNoun({ name: 'groups', @@ -898,8 +867,6 @@ const uninitCommands = () => { const initBackground = async () => { console.log('[ext:groups] init'); - currentSettings = await loadSettings(); - initShortcut(currentSettings.prefs.shortcutKey); initCommands(); api.pubsub.subscribe('window:closed', async (msg) => { @@ -908,44 +875,10 @@ const initBackground = async () => { groupsWindowId = null; } }); - - api.pubsub.subscribe('groups:settings-changed', async () => { - console.log('[ext:groups] settings changed, reinitializing'); - uninitBackground(); - currentSettings = await loadSettings(); - initShortcut(currentSettings.prefs.shortcutKey); - initCommands(); - }); - - api.pubsub.subscribe('groups:settings-update', async (msg) => { - console.log('[ext:groups] settings-update received:', msg); - try { - if (msg.data) { - currentSettings = { prefs: msg.data.prefs || currentSettings.prefs }; - } else if (msg.key === 'prefs' && msg.path) { - const field = msg.path.split('.')[1]; - if (field) { - currentSettings.prefs = { ...currentSettings.prefs, [field]: msg.value }; - } - } - await saveSettings(currentSettings); - uninitBackground(); - initShortcut(currentSettings.prefs.shortcutKey); - initCommands(); - api.pubsub.publish('groups:settings-changed', currentSettings); - } catch (err) { - console.error('[ext:groups] settings-update error:', err); - } - }); }; const uninitBackground = () => { console.log('[ext:groups] uninit'); - if (registeredShortcut) { - api.shortcuts.unregister(registeredShortcut, { global: true }); - registeredShortcut = null; - } - api.shortcuts.unregister(LOCAL_SHORTCUT); uninitCommands(); }; diff --git a/apps/desktop/features/groups/manifest.json b/apps/desktop/features/groups/manifest.json index a593f422..4630a668 100644 --- a/apps/desktop/features/groups/manifest.json +++ b/apps/desktop/features/groups/manifest.json @@ -50,7 +50,6 @@ "queryWindows": true }, "commands": true, - "shortcuts": true, "settings": { "readForeign": ["spaces"] }, "rules": true }, @@ -95,11 +94,6 @@ "action": { "type": "execute" } } ], - "shortcuts": [ - { - "keys": "CommandOrControl+G", - "command": "groups" - } - ], + "shortcuts": [], "settingsSchema": "./settings-schema.json" } diff --git a/apps/desktop/features/groups/settings-schema.json b/apps/desktop/features/groups/settings-schema.json index bf82d9d0..3c57000a 100644 --- a/apps/desktop/features/groups/settings-schema.json +++ b/apps/desktop/features/groups/settings-schema.json @@ -1,20 +1,12 @@ { "prefs": { "type": "object", - "properties": { - "shortcutKey": { - "type": "string", - "description": "Global OS hotkey to open groups manager", - "default": "Option+g" - } - } + "properties": {} }, "storageKeys": { "PREFS": "prefs" }, "defaults": { - "prefs": { - "shortcutKey": "Option+g" - } + "prefs": {} } } -- 2.51.2