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:
@@ -1,6 +1,11 @@
|
||||
<script lang="ts">
|
||||
// The left pane: a plugin sidebar view, or the files, search, and bookmarks views.
|
||||
// The left pane: a plugin sidebar view, or the files, search, and bookmarks views, and the bar at its bottom with
|
||||
// the workspace switcher, Help, and Settings. When the pane is closed, the left ribbon shows these three (PluginRibbon.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 { commandShortcut } from "./workbenchKeys";
|
||||
import PluginEditor from "$lib/plugins/PluginEditor.svelte";
|
||||
import BrowserSlot from "$lib/plugins/BrowserSlot.svelte";
|
||||
import { pluginSidebar } from "$lib/plugins/external";
|
||||
@@ -19,14 +24,24 @@
|
||||
activePath: string | null;
|
||||
searchRequest: { text: string; id: number } | null;
|
||||
fileTree?: FileTree;
|
||||
workspaceAnchor?: HTMLElement;
|
||||
onChooseWorkspace: () => void;
|
||||
onHelp: () => void;
|
||||
onSettings: () => void;
|
||||
onOpenFile: (entry: TreeEntry, line?: number, target?: "current" | "new") => void;
|
||||
onCreated: (entry: TreeEntry) => void;
|
||||
onSaveTemplate: (entry: TreeEntry) => void;
|
||||
onManageTemplates: () => void;
|
||||
onStatus: (message: string) => void;
|
||||
};
|
||||
let { workspace, session, leftView, keysActive, showInternal, activePath, searchRequest, fileTree = $bindable(),
|
||||
onOpenFile, onCreated, onSaveTemplate, onManageTemplates, onStatus }: Props = $props();
|
||||
let { workspace, session, leftView, keysActive, showInternal, activePath, searchRequest, fileTree = $bindable(), workspaceAnchor = $bindable(),
|
||||
onOpenFile, onCreated, onSaveTemplate, onManageTemplates, onStatus, onChooseWorkspace, onHelp, onSettings }: 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>
|
||||
|
||||
<aside class="left">
|
||||
@@ -63,6 +78,14 @@
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="left-footer">
|
||||
<button class="workspace-button" bind:this={workspaceAnchor} onclick={onChooseWorkspace}
|
||||
use:tooltip={$t("Open folder ({shortcut})", { shortcut: commandShortcut("open-workspace") })}>
|
||||
<Icon icon="chevrons-up-down" /><span class="ws">{workspace ? workspace.name : $t("Open folder")}</span>
|
||||
</button>
|
||||
<IconButton icon="help" label={$t("Help and about ({shortcut})", { shortcut: commandShortcut("help") })} onclick={onHelp} />
|
||||
<IconButton icon="settings" label={$t("Settings ({shortcut})", { shortcut: commandShortcut("settings") })} onclick={onSettings} />
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<style>
|
||||
@@ -123,4 +146,33 @@
|
||||
margin: 12px;
|
||||
color: var(--rs-text-dim);
|
||||
}
|
||||
|
||||
.left-footer {
|
||||
display: flex;
|
||||
flex: 0 0 auto;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 6px;
|
||||
border-top: 1px solid var(--rs-border);
|
||||
}
|
||||
|
||||
.workspace-button {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
min-width: 0;
|
||||
min-height: 32px;
|
||||
padding: 0 10px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: var(--rs-control-radius);
|
||||
background: var(--rs-bg-active);
|
||||
color: var(--rs-text-strong);
|
||||
font: 600 13px var(--rs-font-ui);
|
||||
text-align: left;
|
||||
}
|
||||
.workspace-button:hover { border-color: var(--rs-border); }
|
||||
.workspace-button :global(svg) { width: 16px; height: 16px; flex-shrink: 0; color: var(--rs-text-dim); }
|
||||
.ws { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.left-footer :global(.icon-btn) { width: 32px; height: 32px; flex-basis: 32px; }
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user