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 @@
|
||||
// One full-width document Find in Writer, table cells, IDE source, and Reading: replacement, regex, CRLF, focus return, both themes, and narrow controls.
|
||||
// One full-width document Find in Writer, table cells, Source source, and Reading: replacement, regex, CRLF, focus return, both themes, and narrow controls.
|
||||
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("find/documentFind", async ({ page }) => {
|
||||
const output = await outputDir("find/documentFind");
|
||||
@@ -30,10 +30,6 @@ await runSmoke("find/documentFind", async ({ page }) => {
|
||||
const sample = "# Alpha\n\nAlpha alpha alphabet\n\n| Name | Value |\n| --- | --- |\n| Alpha | One |\n| Beta | Two |\n\nLast Alpha paragraph.\n";
|
||||
const find = page.getByRole("textbox", { name: "Find in document", exact: true });
|
||||
const replace = page.getByRole("textbox", { name: "Replace with", exact: true });
|
||||
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 onePanel() {
|
||||
assert.equal(await page.locator('.rs-find-bar:visible').count(), 1);
|
||||
assert.equal(await page.locator('.cm-search').count(), 0, 'No default CodeMirror search panel');
|
||||
@@ -82,7 +78,7 @@ await runSmoke("find/documentFind", async ({ page }) => {
|
||||
assert.match(await page.evaluate(() => window.__CM__.state.sliceDoc(window.__CM__.state.selection.main.from, window.__CM__.state.selection.main.to)), /Last Alpha/);
|
||||
await page.screenshot({ path: `${output}/table-focus-${theme}.png` });
|
||||
await page.keyboard.press('Escape');
|
||||
await mode('Editor layout', 'IDE');
|
||||
await chooseView(page, 'Source');
|
||||
await sourceEditor();
|
||||
await page.evaluate(() => { const view = window.__SOURCE__; view.dispatch({ changes: { from: 0, to: view.state.doc.length, insert: 'Alpha alpha alphabet\r\nAlpha second\r\nAlpha third' }, selection: { anchor: 0 } }); });
|
||||
await page.keyboard.press('Control+f');
|
||||
@@ -130,7 +126,7 @@ await runSmoke("find/documentFind", async ({ page }) => {
|
||||
await page.setViewportSize({ width: 1440, height: 1000 });
|
||||
await find.focus(); await page.keyboard.press('Escape');
|
||||
await page.evaluate(sample => { const view = window.__SOURCE__; view.dispatch({ changes: { from: 0, to: view.state.doc.length, insert: sample } }); }, sample);
|
||||
await mode('Document view', 'Read');
|
||||
await chooseView(page, 'Read');
|
||||
await page.locator('.reading').focus();
|
||||
await page.keyboard.press('Control+f');
|
||||
await find.fill('Alpha'); await page.keyboard.press('Enter');
|
||||
@@ -143,8 +139,7 @@ await runSmoke("find/documentFind", async ({ page }) => {
|
||||
await page.screenshot({ path: `${output}/reading-${theme}.png` });
|
||||
await page.keyboard.press('Escape');
|
||||
assert.equal(await page.locator('.reading').evaluate(node => node === document.activeElement), true);
|
||||
await mode('Document view', 'Edit');
|
||||
await mode('Editor layout', 'Writer');
|
||||
await chooseView(page, 'Write');
|
||||
}
|
||||
console.log('PASS: one full-width document Find in Writer, nested table focus, IDE/source, and Reading, with replacement, regex, CRLF, focus return, both themes, and narrow controls.');
|
||||
console.log('PASS: one full-width document Find in Writer, nested table focus, Source/source, and Reading, with replacement, regex, CRLF, focus return, both themes, and narrow controls.');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user