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.
34 lines
1.3 KiB
Svelte
34 lines
1.3 KiB
Svelte
<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>
|