From c271e2bae173626f3c50378f89d0bfb48a3348ab Mon Sep 17 00:00:00 2001 From: Knotty Wyvern Date: Wed, 28 Oct 2026 23:57:19 -0700 Subject: [PATCH] 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. --- docs/design-decisions.md | 8 ++- docs/ui-design.md | 7 ++- docs/user-guide.md | 8 +-- src/lib/layout/LeftPane.svelte | 58 ++++++++++++++++++- src/lib/layout/PluginRibbon.svelte | 35 +++++++++-- src/lib/layout/Workbench.svelte | 12 ++-- src/lib/layout/WorkbenchHeader.svelte | 52 +++-------------- src/lib/plugins/PluginAccessMenu.svelte | 8 ++- src/lib/ui/Icon.svelte | 2 + src/lib/ui/IconButton.svelte | 1 + tests/smoke/layout/titleBar.smoke.mjs | 31 +++++++--- tests/smoke/tree/renameUndo.smoke.mjs | 7 ++- tests/smoke/workspace/openAndCreate.smoke.mjs | 7 ++- 13 files changed, 155 insertions(+), 81 deletions(-) diff --git a/docs/design-decisions.md b/docs/design-decisions.md index 50cec5d..57d0b6f 100644 --- a/docs/design-decisions.md +++ b/docs/design-decisions.md @@ -942,11 +942,13 @@ Native shell, background image, and desktop acceptance remain open. - Status: Implemented for user review - Decision source: Owner decisions 3, 7, and 12 of 2026-10-27 (interface review issues 3, 8, and 15), stage 5-4. - Previous rule: The workspace button, Help, and Settings sat in the footer of the left pane, so they left the window with the pane. The plugin ribbon had no width without plugin entries. Tabs could shrink to 69 pixels, with no list and no sign of hidden tabs. The fixed drag area was 40 pixels. Every platform got rounded 40-pixel caption buttons, and macOS got Windows caption buttons. -- New rule: The workspace button sits at the left end of the header. It shows the workspace name and opens the workspace list below it. The left ribbon is always present: plugin views at the top, Help and Settings at the bottom. Tabs keep 120 pixels and scroll, with fades at the ends and a ⌄ list of all tabs that marks pinned and unsaved tabs. The header keeps a drag area of 120 pixels after the tabs. In a narrow header, the tabs shrink first, and the drag area keeps at least 48 pixels. Windows and Linux get square caption buttons, 46 pixels wide and full height. macOS keeps its native traffic lights through an overlay title bar, and each title bar leaves `--rs-titlebar-inset-start` (78 pixels) free for them. +- New rule: A bar at the bottom of the side pane holds the workspace switcher, Help, and Settings, as in Obsidian. The switcher shows the workspace name and opens the workspace list above it. The left ribbon is always present and holds plugin views. While the side pane is closed, the workspace switcher, Help, and Settings move to the bottom of the ribbon. Tabs keep 120 pixels and scroll, with fades at the ends and a ⌄ list of all tabs that marks pinned and unsaved tabs. The header keeps a drag area of 120 pixels after the tabs. In a narrow header, the tabs shrink first, and the drag area keeps at least 48 pixels. Windows and Linux get square caption buttons, 46 pixels wide and full height. macOS keeps its native traffic lights through an overlay title bar, and each title bar leaves `--rs-titlebar-inset-start` (78 pixels) free for them. - Snap Layouts: The custom title bar has no native caption buttons, so a hit test cannot show the flyout. When the pointer rests 500 ms on maximize, the host presses Win+Z for the focused window. This is the method of the existing Win+H dictation command. - Reason: Global actions must stay reachable when the side pane closes. A tab label must stay readable. Each platform keeps its own window conventions. -- Scope: The main header, the left ribbon, the tab bars, the Settings and Browser window title bars, and the window builders of the host. -- Shared implementation: `WorkbenchHeader.svelte`, `PluginRibbon.svelte`, `TabBar.svelte`, `WindowControls.svelte`, `src-tauri/src/window_frame.rs`, `src-tauri/tauri.macos.conf.json`, and the `--rs-titlebar-inset-start` token. +- Ribbon tools (2026-10-28, owner direction): 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. Save, the outline toggle, and the window controls stay in the header. A detached tab window has no ribbon and keeps these tools in its header. +- Correction (2026-10-28): The first version put the workspace button in the header and Help and Settings in the ribbon. The owner meant one bar at the bottom left, as in Obsidian. The record of decision 3 said "left ribbon", which I read as the vertical ribbon. +- Scope: The main header, the side pane, the left ribbon, the tab bars, the Settings and Browser window title bars, and the window builders of the host. +- Shared implementation: `WorkbenchHeader.svelte`, `LeftPane.svelte`, `PluginRibbon.svelte`, `TabBar.svelte`, `WindowControls.svelte`, `src-tauri/src/window_frame.rs`, `src-tauri/tauri.macos.conf.json`, and the `--rs-titlebar-inset-start` token. - Evidence: `tests/smoke/layout/titleBar.smoke.mjs` and the Rust command list test. - Replaces / replaced by: The left pane footer, and the ribbon rule "The ribbon has no width when it has no entries." - Limits: Browser checks use desktop service mocks. Snap Layouts, the native drag area, and the macOS title bar need native acceptance. The macOS code path was not compiled here. On Windows 10, Win+Z does nothing. diff --git a/docs/ui-design.md b/docs/ui-design.md index 1b6637d..ea4b72b 100644 --- a/docs/ui-design.md +++ b/docs/ui-design.md @@ -146,13 +146,14 @@ Decisions: [UI-002](design-decisions.md#ui-002--share-the-requested-dropdown-des ## Window and navigation -- The main header holds the workspace button, navigation, document tabs, actions, and window controls. The workspace button names the window and opens the workspace list. -- The left ribbon stays visible when the side pane is closed. It holds plugin views at the top and Help and Settings at the bottom. +- The main header holds navigation, document tabs, Save, the outline toggle, and window controls. The other tools are in the left ribbon, so the tabs keep their room. A detached tab window has no ribbon, so its header keeps those tools. +- A bar at the bottom of the side pane holds the workspace switcher, Help, and Settings, as in Obsidian. The switcher names the workspace and opens the workspace list above it. +- The left ribbon is always present. It holds the tools (New browser tab, Terminal, Plug-in views, and Commands), then a line, then the plugin view shortcuts. Its menus open at its right. While the side pane is closed, the workspace switcher, Help, and Settings move to the bottom of the ribbon, so they stay reachable. - Tabs keep a minimum width of 120 pixels and scroll. Fades show tabs out of view, and ⌄ lists all tabs. A drag area of 120 pixels sits after the tabs. In a narrow header, the tabs shrink first, and the drag area keeps at least 48 pixels. - Windows and Linux title bars use square caption buttons, 46 pixels wide and full height. Rest the pointer on maximize for Snap Layouts on Windows 11. macOS keeps its native traffic lights, and title bars leave `--rs-titlebar-inset-start` free for them. - Files, Search, Bookmarks, and installed sidebar views such as Git share the top navigation group. The active navigation button shows which view fills the left pane. - Plugin editor views can use the left ribbon. -- The built-in browser opens from its own toolbar action. Project Management opens from Plug-in views. Keep Plug-in views in the toolbar, away from the new-tab button. +- The built-in browser opens from its own ribbon action. Project Management opens from Plug-in views. Keep Plug-in views in the ribbon, away from the new-tab button. - Document and plugin tabs share the tab bar. The new-tab button follows the tabs. Tabs keep their order and pin state when a plugin replaces its view. - The main window keeps an empty New tab after its last tab closes. A secondary window closes with its last tab. The unsaved-edit and active-terminal confirmations still apply, and Cancel keeps the tab open. - Sidebar widths and visibility persist across window sessions. A different editor does not restore a hidden outline. diff --git a/docs/user-guide.md b/docs/user-guide.md index 1ca9f7b..a063795 100644 --- a/docs/user-guide.md +++ b/docs/user-guide.md @@ -22,7 +22,7 @@ This guide explains how to work with files, documents, tabs, settings, and the b A workspace is a folder on your computer. RuneStone reads and writes its files directly. -1. Select the workspace name at the left end of the title bar, or press Ctrl+O. +1. Select the workspace name at the bottom of the sidebar, or press Ctrl+O. When the sidebar is hidden, select ⇕ at the bottom of the left ribbon. 2. Choose a recent workspace, **Open another folder…**, or **New workspace…**. Each workspace opens in its own window. The current window keeps its documents and terminals. @@ -191,7 +191,7 @@ If a write fails, your edits stay in the tab. RuneStone does not lock files, so ## Change settings -Select the gear at the bottom of the left ribbon, or press Ctrl+,. Use the search field to find a setting. +Select the gear at the bottom of the sidebar, or press Ctrl+,. When the sidebar is hidden, the gear is at the bottom of the left ribbon. Use the search field to find a setting. Settings apply at once to all workspaces on this computer and update all open windows. A text field applies when you leave it. | Category | Settings | @@ -209,7 +209,7 @@ Reopen a document to update its editor tooltips after a language change. RuneStone includes a Chromium-based browser. It needs no plugin. -1. Select the globe button at the top right of the window to open a **New browser tab**. +1. Select the globe button in the left ribbon to open a **New browser tab**. 2. Type an address or a search. Use **Settings → Browser** to set the homepage and search engine, manage profiles, block ads, and clear cookies, cache, or history. @@ -254,6 +254,6 @@ The [Terminal guide](guides/terminal.md) lists the terminal shortcuts. ## Get help -Press F1, or select the question mark at the bottom of the left ribbon, for **Help and about**. It shows the app version, basic steps, and every shortcut. +Press F1, or select the question mark at the bottom of the sidebar or of the left ribbon, for **Help and about**. It shows the app version, basic steps, and every shortcut. When you report a problem, include the app version, operating system, steps, expected result, and error text. diff --git a/src/lib/layout/LeftPane.svelte b/src/lib/layout/LeftPane.svelte index 52e583a..9250fb9 100644 --- a/src/lib/layout/LeftPane.svelte +++ b/src/lib/layout/LeftPane.svelte @@ -1,6 +1,11 @@ diff --git a/src/lib/layout/PluginRibbon.svelte b/src/lib/layout/PluginRibbon.svelte index fa6c26e..1e23ddc 100644 --- a/src/lib/layout/PluginRibbon.svelte +++ b/src/lib/layout/PluginRibbon.svelte @@ -1,18 +1,38 @@
+
+ {#if canOpenBrowser}{/if} + {#if terminalEnabled}{/if} + + +
+ {#if actions}
+
+ {/if}
diff --git a/src/lib/layout/Workbench.svelte b/src/lib/layout/Workbench.svelte index 1ef63a9..c156d5b 100644 --- a/src/lib/layout/Workbench.svelte +++ b/src/lib/layout/Workbench.svelte @@ -90,7 +90,7 @@ } let settings = $state({ ...DEFAULT_SETTINGS }); let settingsReady = $state(false); - let workspaceAnchor: HTMLButtonElement | undefined = $state(); + let workspaceAnchor: HTMLElement | undefined = $state(); const desktop = isTauri(); const transferredWindow = /^[0-9a-f-]{36}$/i.test(new URLSearchParams(location.search).get("tabTransfer") ?? ""); // The documents of the open workspace. Their buffers are reactive, so the tabs read them directly. @@ -1290,9 +1290,6 @@ error = message} /> - {#if !transferredWindow} preferences = "help"} onSettings={() => void openSettings()} />{/if} + {#if !transferredWindow} void openBrowser()} {terminalEnabled} {terminalOpen} onToggleTerminal={toggleTerminal} onChooseWorkspace={chooseWorkspace} onHelp={() => preferences = "help"} onSettings={() => void openSettings()} />{/if} {#if leftOpen && !transferredWindow} { void saveTemplate(entry); }} onManageTemplates={() => templateManager = true} onStatus={(message) => { status = message; error = null; }} + onChooseWorkspace={chooseWorkspace} + onHelp={() => preferences = "help"} + onSettings={() => void openSettings()} /> diff --git a/src/lib/layout/WorkbenchHeader.svelte b/src/lib/layout/WorkbenchHeader.svelte index 51f6006..09e04d4 100644 --- a/src/lib/layout/WorkbenchHeader.svelte +++ b/src/lib/layout/WorkbenchHeader.svelte @@ -1,10 +1,9 @@
{#if !detached} - - onSelectLeft("files")} /> onSelectLeft("search")} /> onSelectLeft("bookmarks")} /> @@ -74,12 +59,14 @@ {#if desktop}{/if}
- {#if canOpenBrowser}{/if} - + {#if detached} + {#if canOpenBrowser}{/if} + + + {#if terminalEnabled}{/if} + {/if} - - {#if terminalEnabled}{/if} {#if !detached}{/if} {#if desktop}{/if}
@@ -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; diff --git a/src/lib/plugins/PluginAccessMenu.svelte b/src/lib/plugins/PluginAccessMenu.svelte index 9844a1e..bd77bbe 100644 --- a/src/lib/plugins/PluginAccessMenu.svelte +++ b/src/lib/plugins/PluginAccessMenu.svelte @@ -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(); let position = $state<{ x: number; y: number } | null>(null); let error = $state(""); @@ -30,9 +31,9 @@ {#if tools.length} - {/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); } diff --git a/src/lib/ui/Icon.svelte b/src/lib/ui/Icon.svelte index dfec3eb..8ee8cde 100644 --- a/src/lib/ui/Icon.svelte +++ b/src/lib/ui/Icon.svelte @@ -32,6 +32,8 @@ {:else if icon === "chevron-down"} + {:else if icon === "chevrons-up-down"} + {:else if icon === "maximize"} {:else if icon === "minimize"} diff --git a/src/lib/ui/IconButton.svelte b/src/lib/ui/IconButton.svelte index 29b419c..c2ca35e 100644 --- a/src/lib/ui/IconButton.svelte +++ b/src/lib/ui/IconButton.svelte @@ -22,6 +22,7 @@ | "split" | "more" | "chevron-down" + | "chevrons-up-down" | "up" | "down" | "maximize" diff --git a/tests/smoke/layout/titleBar.smoke.mjs b/tests/smoke/layout/titleBar.smoke.mjs index 79c9af5..0fdf638 100644 --- a/tests/smoke/layout/titleBar.smoke.mjs +++ b/tests/smoke/layout/titleBar.smoke.mjs @@ -1,4 +1,4 @@ -// The title bar: the workspace button, the left ribbon, readable tabs with a list of all tabs, the drag area, caption buttons, Snap Layouts, and the macOS layout. +// The title bar and the side pane: the bottom bar with the workspace switcher, Help, and Settings, the ribbon fallback, readable tabs with a list of all tabs, the drag area, caption buttons, Snap Layouts, and the macOS layout. import assert from "node:assert/strict"; import { mockTauri, openPage, outputDir, runSmoke, smokeUrl } from "../_harness/index.mjs"; @@ -26,22 +26,39 @@ await runSmoke("layout/titleBar", async ({ browser }) => { const box = locator => locator.evaluate(node => { const rect = node.getBoundingClientRect(); return { x: rect.x, right: rect.right, width: rect.width, height: rect.height, bottom: rect.bottom }; }); await page.goto(smokeUrl); - // The workspace button is the first control of the header. It opens the workspace list below it. + // The 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. const workspace = page.getByRole("button", { name: "Field work", exact: true }); await workspace.waitFor(); // Auto-save stays off, so the edited tab keeps its unsaved mark. await page.evaluate(() => window.__TEST__.writeSettings("general", { autosaveEnabled: false, autosaveSeconds: 5 })); - assert.equal(await page.locator("header.header button").first().evaluate(node => node.classList.contains("workspace-button")), true); + const footer = page.locator("aside.left .left-footer"); + assert.equal(await footer.locator(".workspace-button").count(), 1); + assert.equal(await footer.getByRole("button", { name: "Help and about (F1)", exact: true }).count(), 1); + assert.equal(await footer.getByRole("button", { name: "Settings (Ctrl+,)", exact: true }).count(), 1); + assert.equal(await page.locator("header.header .workspace-button").count(), 0); + // The header right keeps only Save, the outline toggle, and the window controls. The other tools are in the left ribbon. + assert.deepEqual(await page.locator(".header-right").getByRole("button").evaluateAll(nodes => nodes.map(node => node.getAttribute("aria-label"))), + ["Save", "Hide outline", "Minimize window", "Maximize window", "Close window"]); + const ribbon = page.locator(".plugin-ribbon"); + assert.equal(await ribbon.getByRole("button", { name: "Settings (Ctrl+,)", exact: true }).count(), 0, "The ribbon has no second copy while the pane is open"); await workspace.click(); const picker = page.getByRole("dialog", { name: "Workspaces" }); await picker.waitFor(); - assert.ok(await picker.evaluate((node, bottom) => node.getBoundingClientRect().top >= bottom, (await box(workspace)).bottom)); + assert.ok(await picker.evaluate((node, top) => node.getBoundingClientRect().bottom <= top, (await workspace.boundingBox()).y)); + await page.screenshot({ path: `${output}/bottom-bar.png` }); await page.keyboard.press("Escape"); - // Help and Settings stay in the left ribbon when the side pane closes. + // While the side pane is closed, the workspace switcher, Help, and Settings move to the bottom of the ribbon. await page.keyboard.press("Control+\\"); await page.locator("aside.left").waitFor({ state: "detached" }); - const ribbon = page.locator(".plugin-ribbon"); + const ribbonSwitcher = ribbon.getByRole("button", { name: "Open folder (Ctrl+O)", exact: true }); + await ribbonSwitcher.click(); + await picker.waitFor(); + const switcherBox = await ribbonSwitcher.boundingBox(), pickerBox = await picker.boundingBox(); + assert.ok(pickerBox.y + pickerBox.height <= switcherBox.y + 1 && pickerBox.x < 100, JSON.stringify({ switcherBox, pickerBox })); + await page.screenshot({ path: `${output}/ribbon-fallback.png` }); + await page.keyboard.press("Escape"); await ribbon.getByRole("button", { name: "Help and about (F1)", exact: true }).click(); await page.getByRole("dialog", { name: "Help and about" }).waitFor(); await page.getByRole("button", { name: "Close help", exact: true }).click(); @@ -117,5 +134,5 @@ await runSmoke("layout/titleBar", async ({ browser }) => { assert.match(await mac.getByRole("button", { name: "Settings (⌘,)", exact: true }).getAttribute("aria-label"), /⌘/); await mac.locator("header.header").screenshot({ path: `${output}/header-mac.png` }); assert.deepEqual([...page.errors, ...mac.errors], []); - console.log("PASS: workspace button, permanent ribbon, readable tabs with fades and a list, fixed drag area, square caption buttons, Snap Layouts request, macOS layout, both themes, narrow window."); + console.log("PASS: bottom bar of the side pane, ribbon fallback, readable tabs with fades and a list, fixed drag area, square caption buttons, Snap Layouts request, macOS layout, both themes, narrow window."); }); diff --git a/tests/smoke/tree/renameUndo.smoke.mjs b/tests/smoke/tree/renameUndo.smoke.mjs index 82ee463..0c6267a 100644 --- a/tests/smoke/tree/renameUndo.smoke.mjs +++ b/tests/smoke/tree/renameUndo.smoke.mjs @@ -133,11 +133,12 @@ await runSmoke('tree/renameUndo', async ({ browser }) => { const registry = await import(performance.getEntriesByType('resource').find(entry => new URL(entry.name).pathname === '/src/lib/plugins/registry.ts').name); registry.pluginHost.get('browser').newTab = async () => { window.__TEST__.browserOpened = true; }; }); - await page.locator('.header-right').getByRole('button', { name: 'New browser tab', exact: true }).click(); + // The app tools are in the left ribbon. Plugin view shortcuts stay out of it in this test (src/lib/layout/PluginRibbon.svelte). + await page.locator('.plugin-ribbon').getByRole('button', { name: 'New browser tab', exact: true }).click(); assert.equal(await page.evaluate(() => window.__TEST__.browserOpened), true); - assert.equal(await page.locator('.header-right').getByRole('button', { name: 'Project Management', exact: true }).count(), 0); + assert.equal(await page.locator('.plugin-ribbon .ribbon-tools').getByRole('button', { name: 'Project Management', exact: true }).count(), 0); assert.equal(await page.locator('.header-left').getByRole('button', { name: 'Source control', exact: true }).count(), 1); - assert.equal(await page.locator('.header-right').getByRole('button', { name: 'Source control', exact: true }).count(), 0); + assert.equal(await page.locator('.plugin-ribbon .ribbon-tools').getByRole('button', { name: 'Source control', exact: true }).count(), 0); await page.getByRole('button', { name: 'Plug-in views', exact: true }).click(); assert.equal(await page.getByRole('menuitem', { name: /Project Management/ }).count(), 1); assert.equal(await page.getByRole('menuitem', { name: /New browser tab/ }).count(), 0); diff --git a/tests/smoke/workspace/openAndCreate.smoke.mjs b/tests/smoke/workspace/openAndCreate.smoke.mjs index 54c7756..eee2845 100644 --- a/tests/smoke/workspace/openAndCreate.smoke.mjs +++ b/tests/smoke/workspace/openAndCreate.smoke.mjs @@ -53,8 +53,9 @@ await runSmoke("workspace/openAndCreate", async ({ page }) => { const view = window.__EditorView.findFromDOM(document.querySelector(".source-editor .cm-content")); view.dispatch({ changes: { from: 0, to: view.state.doc.length, insert: "My pending edit" } }); }); - // The workspace button at the left of the header names the workspace (src/lib/layout/WorkbenchHeader.svelte). - const trigger = page.locator(".workspace-button"); + // The workspace switcher sits in the bar at the bottom of the side pane (src/lib/layout/LeftPane.svelte). + // When the side pane gives way in a narrow window, the switcher is at the bottom of the left ribbon. + const trigger = page.locator(".workspace-button, .ribbon-workspace button").first(); const menu = page.getByRole("dialog", { name: "Workspaces", exact: true }); await page.evaluate(() => window.__TEST__.reorder()); await trigger.click(); @@ -118,7 +119,6 @@ await runSmoke("workspace/openAndCreate", async ({ page }) => { if (theme === 'dark') { await page.keyboard.press('Enter'); await menu.getByText('D:\\Missing', { exact: true }).waitFor({ state: 'detached' }); - assert.equal(await page.locator('.ws').textContent(), 'Notes', 'History removal does not close the current workspace'); await page.keyboard.press('Escape'); await trigger.click(); assert.equal(await menu.getByText('D:\\Missing', { exact: true }).count(), 0, 'Removed paths stay absent after reopening'); @@ -126,6 +126,7 @@ await runSmoke("workspace/openAndCreate", async ({ page }) => { await page.keyboard.press('Escape'); } await page.setViewportSize({ width: 1100, height: 800 }); + assert.equal(await page.locator('.ws').textContent(), 'Notes', 'History removal does not close the current workspace'); await page.evaluate(() => window.__TEST__.clear()); await trigger.click(); await menu.getByText("No recent workspaces yet.").waitFor();