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:
@@ -1,7 +1,7 @@
|
||||
// Table drag handles: hover and focus grips, previews, row and column moves, undo, cancellation, keyboard moves, and auto-scroll.
|
||||
import assert from "node:assert/strict";
|
||||
import path from "node:path";
|
||||
import { mockTauri, outputDir, runSmoke, smokeUrl } from "../_harness/index.mjs";
|
||||
import { chooseView, mockTauri, outputDir, runSmoke, smokeUrl } from "../_harness/index.mjs";
|
||||
|
||||
const source = '# Drag tables\n\n| Name | Value | Notes |\n| :--- | ---: | :---: |\n| Alpha | 10 | **Bold**<br>second line |\n| Beta | 20 | Two |\n| Gamma | 30 | Three |\n| Delta | 40 | Four |\n\nAfter.\n';
|
||||
const long = '# Long table\n\n| Item | Value |\n| --- | --- |\n' + Array.from({ length: 30 }, (_, i) => `| Item ${i + 1} | ${i + 1} |`).join('\n') + '\n\nAfter.\n';
|
||||
@@ -20,7 +20,7 @@ await runSmoke("tables/drag", async ({ page }) => {
|
||||
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("group", { name: "Editor layout" }).locator("button.current").press("Home");
|
||||
await chooseView(page, "Source");
|
||||
await page.locator(".source-editor .cm-content").waitFor();
|
||||
}
|
||||
const table = page.locator('.live-writer table');
|
||||
@@ -46,7 +46,7 @@ await runSmoke("tables/drag", async ({ page }) => {
|
||||
await page.goto(smokeUrl);
|
||||
await page.getByText('smoke-workspace', { exact: true }).waitFor();
|
||||
await quickOpen('drag.md');
|
||||
await page.getByRole("group", { name: "Editor layout" }).locator("button.current").press("End");
|
||||
await chooseView(page, "Write");
|
||||
await table.waitFor();
|
||||
assert.equal(await page.locator('.table-drag-row[data-index="0"]').count(), 0);
|
||||
await page.mouse.move(5, 5);
|
||||
@@ -136,7 +136,7 @@ await runSmoke("tables/drag", async ({ page }) => {
|
||||
// Long tables scroll the document while the pointer stays at its lower edge.
|
||||
await page.setViewportSize({ width: 1440, height: 700 });
|
||||
await quickOpen('long.md');
|
||||
await page.getByRole("group", { name: "Editor layout" }).locator("button.current").press("End");
|
||||
await chooseView(page, "Write");
|
||||
await table.waitFor();
|
||||
await grip('row', 1);
|
||||
const scroller = await page.locator('.live-writer .cm-scroller').boundingBox();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// and the general setting that turns formulas off and on.
|
||||
import assert from "node:assert/strict";
|
||||
import path from "node:path";
|
||||
import { mockTauri, outputDir, runSmoke, smokeUrl } from "../_harness/index.mjs";
|
||||
import { chooseView, mockTauri, outputDir, runSmoke, smokeUrl } from "../_harness/index.mjs";
|
||||
|
||||
const source = '# Table formulas\n\n| Name | Appearance | Charisma | Combined |\n| --- | ---: | ---: | ---: |\n| First | 9 | 10 | =AVERAGE(B2:C2) |\n| Second | 7 | 9 | =SUM(B3+C3)/2 |\n| Total | | | =SUM(D2:D3) |\n\nAfter.\n';
|
||||
|
||||
@@ -130,7 +130,7 @@ await runSmoke("tables/formulas", async ({ page }) => {
|
||||
assert.equal(await result(3, 1).innerText(), '12');
|
||||
assert.equal(await result(3, 3).innerText(), '58');
|
||||
for (const mode of ['Read', 'Split']) {
|
||||
await page.getByRole('group', { name: 'Document view', exact: true }).getByRole('button', { pressed: true }).press('ArrowRight');
|
||||
await chooseView(page, mode);
|
||||
const preview = page.locator('.md-page table').first();
|
||||
await preview.waitFor();
|
||||
// Enter in the last row added an empty row below Total (src/lib/editor/tableControls.ts:285).
|
||||
@@ -146,7 +146,7 @@ await runSmoke("tables/formulas", async ({ page }) => {
|
||||
assert.match(await total.innerText(), /=SUM\(D2:D3\)/);
|
||||
assert.match(await total.innerText(), /=SUM\(B2:B3\)/);
|
||||
await shot('formulas-off-split');
|
||||
await page.getByRole('group', { name: 'Document view', exact: true }).getByRole('button', { name: 'Edit', exact: true }).click();
|
||||
await chooseView(page, 'Split');
|
||||
await table.waitFor();
|
||||
assert.equal(await table.locator('.md-table-formula').count(), 0);
|
||||
assert.match(await cell(3, 3).innerText(), /=SUM\(D2:D3\)/);
|
||||
|
||||
Reference in New Issue
Block a user