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
+9 -43
View File
@@ -1,10 +1,9 @@
<script lang="ts">
// The workbench header: the workspace button, the side pane buttons, the working tabs, the actions, and the window controls.
// The workbench header: the side pane buttons, the working tabs, Save, the outline toggle, and the window controls.
// The other tools are in the left ribbon (PluginRibbon.svelte). A detached tab window has no ribbon, so its header keeps them.
import type { ComponentProps } from "svelte";
import { t } from "$lib/i18n";
import Icon from "$lib/ui/Icon.svelte";
import IconButton from "$lib/ui/IconButton.svelte";
import { attachTooltip } from "$lib/ui/tooltip";
import WindowControls from "$lib/ui/WindowControls.svelte";
import PluginTools from "$lib/plugins/PluginTools.svelte";
import PluginAccessMenu from "$lib/plugins/PluginAccessMenu.svelte";
@@ -16,9 +15,6 @@
type Props = {
detached: boolean;
desktop: boolean;
workspaceName: string | null;
workspaceAnchor?: HTMLButtonElement;
onChooseWorkspace: () => void;
leftOpen: boolean;
leftView: LeftView;
sidebarNavigation: { owner: string; id: string; title: string; icon?: string }[];
@@ -37,24 +33,13 @@
onToggleRight: () => void;
onError: (message: string) => void;
};
let { detached, desktop, workspaceName, workspaceAnchor = $bindable(), onChooseWorkspace, leftOpen, leftView, sidebarNavigation, onSelectLeft, tabBar, onNewTab, canOpenBrowser, browserOpening, onOpenBrowser,
let { detached, desktop, leftOpen, leftView, sidebarNavigation, onSelectLeft, tabBar, onNewTab, canOpenBrowser, browserOpening, onOpenBrowser,
saveDisabled, onSave, terminalEnabled, terminalOpen, onToggleTerminal, rightOpen, onToggleRight, onError }: Props = $props();
function tooltip(node: HTMLElement, text: string) {
let current = text;
const dispose = attachTooltip(node, () => current);
return { update(value: string) { current = value; }, destroy: dispose };
}
</script>
<header class="header" data-tauri-drag-region>
<div class="header-left" data-tauri-drag-region>
{#if !detached}
<!-- The workspace button names the window and opens the workspace list. -->
<button class="workspace-button" bind:this={workspaceAnchor} onclick={onChooseWorkspace}
use:tooltip={$t("Open folder ({shortcut})", { shortcut: commandShortcut("open-workspace") })}>
<Icon icon="folder-open" /><span class="ws">{workspaceName ?? $t("Open folder")}</span><Icon icon="chevron-down" />
</button>
<IconButton icon="files" label={$t("Files")} active={leftOpen && !$pluginSidebar && leftView === "files"} onclick={() => onSelectLeft("files")} />
<IconButton icon="search" label={$t("Search")} active={leftOpen && !$pluginSidebar && leftView === "search"} onclick={() => onSelectLeft("search")} />
<IconButton icon="bookmark" label={$t("Bookmarks")} active={leftOpen && !$pluginSidebar && leftView === "bookmarks"} onclick={() => onSelectLeft("bookmarks")} />
@@ -74,12 +59,14 @@
{#if desktop}<div class="window-drag-space" data-tauri-drag-region aria-hidden="true"></div>{/if}
</div>
<div class="header-right" data-tauri-drag-region>
{#if canOpenBrowser}<IconButton icon="globe" label={$t("New browser tab")} disabled={browserOpening} onclick={onOpenBrowser} />{/if}
<PluginAccessMenu surface="open" compact />
{#if detached}
{#if canOpenBrowser}<IconButton icon="globe" label={$t("New browser tab")} disabled={browserOpening} onclick={onOpenBrowser} />{/if}
<PluginAccessMenu surface="open" compact />
<PluginAccessMenu surface="commands" compact />
{#if terminalEnabled}<IconButton icon="terminal" label={$t("Terminal")} active={terminalOpen} onclick={onToggleTerminal} />{/if}
{/if}
<PluginTools />
<PluginAccessMenu surface="commands" compact />
<IconButton icon="save" label={$t("Save")} disabled={saveDisabled} onclick={onSave} />
{#if terminalEnabled}<IconButton icon="terminal" label={$t("Terminal")} active={terminalOpen} onclick={onToggleTerminal} />{/if}
{#if !detached}<IconButton icon="panel-right" label={rightOpen ? $t("Hide outline") : $t("Show outline")} active={rightOpen} onclick={onToggleRight} />{/if}
{#if desktop}<WindowControls {onError} />{/if}
</div>
@@ -110,27 +97,6 @@
/* The macOS traffic lights sit at the start of the header (src/lib/theme/tokens.css). */
.header-left { justify-content: flex-start; padding-left: calc(4px + var(--rs-titlebar-inset-start)); }
.workspace-button {
display: inline-flex;
flex: 0 1 auto;
align-items: center;
gap: 6px;
min-width: 32px;
max-width: 180px;
height: 28px;
margin-right: 4px;
padding: 0 6px;
border: 1px solid transparent;
border-radius: var(--rs-control-radius);
background: transparent;
color: var(--rs-text);
font: 600 12px var(--rs-font-ui);
}
.workspace-button:hover { background: var(--rs-bg-active); border-color: var(--rs-border); }
.workspace-button :global(svg) { width: 16px; height: 16px; flex-shrink: 0; color: var(--rs-text-dim); }
.workspace-button :global(svg:last-child) { width: 12px; height: 12px; }
.ws { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* In a window below the minimum width, the center clips its content instead of drawing under the right group. */
.header-center {
overflow: hidden;