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,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.");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user