Remove the special cases for the old Browser package

A browser request now needs the session token of its window. Disabling
an old runestone.browser package no longer stops the engine. One list of
built-in modules starts the browser and the theme editor, and the plugin
menus skip their tools. The access rules no longer treat the browser ID
in a special way.
This commit is contained in:
Knotty Wyvern
2026-10-29 00:48:37 -07:00
parent 5dc53e4a5e
commit 48b8249ba6
13 changed files with 55 additions and 52 deletions
+3 -3
View File
@@ -5,7 +5,7 @@
import { attachTooltip } from "$lib/ui/tooltip";
import ContextMenu from "$lib/layout/ContextMenu.svelte";
import type { MenuItem } from "$lib/layout/menuTypes";
import { installedPlugins, pluginTools, pluginNavigation, openPluginView, runPluginCommand } from "./external";
import { installedPlugins, isBuiltInModule, pluginTools, pluginNavigation, openPluginView, runPluginCommand } from "./external";
// `side` places the menu below the button (the header) or at its right (the left ribbon).
let { surface, compact = false, side = "bottom" }: { surface: "commands" | "open"; compact?: boolean; side?: "bottom" | "right" } = $props();
let anchor = $state<HTMLButtonElement>();
@@ -15,13 +15,13 @@
const label = $derived(surface === "open" ? $t("Plug-in views") : $t("Commands"));
function tooltip(node: HTMLElement) { return { destroy: attachTooltip(node, () => compact ? label : "") }; }
const tools = $derived($pluginTools.filter(tool => tool.surface === surface
&& tool.owner !== "runestone.browser"
&& !isBuiltInModule(tool.owner)
&& !(surface === "open" && tool.kind === "view" && $pluginNavigation.some(item => item.owner === tool.owner && item.id === tool.id && item.placement === "sidebar"))));
const signature = $derived(JSON.stringify([tools, $installedPlugins.plugins.map(row => [row.manifest.id, row.manifest.name])]));
const items: MenuItem[] = $derived.by(() => { void signature; return untrack(() => tools.map(tool => ({
kind: "action" as const,
label: `${tool.title} · ${$installedPlugins.plugins.find(row => row.manifest.id === tool.owner)?.manifest.name ?? tool.owner}`,
icon: tool.icon === "list" ? "bullet" as const : tool.icon ?? (tool.owner === "runestone.browser" && tool.id === "new-tab" ? "globe" as const : tool.kind === "command" && surface === "commands" ? "code" as const : "plus" as const),
icon: tool.icon === "list" ? "bullet" as const : tool.icon ?? (tool.kind === "command" && surface === "commands" ? "code" as const : "plus" as const),
run: () => {
error = "";
if (tool.kind === "view") openPluginView(tool.owner, tool.id);