Show one view control and name the file once

Phase 5-3.

- One radio group shows Write, Source, and Read at all times, with an
  icon and a name. Narrow panes show only the icons. The arrow keys
  move the choice, and the group has one Tab stop. The current choice
  gets the selection fill and an accent bar. Hover gets only a fill.
- A Split toggle shows Read beside Write or Source. Each document pane
  keeps a split flag beside its reading flag. Read ends Split.
- Ctrl+Shift+E switches between Read and the editor. Ctrl+E still
  switches between Write and Source.
- "IDE" becomes "Source" in the Chrome type, the tab menu (a View
  submenu), the status bar, the catalog, the tests, and the docs.
- Settings, General, File name title hides the title in Write and
  Read. It is on by default.
- The breadcrumb shows only the folder of the file. The status bar
  shows the view, not the path.
- ModeSwitcher.svelte and its hover test are gone. The new test
  layout/viewModes covers the control.
- The command palette from 5-2 gets its row in docs/menu-surfaces.json.
- The user guide Format table is whole again. The 5-2 edit had put
  the Paragraph and Insert rows under the shortcut table.
- 8 new catalog rows and 10 removed rows, in French, Japanese, and
  Simplified Chinese.
- Docs: UI-049, the user guide, ui-design.md, document-tools.md,
  development.md, and the README feature list.

