Show different tabs side by side in split view

Each tab menu has "Open to the right". It shows the tab in a new pane to
the right of the active pane. A pane shows a document or a plugin tab,
for example a browser tab.

- A plugin view stays in the plugin layer above the panes, so a move
  between panes does not mount it again.
- A browser tab that covers the area moves to the left pane when a tab
  opens beside it. The last pane gives its plugin tab the whole area.
- The "Split" toggle of a document is now "Read beside".

Card 565874b2.
This commit is contained in:
Knotty Wyvern
2026-11-10 06:40:44 -07:00
parent d19bb6a1f0
commit 61976191d0
22 changed files with 473 additions and 116 deletions
+6 -6
View File
@@ -21,7 +21,7 @@ await runSmoke("layout/viewModes", async ({ browser }) => {
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 split = page.locator(".chrome-bar").getByRole("button", { name: "Read beside", exact: true });
const checked = () => group.getByRole("radio", { checked: true }).getAttribute("aria-label");
const status = () => page.locator(".status").innerText();
async function open(name) {
@@ -86,7 +86,7 @@ await runSmoke("layout/viewModes", async ({ browser }) => {
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");
await chooseView(page, "Read beside");
assert.equal(await split.getAttribute("aria-pressed"), "true");
await page.locator(".body.split .live-writer").waitFor();
await page.locator(".body.split .md-page").waitFor();
@@ -97,10 +97,10 @@ await runSmoke("layout/viewModes", async ({ browser }) => {
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 chooseView(page, "Read beside");
await page.locator(".body.split .source-editor").waitFor();
assert.equal(await checked(), "Source");
await chooseView(page, "Split");
await chooseView(page, "Read beside");
await chooseView(page, "Write");
// The file title shows by default. The General setting hides it in Write and Read.
@@ -123,9 +123,9 @@ await runSmoke("layout/viewModes", async ({ browser }) => {
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 chooseView(page, "Read beside");
await page.locator(".chrome-bar").screenshot({ path: `${output}/bar-split-${theme}.png` });
await chooseView(page, "Split");
await chooseView(page, "Read beside");
}
// The controls show icons only, at every width (UI-056). The names stay for assistive technology and tooltips.