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,6 +1,6 @@
|
||||
// Editor menu surfaces: Writer, spelling, IDE, and code menus share the file menu styles; and the code tint match in both themes.
|
||||
// Editor menu surfaces: Writer, spelling, Source, and code menus share the file menu styles; and the code tint match in both themes.
|
||||
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("editor/surfaces", async ({ page }) => {
|
||||
await mockTauri(page, {
|
||||
@@ -85,22 +85,19 @@ await runSmoke("editor/surfaces", async ({ page }) => {
|
||||
const tint = await page.locator('.writer-code-line').first().evaluate(node => getComputedStyle(node).backgroundColor);
|
||||
assert.ok(tint.includes('/ 0.82') || /rgba\(.+, 0\.82\)/.test(tint), `Writer code tint: ${tint}`);
|
||||
await page.screenshot({ path: `${output}/writer-code-${theme}.png` });
|
||||
await page.getByRole('group', { name: 'Document view', exact: true }).hover();
|
||||
await page.getByRole('button', { name: 'Read', exact: true }).click();
|
||||
await chooseView(page, 'Read');
|
||||
const readingTint = await page.locator('pre.md-code').evaluate(node => getComputedStyle(node).backgroundColor);
|
||||
assert.equal(readingTint, tint, 'Reader and Writer use the same code tint');
|
||||
await page.screenshot({ path: `${output}/reader-code-${theme}.png` });
|
||||
await page.getByRole('button', { name: 'Edit', exact: true }).click();
|
||||
await page.getByRole('group', { name: 'Editor layout', exact: true }).hover();
|
||||
await page.getByRole('button', { name: 'IDE', exact: true }).click();
|
||||
await chooseView(page, 'Source');
|
||||
await page.locator('.source-editor .cm-content').waitFor();
|
||||
await page.locator('.source-editor').click({ button: 'right', position: { x: 500, y: 400 } });
|
||||
assert.deepEqual(await styles(writer), reference, 'Markdown IDE retains the same menu');
|
||||
assert.deepEqual(await styles(writer), reference, 'Markdown Source retains the same menu');
|
||||
await dismiss();
|
||||
await page.locator('[data-tree-rel="sample.txt"]').click();
|
||||
await page.locator('.source-editor').click({ button: 'right', position: { x: 500, y: 400 } });
|
||||
const code = menu('Code text actions');
|
||||
assert.deepEqual(await styles(code), reference, 'Code IDE uses the host menu');
|
||||
assert.deepEqual(await styles(code), reference, 'Code Source uses the host menu');
|
||||
// The host menu is the only menu. The editor adds no menu of its own.
|
||||
assert.equal(await page.getByRole('menu').count(), 1);
|
||||
assert.equal(await code.getByRole('menuitem', { name: 'Command palette F1', exact: true }).count(), 0);
|
||||
@@ -128,9 +125,8 @@ await runSmoke("editor/surfaces", async ({ page }) => {
|
||||
await page.getByRole('button', { name: 'Files', exact: true }).click();
|
||||
await page.getByRole('button', { name: 'Show outline', exact: true }).click();
|
||||
await page.locator('[data-tree-rel="a.md"]').click();
|
||||
await page.getByRole('group', { name: 'Editor layout', exact: true }).hover();
|
||||
await page.getByRole('button', { name: 'Writer', exact: true }).click();
|
||||
report.push({ theme, passed: ['word and blank menu parity', 'spelling correction and undo', 'Writer/IDE parity', 'undo menu action', 'code menu host styles', 'transparent code in Writer/Reader', 'narrow keyboard menu'], nativeDesktop: 'not tested' });
|
||||
await chooseView(page, 'Write');
|
||||
report.push({ theme, passed: ['word and blank menu parity', 'spelling correction and undo', 'Writer/Source parity', 'undo menu action', 'code menu host styles', 'transparent code in Writer/Reader', 'narrow keyboard menu'], nativeDesktop: 'not tested' });
|
||||
}
|
||||
console.log(JSON.stringify(report, null, 2));
|
||||
}, { timeout: 15000 });
|
||||
|
||||
Reference in New Issue
Block a user