Split the workbench markup into region components

Phase 5-1.

Workbench.svelte keeps the state and the commands. Six components now
draw its regions, each with its own styles:

- WorkbenchHeader: the side pane buttons, the working tabs, the
  actions, and the window controls.
- PluginRibbon: the ribbon of plugin views.
- LeftPane: the plugin sidebar, files, search, bookmarks, and the
  workspace footer.
- DocumentArea: the plugin editor panes, the document panes, and the
  save conflict banners.
- RightPane: the outline and the backlinks.
- StatusBar: the status line.

Each component keeps the root element of its region, so the shell grid
places them as before. Workbench.svelte has about 450 fewer lines.
There is no visible change.

pnpm check passes. pnpm test: 451 of 451 pass. Full smoke suite: 95
passed, 2 known. plugins/access failed one time and passed on retry
and 3 of 3 times alone.
This commit is contained in:
Knotty Wyvern
2026-10-28 18:40:50 -07:00
parent 5483881bc2
commit b2348d0fe8
8 changed files with 677 additions and 454 deletions
+33
View File
@@ -0,0 +1,33 @@
<script lang="ts">
// The right pane: the outline of the active document and its backlinks.
import type { ComponentProps } from "svelte";
import type { WorkspaceSession } from "$lib/workspace/session.svelte";
import type { Backlink } from "$lib/workspace/noteIndex";
import OutlinePane from "./OutlinePane.svelte";
import Backlinks from "./Backlinks.svelte";
type Props = {
outlineItems: ComponentProps<typeof OutlinePane>["items"];
onJump: (line: number) => void;
showBacklinks: boolean;
backlinks: Backlink[];
session: WorkspaceSession;
onOpenBacklink: (entry: Backlink) => void;
};
let { outlineItems, onJump, showBacklinks, backlinks, session, onOpenBacklink }: Props = $props();
</script>
<aside class="right">
<div class="outline-area">
<OutlinePane items={outlineItems} {onJump} />
</div>
{#if showBacklinks}
<Backlinks entries={backlinks} busy={session.indexBusy} error={session.indexError} onOpen={onOpenBacklink} onRebuild={() => void session.rebuildIndex()} />
{/if}
</aside>
<style>
.right { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: var(--rs-workarea-sidebar-bg); }
.outline-area { flex: 1; min-height: 80px; overflow: hidden; }
.right > :global(.backlinks) { flex: 0 1 auto; max-height: 50%; }
</style>