feat(theseus/sidebar): remove redundant in-panel extension picker strip

Every add-on panel was carrying a 32-px tab bar at the top listing every
registered extension. That existed before the toolbar extension dock
landed — now that the dock (per-extension buttons + puzzle dropdown at
narrow widths) is the canonical switcher, doubling that inside the
sidebar just wasted vertical space and made narrow panels feel cramped.

Drops installPickerStrip() from sidebar-preload.js and the invocation
from the DOMContentLoaded handler. The body-padding style that made
room for the strip goes with it, so panels reclaim their top 33px.
Resize grip on the left edge stays — unrelated feature.

No panel HTML depends on the strip's padding — the wallets, notepad,
relay, siawallet, and screenshot addon all start their own body flow
from 0. Nothing else to change.
This commit is contained in:
Local Dev 2026-09-06 22:05:27 +02:00
parent a18c1b243b
commit 8ae4ecea81

View file

@ -20,52 +20,11 @@ contextBridge.exposeInMainWorld("silentmode", {
on: (msg, cb) => ipcRenderer.on("addon-event", (_e, name, payload) => { if (name === msg) cb(payload); }), on: (msg, cb) => ipcRenderer.on("addon-event", (_e, name, payload) => { if (name === msg) cb(payload); }),
}); });
// -- Panel picker strip ----------------------------------------------------- // Panel picker strip was here — a 32-px tab bar injected at the top of
// Injected at the top of every panel document so the user can switch between // every panel to switch between registered extensions. Removed: the
// registered extension panels without a settings round-trip. Only appears // toolbar extension dock (per-extension buttons + puzzle dropdown at
// when 2+ panels exist. Main pushes the panel list here via IPC on the // narrow widths) is the canonical switcher now, and doubling that inside
// initial sidebar-state event. // the sidebar wasted vertical space and made narrow panels feel cramped.
async function installPickerStrip() {
let state;
try { state = await ipcRenderer.invoke("sidebar-state"); } catch { return; }
const panels = (state && state.panels) || [];
if (panels.length < 2) return;
const strip = document.createElement("div");
strip.setAttribute("aria-label", "Extension panels");
strip.style.cssText = [
"position:fixed", "top:0", "left:5px", "right:0", "height:32px",
"display:flex", "align-items:stretch", "gap:1px",
"background:rgba(11,14,20,.85)", "backdrop-filter:blur(8px)",
"border-bottom:1px solid rgba(255,255,255,.10)",
"z-index:2147483646", "user-select:none",
"font:12px/1 system-ui,-apple-system,Segoe UI,Roboto,sans-serif",
].join(";");
const active = state.active;
for (const p of panels) {
const tab = document.createElement("button");
tab.type = "button";
const isActive = p.panelId === active;
tab.style.cssText = [
"flex:1", "min-width:0", "padding:0 10px", "border:0",
"background:" + (isActive ? "rgba(214,255,61,.10)" : "transparent"),
"color:" + (isActive ? "#d6ff3d" : "#8b98a9"),
"cursor:pointer",
"display:flex", "align-items:center", "gap:6px", "justify-content:center",
"overflow:hidden", "text-overflow:ellipsis", "white-space:nowrap",
"font:inherit",
].join(";");
tab.innerHTML = '<span>' + (p.icon || "🧩") + '</span><span>' + p.title.replace(/</g, "&lt;") + '</span>';
tab.addEventListener("click", () => ipcRenderer.invoke("sidebar-open", p.panelId));
strip.appendChild(tab);
}
document.body.appendChild(strip);
// Push the panel body down so the 32-px strip doesn't overlap the content.
// box-sizing:border-box keeps 100%-tall panels from overflowing when we
// add the padding.
const style = document.createElement("style");
style.textContent = "html,body{box-sizing:border-box}body{padding-top:33px!important}";
document.head.appendChild(style);
}
// Sidebar resize grip. Injected into every panel automatically so panel // Sidebar resize grip. Injected into every panel automatically so panel
// authors don't have to reinvent it. A thin strip along the LEFT edge // authors don't have to reinvent it. A thin strip along the LEFT edge
@ -73,7 +32,6 @@ async function installPickerStrip() {
// and streams drag deltas to main until mouseup. Main clamps the width // and streams drag deltas to main until mouseup. Main clamps the width
// to [200, 800] and persists it in settings.sidebarWidth. // to [200, 800] and persists it in settings.sidebarWidth.
window.addEventListener("DOMContentLoaded", () => { window.addEventListener("DOMContentLoaded", () => {
installPickerStrip();
const grip = document.createElement("div"); const grip = document.createElement("div");
grip.setAttribute("aria-label", "Resize sidebar"); grip.setAttribute("aria-label", "Resize sidebar");
grip.style.cssText = [ grip.style.cssText = [