Theseus 0.3.124 (cont'd): sidebar auto-close on click now fires in Settings and add-on tabs too

The overlay sidebar closes when the page is clicked — but only for web
tabs, because only home-preload reported the pointerdown. Settings and
full-tab add-on pages use their own preloads, so clicking inside them
left the overlay panel sitting on top. Added the same pointerdown
reporter to settings-preload and addon-tab-preload. Push-mode behaviour
is unchanged (main gates on sidebarPanelMode).
This commit is contained in:
Local Dev 2026-10-27 21:55:45 +02:00
parent de1a5e18d4
commit 94cfb98770
2 changed files with 8 additions and 0 deletions

View file

@ -5,6 +5,10 @@
// identity from the sender's file:// URL, so a page hosted anywhere else // identity from the sender's file:// URL, so a page hosted anywhere else
// gets nothing back from these handlers. // gets nothing back from these handlers.
const { contextBridge, ipcRenderer } = require("electron"); const { contextBridge, ipcRenderer } = require("electron");
// Clicks in an add-on tab close an overlay sidebar panel the same way clicks
// in a web tab or Settings do (see home-preload / settings-preload). Push
// mode is unaffected — main gates on sidebarPanelMode.
window.addEventListener("pointerdown", () => { ipcRenderer.send("tab-pointerdown"); }, true);
contextBridge.exposeInMainWorld("silentmode", { contextBridge.exposeInMainWorld("silentmode", {
storage: { storage: {
get: (key, fallback = null) => ipcRenderer.invoke("addon-storage-get", key, fallback), get: (key, fallback = null) => ipcRenderer.invoke("addon-storage-get", key, fallback),

View file

@ -1,4 +1,8 @@
const { contextBridge, ipcRenderer } = require("electron"); const { contextBridge, ipcRenderer } = require("electron");
// A click inside the Settings tab closes an open sidebar panel (overlay mode)
// — same signal home-preload sends in a web tab. Without this, clicking the
// Settings icon with an overlay panel open did nothing to the panel.
window.addEventListener("pointerdown", () => { ipcRenderer.send("tab-pointerdown"); }, true);
contextBridge.exposeInMainWorld("cfg", { contextBridge.exposeInMainWorld("cfg", {
get: () => ipcRenderer.invoke("settings-get"), get: () => ipcRenderer.invoke("settings-get"),
set: (key, value) => ipcRenderer.invoke("settings-set", key, value), set: (key, value) => ipcRenderer.invoke("settings-set", key, value),