Tests: the new layout/viewModes, new cases in documentPanes.spec.ts
and settings.spec.ts, and the chooseView harness helper. 21 smoke
tests use the new control. Tests that read the full path from the
breadcrumb now read its tooltip.
This commit is contained in:
Knotty Wyvern
2026-10-28 19:45:08 -07:00
parent ebacdb8164
commit 9cf82503d0
64 changed files with 675 additions and 590 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ await runSmoke("layout/outline", async ({ browser }) => {
await page.keyboard.press("Control+e");
await page.locator(".cm-content").waitFor();
assert.equal(await page.locator(".right").count(), 0);
console.log("PASS: hidden outline stays hidden across Writer and IDE changes");
console.log("PASS: hidden outline stays hidden across Writer and Source changes");
await page.reload();
await page.getByRole("button", { name: "Show outline", exact: true }).waitFor();
assert.equal(await page.locator(".right").count(), 0);
+9 -13
View File
@@ -1,6 +1,6 @@
// Document splits: independent modes, edits, saves, selections, and conflicts per pane; nested relative links; narrow stacking; and the close guard.
import assert from "node:assert/strict";
import { mockTauri, outputDir, runSmoke, smokeUrl } from "../_harness/index.mjs";
import { chooseView, mockTauri, outputDir, runSmoke, smokeUrl } from "../_harness/index.mjs";
await runSmoke("layout/splits", async ({ page }) => {
const output = await outputDir("layout/splits");
@@ -66,22 +66,18 @@ await runSmoke("layout/splits", async ({ page }) => {
await page.waitForFunction(()=>window.__TEST__.writes.includes('notes/b.md'));
assert.equal(await page.evaluate(()=>window.__TEST__.writes.includes('a.md')),false,'Save uses the focused right pane');
await focus('a.md'); await page.keyboard.press('Control+s'); await page.waitForFunction(()=>window.__TEST__.writes.includes('a.md'));
await pane('notes/b.md').getByRole('group',{name:'Editor layout',exact:true}).hover();
await pane('notes/b.md').getByRole('button',{name:'IDE',exact:true}).click(); await pane('notes/b.md').locator('.source-editor .cm-content').waitFor();
await chooseView(pane('notes/b.md'), 'Source'); await pane('notes/b.md').locator('.source-editor .cm-content').waitFor();
assert.equal(await pane('a.md').locator('.cm-content').count(),1,'Changing the right mode keeps the left editor');
await openRight('a.md','Right note');
assert.equal(await page.locator('.document-pane').count(),2);
await page.waitForFunction(()=>!!document.activeElement?.matches('[data-document-path="notes/b.md"] .source-editor .cm-content')); await page.keyboard.press('Control+End'); await page.keyboard.type('\nIDE edit.'); await page.keyboard.press('Control+s');
await page.waitForFunction(()=>window.__TEST__.files.get('notes/b.md').includes('IDE edit.'));
await pane('notes/b.md').getByRole('group',{name:'Editor layout',exact:true}).hover();
await pane('notes/b.md').getByRole('button',{name:'Writer',exact:true}).click(); await pane('notes/b.md').locator('.cm-content').waitFor();
assert.match(await text('notes/b.md'),/IDE edit/);
await pane('notes/b.md').getByRole('group',{name:'Document view',exact:true}).hover();
await pane('notes/b.md').getByRole('button',{name:'Read',exact:true}).click(); await pane('notes/b.md').locator('.reading').waitFor();
await page.waitForFunction(()=>!!document.activeElement?.matches('[data-document-path="notes/b.md"] .source-editor .cm-content')); await page.keyboard.press('Control+End'); await page.keyboard.type('\nSource edit.'); await page.keyboard.press('Control+s');
await page.waitForFunction(()=>window.__TEST__.files.get('notes/b.md').includes('Source edit.'));
await chooseView(pane('notes/b.md'), 'Write'); await pane('notes/b.md').locator('.cm-content').waitFor();
assert.match(await text('notes/b.md'),/Source edit/);
await chooseView(pane('notes/b.md'), 'Read'); await pane('notes/b.md').locator('.reading').waitFor();
assert.equal(await pane('a.md').locator('.reading').count(),0,'Reading mode belongs to its pane');
await focus('a.md'); assert.equal(await pane('notes/b.md').locator('.reading').count(),1);
await pane('notes/b.md').getByRole('group',{name:'Document view',exact:true}).hover();
await pane('notes/b.md').getByRole('button',{name:'Edit',exact:true}).click(); await pane('notes/b.md').locator('.cm-content').waitFor();
await chooseView(pane('notes/b.md'), 'Write'); await pane('notes/b.md').locator('.cm-content').waitFor();
for(const path of ['a.md','notes/b.md']) await pane(path).locator('.cm-content').evaluate(async node=> {
const {EditorView}=await import('/node_modules/@codemirror/view/dist/index.js'); const v=EditorView.findFromDOM(node); const source=v.state.doc.toString(); const from=source.indexOf(source.includes('Alpha') ? 'Origin' : 'Second'); v.dispatch({selection:{anchor:from,head:from+6}});
});
@@ -146,5 +142,5 @@ await runSmoke("layout/splits", async ({ page }) => {
assert.match(reopened,/Close guard\./);
await focus('notes/b.md'); await page.keyboard.press('Control+z');
assert.equal(await text('notes/b.md'),reopened,'Closing the tab releases only its editor state');
console.log(JSON.stringify({passed:['independent Writer/IDE/Reading modes','dirty close cancellation and editor state release','independent edits and saves','per-pane selections','focus existing duplicate target','closing split retains unsaved tabs','nested relative link origin','per-pane conflict resolution','narrow layout and save','light/dark screenshots'],nativeDesktop:'not tested'},null,2));
console.log(JSON.stringify({passed:['independent Writer/Source/Reading modes','dirty close cancellation and editor state release','independent edits and saves','per-pane selections','focus existing duplicate target','closing split retains unsaved tabs','nested relative link origin','per-pane conflict resolution','narrow layout and save','light/dark screenshots'],nativeDesktop:'not tested'},null,2));
}, { timeout: 15000 });
+147
View File
@@ -0,0 +1,147 @@
// The view control: Write, Source, and Read always visible, the Split toggle, keys, the status bar, the breadcrumb, the file title setting, narrow panes, and both themes.
import assert from "node:assert/strict";
import { chooseView, mockTauri, openPage, outputDir, runSmoke, smokeUrl } from "../_harness/index.mjs";
await runSmoke("layout/viewModes", async ({ browser }) => {
const output = await outputDir("layout/viewModes");
const context = await browser.newContext({ viewport: { width: 1200, height: 760 } });
await mockTauri(context, {
commands: test => ({
...test.workspace({
root: "C:\\view-modes",
files: {
"notes/field-notes.md": "# Project field notes\n\nFirst paragraph with **bold** text.\n",
"top.md": "# Top\n\nRoot note.\n",
"src/hello.py": "print('hello')\n",
},
}),
plugins_snapshot: () => ({ root: "C:/plugins", plugins: [] }),
}),
});
const page = await openPage(context), settings = await openPage(context);
const group = page.getByRole("radiogroup", { name: "View", exact: true });
const radio = name => group.getByRole("radio", { name, exact: true });
const split = page.locator(".chrome-bar").getByRole("button", { name: "Split", exact: true });
const checked = () => group.getByRole("radio", { checked: true }).getAttribute("aria-label");
const status = () => page.locator(".status").innerText();
async function open(name) {
await page.keyboard.press("Control+p");
await page.getByRole("textbox", { name: "Find a file" }).fill(name);
await page.getByRole("dialog").getByRole("button").filter({ hasText: name }).first().click();
await page.getByRole("tab", { name, exact: true, selected: true }).waitFor();
}
await page.goto(smokeUrl);
await page.getByText("view-modes", { exact: true }).waitFor();
await open("field-notes.md");
await page.getByRole("textbox", { name: "Writing editor", exact: true }).waitFor();
// All choices stay visible, and the pointer does not move them.
assert.deepEqual(await group.getByRole("radio").evaluateAll(nodes => nodes.map(node => node.getAttribute("aria-label"))), ["Write", "Source", "Read"]);
assert.equal(await checked(), "Write");
assert.equal(await split.getAttribute("aria-pressed"), "false");
const boxes = () => group.getByRole("radio").evaluateAll(nodes => nodes.map(node => JSON.stringify(node.getBoundingClientRect())));
const before = await boxes();
await radio("Source").hover();
assert.deepEqual(await boxes(), before);
// Hover gets a fill. Only the current choice gets the accent bar.
const look = name => radio(name).evaluate(node => ({ fill: getComputedStyle(node).backgroundColor, bar: getComputedStyle(node).boxShadow }));
const [hovered, current] = [await look("Source"), await look("Write")];
assert.notEqual(hovered.fill, "rgba(0, 0, 0, 0)");
assert.equal(hovered.bar, "none");
assert.match(current.bar, /inset/);
assert.notEqual(hovered.fill, current.fill);
// The tab names the file, so the breadcrumb shows only its folder and the status bar shows only the view.
assert.equal(await page.locator(".breadcrumb").innerText(), "notes");
assert.equal(await page.locator(".breadcrumb").getAttribute("title"), "notes/field-notes.md");
assert.doesNotMatch(await status(), /field-notes/);
assert.match(await status(), /Write$/);
// The group has one Tab stop. Arrow keys, Home, and End move the choice.
assert.deepEqual(await group.getByRole("radio").evaluateAll(nodes => nodes.map(node => node.tabIndex)), [0, -1, -1]);
await radio("Write").focus();
await page.keyboard.press("ArrowRight");
await page.locator(".source-editor .cm-gutters").waitFor();
assert.equal(await checked(), "Source");
assert.equal(await page.evaluate(() => document.activeElement?.getAttribute("aria-label")), "Source");
assert.match(await status(), /Source$/);
await page.keyboard.press("End");
await page.locator(".md-page .reading").waitFor();
assert.equal(await checked(), "Read");
assert.match(await status(), /Read$/);
await page.keyboard.press("Home");
await page.locator(".live-writer").waitFor();
assert.equal(await checked(), "Write");
// Ctrl+Shift+E switches between Read and the editor. Ctrl+E switches between Write and Source.
await page.locator(".cm-content").click();
await page.keyboard.press("Control+Shift+E");
await page.locator(".md-page .reading").waitFor();
await page.keyboard.press("Control+Shift+E");
await page.locator(".live-writer").waitFor();
await page.keyboard.press("Control+e");
await page.locator(".source-editor").waitFor();
await page.keyboard.press("Control+e");
await page.locator(".live-writer").waitFor();
// Split shows Read beside the current editor. Write and Source keep it. Read ends it.
await chooseView(page, "Split");
assert.equal(await split.getAttribute("aria-pressed"), "true");
await page.locator(".body.split .live-writer").waitFor();
await page.locator(".body.split .md-page").waitFor();
await chooseView(page, "Source");
await page.locator(".body.split .source-editor").waitFor();
assert.equal(await split.getAttribute("aria-pressed"), "true");
await chooseView(page, "Read");
assert.equal(await split.getAttribute("aria-pressed"), "false");
assert.equal(await page.locator(".body.split").count(), 0);
assert.equal(await page.locator(".editor-wrap").isVisible(), false);
await chooseView(page, "Split");
await page.locator(".body.split .source-editor").waitFor();
assert.equal(await checked(), "Source");
await chooseView(page, "Split");
await chooseView(page, "Write");
// The file title shows by default. The General setting hides it in Write and Read.
assert.equal(await page.locator(".live-writer .document-title").count(), 1);
await settings.goto(smokeUrl + "/?settingsWindow=true");
await settings.getByRole("button", { name: "General", exact: true }).click();
const titleSwitch = settings.getByRole("switch", { name: "File name title", exact: true });
assert.equal(await titleSwitch.isChecked(), true);
await titleSwitch.uncheck();
await page.waitForFunction(() => !document.querySelector(".live-writer .document-title"));
await chooseView(page, "Read");
await page.locator(".md-page .reading").waitFor();
assert.equal(await page.locator(".md-page .document-title").count(), 0);
await titleSwitch.check();
await page.locator(".md-page .document-title").waitFor();
await chooseView(page, "Write");
await page.locator(".live-writer .document-title").waitFor();
for (const theme of ["dark", "light"]) {
await page.evaluate(async mode => { const { saveAppearance } = await import("/src/lib/theme/appearance.ts"); saveAppearance({ theme: "default", mode }); window.dispatchEvent(new Event("focus")); }, theme);
await page.waitForFunction(mode => document.documentElement.dataset.theme === mode, theme);
await page.locator(".chrome-bar").screenshot({ path: `${output}/bar-${theme}.png` });
await chooseView(page, "Split");
await page.locator(".chrome-bar").screenshot({ path: `${output}/bar-split-${theme}.png` });
await chooseView(page, "Split");
}
// Narrow panes show only the icons. The names stay for assistive technology and tooltips.
await page.setViewportSize({ width: 700, height: 600 });
await page.waitForFunction(() => getComputedStyle(document.querySelector(".view-modes .label")).display === "none");
assert.equal(await radio("Read").getAttribute("aria-label"), "Read");
assert.ok(await page.locator(".chrome-bar").evaluate(node => node.scrollWidth <= node.clientWidth + 1));
await page.locator(".chrome-bar").screenshot({ path: `${output}/bar-narrow.png` });
await page.setViewportSize({ width: 1200, height: 760 });
// Other text files have Write and Source only. A file at the workspace root has no folder in the breadcrumb.
await open("hello.py");
assert.deepEqual(await group.getByRole("radio").evaluateAll(nodes => nodes.map(node => node.getAttribute("aria-label"))), ["Write", "Source"]);
assert.equal(await split.count(), 0);
await open("top.md");
assert.equal(await page.locator(".breadcrumb").innerText(), "");
assert.deepEqual([...page.errors, ...settings.errors], []);
console.log("PASS: visible view choices, hover and current states, radio keys, Ctrl+E and Ctrl+Shift+E, Split, status bar, breadcrumb, file title setting, narrow panes, both themes.");
});
+23 -32
View File
@@ -3,7 +3,7 @@
import assert from "node:assert/strict";
import { readFile } from "node:fs/promises";
import path from "node:path";
import { mockTauri, outputDir, repoRoot, runSmoke, smokeUrl } from "../_harness/index.mjs";
import { chooseView, mockTauri, outputDir, repoRoot, runSmoke, smokeUrl } from "../_harness/index.mjs";
import { mockFeaturePlugins } from "../_harness/pluginMocks.mjs";
await runSmoke("layout/workbench", async ({ page }) => {
@@ -49,16 +49,11 @@ await runSmoke("layout/workbench", async ({ page }) => {
});
await mockFeaturePlugins(page);
// Choose a mode from a compact mode switcher, such as "Editor layout" or "Document view".
async function mode(group, value) {
await page.getByRole("group", { name: group, exact: true }).hover();
await page.getByRole("button", { name: value, exact: true }).click();
}
async function quickOpen(name) {
await page.keyboard.press("Control+p");
await page.getByRole("textbox", { name: "Find a file" }).fill(name);
await page.getByRole("dialog").getByRole("button").filter({ hasText: name }).first().click();
await mode("Editor layout", "IDE");
await chooseView(page, "Source");
await page.locator(".source-editor .cm-content").waitFor();
}
async function contents() {
@@ -94,7 +89,7 @@ await runSmoke("layout/workbench", async ({ page }) => {
await page.keyboard.press("Control+s");
await page.waitForFunction(expected => window.__TEST__.files.get("notes/welcome.md") === expected, original + "Added in source.");
await mode("Document view", "Split");
await chooseView(page, "Split");
await page.locator(".md-page h1").first().waitFor();
assert.ok(await page.locator(".source-editor").isVisible());
await page.evaluate(() => {
@@ -142,19 +137,17 @@ await runSmoke("layout/workbench", async ({ page }) => {
window.__TEST__.emit("workspace-event", { root: window.__TEST__.root, kind: "create", paths: ["reader-showcase.md"] });
}, showcase);
await quickOpen("reader-showcase.md");
// The Read mode is a compact switcher button; its tooltip is a decorative child (src/lib/ui/ModeSwitcher.svelte:108).
const documentView = page.getByRole("group", { name: "Document view", exact: true });
const read = documentView.locator('button[aria-label="Read"]');
const readTip = read.locator(".tooltip");
assert.equal(await read.innerText(), "");
// Each view choice shows an icon and its name. The tooltip adds the shortcut (src/lib/layout/ViewModes.svelte).
const read = page.getByRole("radiogroup", { name: "View", exact: true }).getByRole("radio", { name: "Read", exact: true });
const readTip = page.getByRole("tooltip").filter({ hasText: "Read (Ctrl+Shift+E)" });
assert.equal(await read.innerText(), "Read");
assert.equal(await read.locator("svg").count(), 1);
await documentView.hover();
await read.hover();
await readTip.waitFor({ state: "visible" });
const tip = await readTip.boundingBox();
assert.ok(tip.x >= 0 && tip.x + tip.width <= 1440);
await read.click();
assert.equal(await read.getAttribute("aria-pressed"), "true");
assert.equal(await read.getAttribute("aria-checked"), "true");
await page.locator(".reading h1:not(.document-title)").waitFor();
assert.equal(await page.locator(".source-editor").isVisible(), false);
assert.equal(await page.locator(".reading h1:not(.document-title)").innerText(), "Project field notes");
@@ -176,7 +169,7 @@ await runSmoke("layout/workbench", async ({ page }) => {
await page.locator(".md-page").evaluate(element => { element.scrollTop = 0; });
await page.screenshot({ path: path.join(output, "reader-narrow.png") });
assert.ok(await page.locator(".md-page").evaluate(element => element.scrollWidth <= element.clientWidth + 1));
await mode("Document view", "Split");
await chooseView(page, "Split");
await page.waitForFunction(() => {
const host = document.querySelector(".source-editor");
const rendered = host?.querySelector(".cm-editor");
@@ -190,11 +183,12 @@ await runSmoke("layout/workbench", async ({ page }) => {
await page.waitForFunction(() => getComputedStyle(document.querySelector(".body.split")).flexDirection === "row");
await page.screenshot({ path: path.join(output, "reader-split-wide.png") });
await mode("Document view", "Edit");
// A second press ends the Split view.
await chooseView(page, "Split");
await page.locator(".md-page").waitFor({ state: "detached" });
// The editor stores one line break character. The saved file keeps its own line breaks.
assert.equal(await contents(), showcase.replace(/\r\n/g, "\n"));
assert.equal(await page.evaluate(() => window.__TEST__.files.get("reader-showcase.md")), showcase);
await documentView.hover();
await read.focus();
await readTip.waitFor({ state: "visible" });
await page.keyboard.press("Escape");
@@ -208,7 +202,7 @@ await runSmoke("layout/workbench", async ({ page }) => {
window.__TEST__.emit("workspace-event", { root: window.__TEST__.root, kind: "create", paths: ["writing.md"] });
}, writingSource);
await quickOpen("writing.md");
await mode("Editor layout", "Writer");
await chooseView(page, "Write");
const writer = page.getByRole("textbox", { name: "Writing editor", exact: true });
await writer.waitFor();
assert.equal(await page.locator('.live-writer [contenteditable="true"]').count(), 1);
@@ -229,14 +223,14 @@ await runSmoke("layout/workbench", async ({ page }) => {
await page.keyboard.press("Control+y");
await page.keyboard.press("Control+s");
await page.waitForFunction(text => window.__TEST__.files.get("writing.md") === text, editedSource);
await mode("Editor layout", "IDE");
await chooseView(page, "Source");
await waitForText(editedSource);
await focusEditor();
await page.keyboard.press("Control+z");
await waitForText(writingSource);
await mode("Editor layout", "Writer");
await chooseView(page, "Write");
await writer.waitFor();
// Write keeps the caret of the IDE undo, so the paragraph can show its source.
// Write keeps the caret of the Source undo, so the paragraph can show its source.
await page.locator(".live-writer .cm-line").filter({ hasText: /A (\*\*)?formatted(\*\*)? paragraph\./ }).click();
await page.keyboard.press("End");
await page.keyboard.press("Enter");
@@ -301,7 +295,7 @@ await runSmoke("layout/workbench", async ({ page }) => {
window.__TEST__.emit("workspace-event", { root: window.__TEST__.root, kind: "create", paths: ["crlf.md"] });
});
await quickOpen("crlf.md");
await mode("Editor layout", "Writer");
await chooseView(page, "Write");
await page.locator(".live-writer .cm-line").filter({ hasText: "A paragraph." }).click();
await page.keyboard.press("Home");
await page.keyboard.type("Changed ");
@@ -354,7 +348,7 @@ await runSmoke("layout/workbench", async ({ page }) => {
}, tableSource);
await page.setViewportSize({ width: 1440, height: 1000 });
await quickOpen("tables.md");
await mode("Editor layout", "Writer");
await chooseView(page, "Write");
const table = page.locator('.live-writer table');
await table.waitFor();
assert.equal(await page.locator('.live-writer .document-title').innerText(), 'tables');
@@ -447,7 +441,7 @@ await runSmoke("layout/workbench", async ({ page }) => {
await page.keyboard.press('Escape');
await page.setViewportSize({ width: 1000, height: 900 });
assert.ok(await page.locator('.cm-scroller').evaluate(el => el.scrollWidth <= el.clientWidth + 1));
await mode('Document view', 'Read');
await chooseView(page, 'Read');
assert.equal(await page.locator('.md-page .document-title').innerText(), 'tables');
assert.equal(await page.locator('.md-page table br').count(), 5);
assert.ok(await page.locator('.md-page').evaluate(el => el.scrollWidth <= el.clientWidth + 1));
@@ -465,8 +459,7 @@ await runSmoke("layout/workbench", async ({ page }) => {
} });
}, selectionTable);
await quickOpen('selection-table.md');
await mode('Document view', 'Edit');
await mode('Editor layout', 'Writer');
await chooseView(page, 'Write');
const selectedTable = page.locator('.live-writer table');
const selectedCell = (r, c) => selectedTable.locator('tr').nth(r).locator('th, td').nth(c);
const fromCell = await selectedCell(1, 0).boundingBox(), toCell = await selectedCell(2, 1).boundingBox();
@@ -557,8 +550,7 @@ await runSmoke("layout/workbench", async ({ page }) => {
window.__TEST__.emit('workspace-event', { root: window.__TEST__.root, kind: 'create', paths: ['table-actions.md'] });
}, actionsSource);
await quickOpen('table-actions.md');
await mode('Document view', 'Edit');
await mode('Editor layout', 'Writer');
await chooseView(page, 'Write');
const actionTable = page.locator('.live-writer table');
const actionCell = (r, c) => actionTable.locator('tr').nth(r).locator('th, td').nth(c);
async function actionItem(label, group, r = 1, c = 0) {
@@ -694,8 +686,7 @@ await runSmoke("layout/workbench", async ({ page }) => {
window.__TEST__.emit('workspace-event', { root: window.__TEST__.root, kind: 'create', paths: ['rich-table.md'] });
}, richTable);
await quickOpen('rich-table.md');
await mode('Document view', 'Edit');
await mode('Editor layout', 'Writer');
await chooseView(page, 'Write');
const richCell = page.locator('.live-writer tbody tr').first().locator('td').last();
assert.equal(await page.locator('.live-writer .document-title').innerText(), 'rich-table');
await richCell.click();
@@ -743,7 +734,7 @@ await runSmoke("layout/workbench", async ({ page }) => {
window.__TEST__.emit('workspace-event', { root: window.__TEST__.root, kind: 'create', paths: ['table-hit-testing.md'] });
}, hitTestSource);
await quickOpen('table-hit-testing.md');
await mode('Editor layout', 'Writer');
await chooseView(page, 'Write');
async function clickRenderedLine(locator, expected) {
await locator.scrollIntoViewIfNeeded();
const rect = await locator.boundingBox();