From 35867519ba219f9c5d4f16c571e87d0cf82875ee Mon Sep 17 00:00:00 2001 From: viny Date: Thu, 30 Jul 2026 04:14:58 +0530 Subject: [PATCH 1/4] docs: correct the macOS install instructions The README told users to right-click and choose Open. Apple removed that shortcut in macOS 15, so on current systems it does nothing and the app looks unopenable. The current path is System Settings -> Privacy & Security -> Open Anyway. Also records the exact wording macOS now uses ("could not verify ... free of malware"), since that is what people will search for, and notes in SECURITY.md that the ad-hoc signature is what stops the older "is damaged" error without amounting to a Developer ID. --- README.md | 11 +++++++++-- SECURITY.md | 4 +++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4f883d9..7f2e359 100644 --- a/README.md +++ b/README.md @@ -73,8 +73,15 @@ Download the build for your platform from [Releases](https://github.com/viny4/pa Builds are **not code-signed**, because signing certificates cost money this project doesn't have. That means: -- **macOS** will say the app "cannot be opened because the developer cannot be verified". Right-click the app → Open → Open. - - If it instead says **"Panebox is damaged and can't be opened"**, that is Gatekeeper rejecting a quarantined app, not a bad download. Run `xattr -dr com.apple.quarantine /Applications/Panebox.app` and open it again. +- **macOS** will say *"Apple could not verify Panebox.app is free of malware"*. The app is fine — macOS simply cannot check a developer it does not know. + + Click **Done** (never "Move to Bin"), then open **System Settings → Privacy & Security**, scroll to the bottom, and click **Open Anyway** next to "Panebox.app was blocked". + + On macOS 15 and later, right-clicking the app and choosing Open no longer works; Apple removed that shortcut. If you would rather use the terminal: + + ```bash + xattr -dr com.apple.quarantine /Applications/Panebox.app + ``` - **Windows** will show a SmartScreen warning. Click "More info" → "Run anyway". If that trade-off isn't acceptable to you, build from source — it takes two commands. diff --git a/SECURITY.md b/SECURITY.md index c083062..fa1eb5d 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -29,7 +29,9 @@ Panebox loads arbitrary third-party websites, so the boundaries matter. What's i **Custom JavaScript per service.** Panebox lets you paste JavaScript that runs inside a service, with full access to that service and your logged-in session. This is intentional, opt-in, off by default, and warned about in the UI. Only paste code you understand. -**Builds are unsigned.** Releases are not code-signed on macOS or Windows, because certificates cost money this project doesn't have. Verify what you download, or build from source. +**Builds are unsigned and un-notarized.** Releases carry only an ad-hoc signature — enough for macOS to run them at all, but not a Developer ID. macOS will say it "could not verify Panebox is free of malware", and Windows will show SmartScreen. Both are accurate: nobody has vouched for these binaries. Verify what you download, or build from source. + +Practically, this also means auto-update cannot install itself on macOS: Squirrel refuses to update an app without a valid signature, so macOS gets a notification and a download link instead. **No sandboxing of service content beyond Chromium's own.** Panebox is a container around real websites. If a site is malicious, Chromium's sandbox and the session isolation above are what stand between it and you — the same as any browser. From beb5c2525f32a8ec9698ef735a8ec1cd3b08c126 Mon Sep 17 00:00:00 2001 From: viny Date: Thu, 30 Jul 2026 04:22:20 +0530 Subject: [PATCH 2/4] feat: Shortcuts tab in Settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every binding lived in three places — the application menu, the renderer's keydown handler, and mouse gestures with no written record at all. Nothing told a user that triple-clicking a pane header detaches it. Settings -> Shortcuts now lists all of them, grouped, with ⌘⇧⌥ on macOS and Ctrl/Shift/Alt elsewhere, and platform-only rows filtered out. The list is data in lib/shortcuts.js, and a test asserts that every accelerator declared in the menu appears in it. A stale shortcut list is worse than none, so this fails the build rather than misleading anyone. Writing that test found Developer Tools was undocumented: its accelerator is a ternary, which the first version of the scan did not match. --- index.html | 6 +++ lib/shortcuts.js | 82 +++++++++++++++++++++++++++++++++++ renderer.js | 44 +++++++++++++++++++ styles.css | 28 ++++++++++++ test/shortcuts.test.js | 98 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 258 insertions(+) create mode 100644 lib/shortcuts.js create mode 100644 test/shortcuts.test.js diff --git a/index.html b/index.html index 7d4539c..b5e206b 100644 --- a/index.html +++ b/index.html @@ -149,6 +149,7 @@

Settings

+
@@ -231,6 +232,10 @@

Settings

+ +
+
+
@@ -321,6 +326,7 @@

Choose what to share

+ diff --git a/lib/shortcuts.js b/lib/shortcuts.js new file mode 100644 index 0000000..7174b50 --- /dev/null +++ b/lib/shortcuts.js @@ -0,0 +1,82 @@ +/** + * Every shortcut and gesture in the app, in one place. + * + * This is what the Settings → Shortcuts tab renders. A test checks that every + * accelerator declared in the application menu appears here, so the list + * cannot quietly fall out of date with the real bindings. + * + * Keys are tokens rather than rendered strings: "mod" becomes ⌘ on macOS and + * Ctrl everywhere else. + */ +(function (root, factory) { + if (typeof module === 'object' && module.exports) module.exports = factory(); + else root.SHORTCUTS = factory(); +})(typeof self !== 'undefined' ? self : this, function () { + const SECTIONS = [ + { + title: 'Services', + items: [ + { keys: ['mod', '1'], label: 'Jump to the first service (1–9)' }, + { keys: ['mod', 'Tab'], label: 'Next service' }, + { keys: ['mod', 'shift', 'Tab'], label: 'Previous service' }, + { keys: ['mod', 'N'], label: 'Add a service' }, + { keys: ['mod', 'R'], label: 'Reload the current service' }, + ], + }, + { + title: 'Layout', + items: [ + { keys: ['mod', 'shift', 'S'], label: 'Split view — several services at once' }, + { keys: ['mod', 'B'], label: 'Show or hide the sidebar' }, + { keys: ['mod', 'T'], label: 'Todo panel' }, + { keys: ['Esc'], label: 'Step back: close a menu, then the spotlight, then the grid' }, + ], + }, + { + title: 'Window', + items: [ + { keys: ['mod', 'F'], label: 'Find in page' }, + { keys: ['mod', ','], label: 'Settings' }, + { keys: ['mod', 'shift', 'M'], label: 'Task manager' }, + { keys: ['mod', 'shift', 'R'], label: 'Restart Panebox' }, + { keys: ['alt', 'mod', 'I'], label: 'Developer tools', mac: true }, + { keys: ['ctrl', 'shift', 'I'], label: 'Developer tools', win: true }, + { keys: ['mod', 'ctrl', 'F'], label: 'Full screen', mac: true }, + { keys: ['mod', 'Q'], label: 'Quit', mac: true }, + ], + }, + { + title: 'Mouse', + mouse: true, + items: [ + { gesture: 'Right-click a sidebar icon', label: 'Configure that service' }, + { gesture: 'Drag a sidebar icon', label: 'Reorder your services' }, + { gesture: 'Drag a sidebar icon onto the grid', label: 'Add it as a pane' }, + { gesture: 'Click a sidebar icon while in split view', label: 'Add or remove that pane' }, + { gesture: 'Double-click a pane header', label: 'Expand that pane' }, + { gesture: 'Triple-click a pane header', label: 'Open that service on its own' }, + { gesture: 'Drag the ⠿ handle in Settings → Services', label: 'Reorder your services' }, + ], + }, + ]; + + const MAC_SYMBOLS = { mod: '⌘', shift: '⇧', alt: '⌥', ctrl: '⌃', Esc: 'esc', Tab: '⇥' }; + const PC_SYMBOLS = { mod: 'Ctrl', shift: 'Shift', alt: 'Alt', ctrl: 'Ctrl', Esc: 'Esc', Tab: 'Tab' }; + + /** Renders one key token for the given platform. */ + function keyLabel(token, isMac) { + const table = isMac ? MAC_SYMBOLS : PC_SYMBOLS; + return table[token] || token; + } + + /** The sections that apply to a platform, with mac-only rows filtered out. */ + function forPlatform(platform) { + const isMac = platform === 'darwin'; + return SECTIONS.map((section) => ({ + ...section, + items: section.items.filter((item) => (item.mac ? isMac : item.win ? !isMac : true)), + })).filter((section) => section.items.length); + } + + return { SECTIONS, forPlatform, keyLabel }; +}); diff --git a/renderer.js b/renderer.js index 9672e7c..74ed39d 100644 --- a/renderer.js +++ b/renderer.js @@ -1147,6 +1147,48 @@ function commitManageOrder() { } } +/** Settings → Shortcuts. Rendered from lib/shortcuts.js, not hand-listed here. */ +function renderShortcuts() { + const root = $('shortcut-list'); + root.textContent = ''; + const isMac = window.panebox.platform === 'darwin'; + + for (const section of window.SHORTCUTS.forPlatform(window.panebox.platform)) { + const heading = document.createElement('h4'); + heading.className = 'shortcut-heading'; + heading.textContent = section.title; + root.appendChild(heading); + + for (const item of section.items) { + const row = document.createElement('div'); + row.className = 'shortcut-row'; + + const label = document.createElement('span'); + label.className = 'shortcut-label'; + label.textContent = item.label; + + const combo = document.createElement('span'); + combo.className = 'shortcut-keys'; + + if (item.gesture) { + const g = document.createElement('span'); + g.className = 'shortcut-gesture'; + g.textContent = item.gesture; + combo.appendChild(g); + } else { + for (const token of item.keys) { + const key = document.createElement('kbd'); + key.textContent = window.SHORTCUTS.keyLabel(token, isMac); + combo.appendChild(key); + } + } + + row.append(label, combo); + root.appendChild(row); + } + } +} + function renderWorkspaceList() { const list = $('workspace-list'); list.textContent = ''; @@ -1904,6 +1946,7 @@ document.addEventListener('DOMContentLoaded', () => { fillSettingsForm(); renderManageList(); renderWorkspaceList(); + renderShortcuts(); openModal('settings-modal'); }); $('btn-workspace').addEventListener('click', (e) => { @@ -2070,6 +2113,7 @@ document.addEventListener('DOMContentLoaded', () => { fillSettingsForm(); renderManageList(); renderWorkspaceList(); + renderShortcuts(); openModal('settings-modal'); }); window.panebox.menu.onOpenAdd(() => { diff --git a/styles.css b/styles.css index ca3c96a..057ffa1 100644 --- a/styles.css +++ b/styles.css @@ -732,3 +732,31 @@ body.reordering webview { pointer-events: none; } width: 18px; height: 18px; flex-shrink: 0; border-radius: 4px; font-size: 8px; } #split-menu { max-height: 320px; overflow-y: auto; } + +/* ---------------------------------------------------------- shortcuts tab */ + +.shortcut-heading { + font-size: 11px; font-weight: 600; text-transform: uppercase; + letter-spacing: .05em; color: var(--text-dim); + margin: 18px 0 6px; padding-bottom: 5px; border-bottom: 1px solid var(--border); +} +.shortcut-heading:first-child { margin-top: 0; } + +.shortcut-row { + display: flex; align-items: center; justify-content: space-between; + gap: 16px; padding: 8px 0; +} +.shortcut-label { font-size: 13px; color: var(--text); } +.shortcut-keys { display: flex; align-items: center; gap: 4px; flex-shrink: 0; } + +.shortcut-keys kbd { + display: inline-flex; align-items: center; justify-content: center; + min-width: 24px; height: 24px; padding: 0 7px; + background: var(--bg-sunken); border: 1px solid var(--border); + border-bottom-width: 2px; border-radius: 6px; + font-family: inherit; font-size: 12px; color: var(--text); +} +.shortcut-gesture { + font-size: 11.5px; color: var(--text-muted); text-align: right; + max-width: 260px; line-height: 1.35; +} diff --git a/test/shortcuts.test.js b/test/shortcuts.test.js new file mode 100644 index 0000000..8fa170c --- /dev/null +++ b/test/shortcuts.test.js @@ -0,0 +1,98 @@ +'use strict'; + +const test = require('node:test'); +const assert = require('node:assert'); +const fs = require('node:fs'); +const path = require('node:path'); + +const SHORTCUTS = require('../lib/shortcuts'); + +const root = path.join(__dirname, '..'); +const mainJs = fs.readFileSync(path.join(root, 'main.js'), 'utf8'); +const rendererJs = fs.readFileSync(path.join(root, 'renderer.js'), 'utf8'); + +/** "CmdOrCtrl+Shift+S" -> "mod+shift+s", so both sides compare the same way. */ +function normalize(accelerator) { + return accelerator + .split('+') + .map((part) => { + const p = part.trim().toLowerCase(); + if (p === 'cmdorctrl' || p === 'cmd' || p === 'command' || p === 'mod') return 'mod'; + if (p === 'ctrl' || p === 'control') return 'ctrl'; + if (p === 'alt' || p === 'option') return 'alt'; + return p; + }) + .sort() + .join('+'); +} + +function documented() { + const out = new Set(); + for (const section of SHORTCUTS.SECTIONS) { + for (const item of section.items) { + if (item.keys) out.add(normalize(item.keys.join('+'))); + } + } + return out; +} + +test('every accelerator in the application menu is documented', () => { + // Without this the Shortcuts tab drifts: a binding changes in main.js and the + // list keeps advertising the old key, which is worse than no list at all. + const listed = documented(); + const missing = []; + + // Only the value that follows `accelerator:` — a line-wide scan also picked + // up labels and IPC channel names. Both branches of a ternary count, since + // `accelerator: isMac ? 'Alt+Cmd+I' : 'Ctrl+Shift+I'` went undocumented + // behind a simpler pattern. + const accelerators = []; + for (const m of mainJs.matchAll(/accelerator:\s*'([^']+)'/g)) accelerators.push(m[1]); + for (const m of mainJs.matchAll(/accelerator:[^'\n]*\?\s*'([^']+)'\s*:\s*'([^']+)'/g)) { + accelerators.push(m[1], m[2]); + } + + for (const accel of accelerators) { + // Roles GitHub/Electron provide for free and that users already know. + if (/^(CmdOrCtrl\+(C|V|X|Z|A))$/i.test(accel)) continue; + if (!listed.has(normalize(accel))) missing.push(accel); + } + + assert.deepStrictEqual( + missing, + [], + `menu accelerators missing from lib/shortcuts.js:\n ${missing.join('\n ')}`, + ); +}); + +test('the number-key shortcut is documented', () => { + // Handled in the renderer rather than the menu, so the scan above misses it. + assert.ok(rendererJs.includes("e.key >= '1' && e.key <= '9'"), 'renderer still binds 1-9'); + assert.ok(documented().has(normalize('mod+1')), 'Shortcuts tab must mention it'); +}); + +test('mac-only entries are hidden on other platforms', () => { + const mac = SHORTCUTS.forPlatform('darwin'); + const win = SHORTCUTS.forPlatform('win32'); + const flat = (s) => s.flatMap((x) => x.items).map((i) => i.label); + + assert.ok(flat(mac).includes('Quit'), 'Quit is a macOS menu item'); + assert.ok(!flat(win).includes('Quit'), 'and should not be advertised on Windows'); +}); + +test('keys render with the right symbols per platform', () => { + assert.strictEqual(SHORTCUTS.keyLabel('mod', true), '⌘'); + assert.strictEqual(SHORTCUTS.keyLabel('mod', false), 'Ctrl'); + assert.strictEqual(SHORTCUTS.keyLabel('shift', true), '⇧'); + assert.strictEqual(SHORTCUTS.keyLabel('shift', false), 'Shift'); + assert.strictEqual(SHORTCUTS.keyLabel('S', true), 'S'); +}); + +test('every documented shortcut has a description', () => { + for (const section of SHORTCUTS.SECTIONS) { + for (const item of section.items) { + assert.ok(item.label && item.label.length > 3, `missing label in ${section.title}`); + assert.ok(item.keys || item.gesture, `${item.label} has neither keys nor a gesture`); + } + } +}); From ea62c18076e55eb3293f851db98f62642e10a9b5 Mon Sep 17 00:00:00 2001 From: viny Date: Thu, 30 Jul 2026 04:27:01 +0530 Subject: [PATCH 3/4] feat: show macOS and Windows/Linux keys side by side MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Shortcuts tab only listed the platform you happened to be running, which makes it useless as documentation — someone on a Mac writing an issue for a Windows user could not see their keys. Two columns now, with the running platform highlighted and the other dimmed. Rows where the platforms genuinely differ are stated separately rather than assumed: Developer tools is ⌥⌘I against Ctrl+Shift+I, Full screen is ⌃⌘F against F11. Quit shows "—" for Windows and Linux. Electron's quit role registers no accelerator there, and printing "Ctrl+Q" would be inventing one. --- lib/shortcuts.js | 46 +++++++++++++++++++++++++++----------- renderer.js | 50 +++++++++++++++++++++++++++++++----------- styles.css | 18 +++++++++++++-- test/shortcuts.test.js | 40 ++++++++++++++++++++++++++------- 4 files changed, 118 insertions(+), 36 deletions(-) diff --git a/lib/shortcuts.js b/lib/shortcuts.js index 7174b50..b08fd32 100644 --- a/lib/shortcuts.js +++ b/lib/shortcuts.js @@ -39,10 +39,12 @@ { keys: ['mod', ','], label: 'Settings' }, { keys: ['mod', 'shift', 'M'], label: 'Task manager' }, { keys: ['mod', 'shift', 'R'], label: 'Restart Panebox' }, - { keys: ['alt', 'mod', 'I'], label: 'Developer tools', mac: true }, - { keys: ['ctrl', 'shift', 'I'], label: 'Developer tools', win: true }, - { keys: ['mod', 'ctrl', 'F'], label: 'Full screen', mac: true }, - { keys: ['mod', 'Q'], label: 'Quit', mac: true }, + // These differ per platform rather than being a plain "mod" swap. + { mac: ['alt', 'cmd', 'I'], win: ['ctrl', 'shift', 'I'], label: 'Developer tools' }, + { mac: ['ctrl', 'cmd', 'F'], win: ['F11'], label: 'Full screen' }, + // Electron's quit role registers no accelerator on Windows or Linux; + // Alt+F4 closes the window there. Saying "Ctrl+Q" would be a guess. + { mac: ['cmd', 'Q'], win: null, label: 'Quit' }, ], }, { @@ -60,8 +62,8 @@ }, ]; - const MAC_SYMBOLS = { mod: '⌘', shift: '⇧', alt: '⌥', ctrl: '⌃', Esc: 'esc', Tab: '⇥' }; - const PC_SYMBOLS = { mod: 'Ctrl', shift: 'Shift', alt: 'Alt', ctrl: 'Ctrl', Esc: 'Esc', Tab: 'Tab' }; + const MAC_SYMBOLS = { mod: '⌘', cmd: '⌘', shift: '⇧', alt: '⌥', ctrl: '⌃', Esc: 'esc', Tab: '⇥' }; + const PC_SYMBOLS = { mod: 'Ctrl', cmd: 'Ctrl', shift: 'Shift', alt: 'Alt', ctrl: 'Ctrl', Esc: 'Esc', Tab: 'Tab' }; /** Renders one key token for the given platform. */ function keyLabel(token, isMac) { @@ -69,14 +71,32 @@ return table[token] || token; } - /** The sections that apply to a platform, with mac-only rows filtered out. */ - function forPlatform(platform) { - const isMac = platform === 'darwin'; + /** + * Both platforms for every row, so the list works as documentation and not + * only as a reminder for whatever machine you happen to be on. + * + * `keys` means the same combination on both, with "mod" resolving to ⌘ or + * Ctrl. `mac` and `win` are for the cases where they genuinely differ, and a + * null side means there is no binding on that platform. + */ + function rows() { return SECTIONS.map((section) => ({ - ...section, - items: section.items.filter((item) => (item.mac ? isMac : item.win ? !isMac : true)), - })).filter((section) => section.items.length); + title: section.title, + mouse: !!section.mouse, + items: section.items.map((item) => ({ + label: item.label, + gesture: item.gesture || null, + mac: item.gesture ? null : (item.mac || item.keys || null), + win: item.gesture ? null : (item.win !== undefined ? item.win : item.keys || null), + })), + })); } - return { SECTIONS, forPlatform, keyLabel }; + /** Renders one side of a row: ["⌘","⇧","S"] or null when unbound. */ + function render(keys, isMac) { + if (!keys) return null; + return keys.map((k) => keyLabel(k, isMac)); + } + + return { SECTIONS, rows, render, keyLabel }; }); diff --git a/renderer.js b/renderer.js index 74ed39d..c6d0309 100644 --- a/renderer.js +++ b/renderer.js @@ -1147,13 +1147,43 @@ function commitManageOrder() { } } -/** Settings → Shortcuts. Rendered from lib/shortcuts.js, not hand-listed here. */ +/** Settings → Shortcuts. Both platforms, so the list doubles as documentation. */ function renderShortcuts() { const root = $('shortcut-list'); root.textContent = ''; const isMac = window.panebox.platform === 'darwin'; - for (const section of window.SHORTCUTS.forPlatform(window.panebox.platform)) { + const legend = document.createElement('div'); + legend.className = 'shortcut-legend'; + const spacer = document.createElement('span'); + const macCol = document.createElement('span'); + macCol.textContent = 'macOS'; + macCol.className = isMac ? 'current' : ''; + const winCol = document.createElement('span'); + winCol.textContent = 'Windows / Linux'; + winCol.className = isMac ? '' : 'current'; + legend.append(spacer, macCol, winCol); + root.appendChild(legend); + + const keyGroup = (keys, current) => { + const cell = document.createElement('span'); + cell.className = 'shortcut-keys' + (current ? ' current' : ''); + if (!keys) { + const dash = document.createElement('span'); + dash.className = 'shortcut-none'; + dash.textContent = '—'; + cell.appendChild(dash); + return cell; + } + for (const k of keys) { + const kbd = document.createElement('kbd'); + kbd.textContent = k; + cell.appendChild(kbd); + } + return cell; + }; + + for (const section of window.SHORTCUTS.rows()) { const heading = document.createElement('h4'); heading.className = 'shortcut-heading'; heading.textContent = section.title; @@ -1161,29 +1191,23 @@ function renderShortcuts() { for (const item of section.items) { const row = document.createElement('div'); - row.className = 'shortcut-row'; + row.className = 'shortcut-row' + (section.mouse ? ' gesture-row' : ''); const label = document.createElement('span'); label.className = 'shortcut-label'; label.textContent = item.label; - - const combo = document.createElement('span'); - combo.className = 'shortcut-keys'; + row.appendChild(label); if (item.gesture) { const g = document.createElement('span'); g.className = 'shortcut-gesture'; g.textContent = item.gesture; - combo.appendChild(g); + row.appendChild(g); } else { - for (const token of item.keys) { - const key = document.createElement('kbd'); - key.textContent = window.SHORTCUTS.keyLabel(token, isMac); - combo.appendChild(key); - } + row.appendChild(keyGroup(window.SHORTCUTS.render(item.mac, true), isMac)); + row.appendChild(keyGroup(window.SHORTCUTS.render(item.win, false), !isMac)); } - row.append(label, combo); root.appendChild(row); } } diff --git a/styles.css b/styles.css index 057ffa1..cc82128 100644 --- a/styles.css +++ b/styles.css @@ -742,12 +742,26 @@ body.reordering webview { pointer-events: none; } } .shortcut-heading:first-child { margin-top: 0; } +/* Three columns: what it does, the macOS keys, the Windows/Linux keys. */ +.shortcut-legend, .shortcut-row { - display: flex; align-items: center; justify-content: space-between; - gap: 16px; padding: 8px 0; + display: grid; + grid-template-columns: minmax(0, 1fr) 118px 148px; + align-items: center; gap: 12px; padding: 8px 0; +} +.shortcut-legend { + padding: 0 0 4px; font-size: 10px; text-transform: uppercase; + letter-spacing: .05em; color: var(--text-dim); } +.shortcut-legend .current { color: var(--accent); font-weight: 600; } + +/* A gesture spans both key columns. */ +.shortcut-row.gesture-row { grid-template-columns: minmax(0, 1fr) 278px; } + .shortcut-label { font-size: 13px; color: var(--text); } .shortcut-keys { display: flex; align-items: center; gap: 4px; flex-shrink: 0; } +.shortcut-keys:not(.current) { opacity: .5; } +.shortcut-none { font-size: 12px; color: var(--text-dim); } .shortcut-keys kbd { display: inline-flex; align-items: center; justify-content: center; diff --git a/test/shortcuts.test.js b/test/shortcuts.test.js index 8fa170c..4fa7346 100644 --- a/test/shortcuts.test.js +++ b/test/shortcuts.test.js @@ -30,7 +30,9 @@ function documented() { const out = new Set(); for (const section of SHORTCUTS.SECTIONS) { for (const item of section.items) { - if (item.keys) out.add(normalize(item.keys.join('+'))); + for (const combo of [item.keys, item.mac, item.win]) { + if (Array.isArray(combo)) out.add(normalize(combo.join('+'))); + } } } return out; @@ -71,13 +73,34 @@ test('the number-key shortcut is documented', () => { assert.ok(documented().has(normalize('mod+1')), 'Shortcuts tab must mention it'); }); -test('mac-only entries are hidden on other platforms', () => { - const mac = SHORTCUTS.forPlatform('darwin'); - const win = SHORTCUTS.forPlatform('win32'); - const flat = (s) => s.flatMap((x) => x.items).map((i) => i.label); +test('both platforms are listed for every keyboard row', () => { + for (const section of SHORTCUTS.rows()) { + if (section.mouse) continue; + for (const item of section.items) { + assert.ok( + item.mac !== undefined && item.win !== undefined, + `${item.label} must state both platforms, even if one is null`, + ); + } + } +}); + +test('a binding that does not exist on a platform renders as unbound', () => { + // Electron's quit role registers no accelerator on Windows or Linux, so + // claiming Ctrl+Q there would be inventing one. + const quit = SHORTCUTS.rows() + .flatMap((s) => s.items) + .find((i) => i.label === 'Quit'); + assert.deepStrictEqual(SHORTCUTS.render(quit.mac, true), ['⌘', 'Q']); + assert.strictEqual(SHORTCUTS.render(quit.win, false), null); +}); - assert.ok(flat(mac).includes('Quit'), 'Quit is a macOS menu item'); - assert.ok(!flat(win).includes('Quit'), 'and should not be advertised on Windows'); +test('platform-specific keys render differently where they differ', () => { + const devtools = SHORTCUTS.rows() + .flatMap((s) => s.items) + .find((i) => i.label === 'Developer tools'); + assert.deepStrictEqual(SHORTCUTS.render(devtools.mac, true), ['⌥', '⌘', 'I']); + assert.deepStrictEqual(SHORTCUTS.render(devtools.win, false), ['Ctrl', 'Shift', 'I']); }); test('keys render with the right symbols per platform', () => { @@ -92,7 +115,8 @@ test('every documented shortcut has a description', () => { for (const section of SHORTCUTS.SECTIONS) { for (const item of section.items) { assert.ok(item.label && item.label.length > 3, `missing label in ${section.title}`); - assert.ok(item.keys || item.gesture, `${item.label} has neither keys nor a gesture`); + const hasKeys = item.keys || item.mac || item.win; + assert.ok(hasKeys || item.gesture, `${item.label} has neither keys nor a gesture`); } } }); From 4b328a93a6a6e00596f0f4a6a2df4a4a80455286 Mon Sep 17 00:00:00 2001 From: viny Date: Thu, 30 Jul 2026 04:44:02 +0530 Subject: [PATCH 4/4] release: 2.2.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 679d77d..bc1505f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "panebox", - "version": "2.1.1", + "version": "2.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "panebox", - "version": "2.1.1", + "version": "2.2.0", "license": "MIT", "dependencies": { "electron-updater": "^6.8.9" diff --git a/package.json b/package.json index 297d275..ad467af 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "panebox", "productName": "Panebox", - "version": "2.1.1", + "version": "2.2.0", "description": "A small, private, open-source desktop deck for your web apps — AI tools, chat, mail and more in one window.", "main": "main.js", "license": "MIT",