Put the global actions in a bottom bar and the tools in the ribbon

Decision 3 correction and the owner's ribbon direction of 2026-10-28.

- One bar at the bottom of the side pane holds the workspace switcher,
  Help, and Settings, as in Obsidian. The switcher opens the workspace
  list above it. The header has no workspace button.
- While the side pane is closed, the workspace switcher, Help, and
  Settings move to the bottom of the left ribbon, so they stay
  reachable.
- New browser tab, Terminal, Plug-in views, and Commands moved from the
  header to the top of the left ribbon, so the tabs have more room.
  Their menus open at the right of the ribbon. The header keeps Save,
  the outline toggle, and the window controls. A detached tab window
  has no ribbon and keeps these tools in its header.
- Docs: decision 3 and the ribbon tools in UI-050, ui-design.md, and
  the user guide.

Tests: layout/titleBar checks the bottom bar, the ribbon fallback, and
the header buttons. workspace/openAndCreate uses the ribbon switcher in
a narrow window. tree/renameUndo reads the tools in the ribbon.
This commit is contained in:
Knotty Wyvern
2026-10-28 23:57:19 -07:00
parent eeddd880e1
commit c271e2bae1
13 changed files with 155 additions and 81 deletions
+5 -3
View File
@@ -6,7 +6,8 @@
import ContextMenu from "$lib/layout/ContextMenu.svelte";
import type { MenuItem } from "$lib/layout/menuTypes";
import { installedPlugins, pluginTools, pluginNavigation, openPluginView, runPluginCommand } from "./external";
let { surface, compact = false }: { surface: "commands" | "open"; compact?: boolean } = $props();
// `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>();
let position = $state<{ x: number; y: number } | null>(null);
let error = $state("");
@@ -30,9 +31,9 @@
</script>
{#if tools.length}
<button class="access-button" class:compact bind:this={anchor} use:tooltip aria-label={label} aria-haspopup="menu" aria-expanded={position !== null}
<button class="access-button" class:compact class:ribbon={side === "right"} bind:this={anchor} use:tooltip aria-label={label} aria-haspopup="menu" aria-expanded={position !== null}
onpointerdown={() => pointerWasOpen = position !== null}
onclick={event => { const close = event.detail > 0 ? pointerWasOpen : position !== null; const bounds = anchor!.getBoundingClientRect(); position = close ? null : { x: bounds.left, y: bounds.bottom + 4 }; }}>
onclick={event => { const close = event.detail > 0 ? pointerWasOpen : position !== null; const bounds = anchor!.getBoundingClientRect(); position = close ? null : side === "right" ? { x: bounds.right + 4, y: bounds.top } : { x: bounds.left, y: bounds.bottom + 4 }; }}>
<Icon icon={surface === "open" ? "puzzle" : "code"} />{#if !compact}<span>{label}</span>{/if}
</button>
{/if}
@@ -44,5 +45,6 @@
.access-button:hover, .access-button[aria-expanded="true"] { background: var(--rs-bg-active); }
.access-button:focus-visible { outline: 2px solid var(--rs-focus); outline-offset: -2px; }
.access-button.compact { position: relative; width: 28px; height: 28px; min-height: 28px; padding: 5px; }
.access-button.ribbon { justify-content: center; width: 32px; height: 32px; min-height: 32px; padding: 0; }
.error { position: fixed; top: 48px; right: 12px; z-index: 60; max-width: 420px; padding: 12px; background: var(--rs-bg); color: var(--rs-error); border: 1px solid var(--rs-border); border-radius: var(--rs-control-radius); }
</style>