feat(editor): the simulation opens sheets, not windows in the window
A tap on a device in the simulation now only chooses it; its three-dot button (or a long press) opens what Java's click opened: the desktop, and newly a switch's SAT table and a home router's NAT table, beside each card's data exchange. The desktop, the tables and the data exchange are no windows in the window any more but the simulation's sheet (SimulationSheet), after the dashboard's AppSheet: below the toolbar to the bottom, a head with icon, title, who else has it open, see-through and close. One at a time — it covers the surface. It stays over a return to the design with the program open on a desktop; a sheet whose device was removed closes. See-through fades the body (0.55) and keeps the head; the choice is kept in the browser. Java opens these as movable windows, several at once, with a click; named in CHANGES.md. Tests open through the menu (showFromMenu, showDesktop in editorPage.ts). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
// changed), the rule chosen and removed.
|
||||
|
||||
import { expect, test, type Page } from '@playwright/test';
|
||||
import { drawing, onDevice, openEditor, serveEditor } from './editorPage.js';
|
||||
import { drawing, onDevice, openEditor, serveEditor, showDesktop } from './editorPage.js';
|
||||
|
||||
let server: { readonly base: string; readonly close: () => Promise<void> };
|
||||
|
||||
@@ -20,9 +20,7 @@ test.afterAll(async () => {
|
||||
|
||||
async function desktopOf(page: Page, name: string) {
|
||||
const id = (await drawing(page)).nodes.find((node) => node.name === name)!.id;
|
||||
const at = await onDevice(page, id);
|
||||
await page.mouse.click(at.x, at.y);
|
||||
return page.locator(`section[data-desktop="${id}"]`);
|
||||
return showDesktop(page, id);
|
||||
}
|
||||
|
||||
async function install(page: Page, desktop: ReturnType<Page['locator']>, program: string) {
|
||||
@@ -65,7 +63,7 @@ test('keeps a computer’s firewall as Java’s window does, and the firewall le
|
||||
await expect(port).toHaveValue('');
|
||||
|
||||
// A notebook's browser is let through by the rule; the log says so.
|
||||
await desktop.locator('.desktop-close').click();
|
||||
await desktop.locator('.simulation-sheet__close').click();
|
||||
const notebook = await desktopOf(page, 'Rechner 1');
|
||||
await notebook.locator('[data-program="webBrowser"]').click();
|
||||
const browser = notebook.locator('[data-program-window="webBrowser"]');
|
||||
@@ -75,12 +73,12 @@ test('keeps a computer’s firewall as Java’s window does, and the firewall le
|
||||
await expect(browser.frameLocator('iframe[title="Seite"]').locator('body')).not.toBeEmpty({ timeout: 30_000 });
|
||||
|
||||
// ICMP no longer allowed: the notebook's ping is dropped.
|
||||
await notebook.locator('.desktop-close').click();
|
||||
await notebook.locator('.simulation-sheet__close').click();
|
||||
await desktopOf(page, 'Web-Server');
|
||||
await desktop.locator('[data-program="firewall"]').click();
|
||||
await icmp.click();
|
||||
await expect(icmp).not.toBeChecked();
|
||||
await desktop.locator('.desktop-close').click();
|
||||
await desktop.locator('.simulation-sheet__close').click();
|
||||
await desktopOf(page, 'Rechner 1');
|
||||
await install(page, notebook, 'Befehlszeile');
|
||||
await notebook.locator('[data-program="commandPrompt"]').click();
|
||||
@@ -88,7 +86,7 @@ test('keeps a computer’s firewall as Java’s window does, and the firewall le
|
||||
await input.fill('ping 141.99.50.231');
|
||||
await input.press('Enter');
|
||||
await expect(notebook.locator('.terminal-text')).toContainText('0 Paket(e) empfangen', { timeout: 60_000 });
|
||||
await notebook.locator('.desktop-close').click();
|
||||
await notebook.locator('.simulation-sheet__close').click();
|
||||
await desktopOf(page, 'Web-Server');
|
||||
await desktop.locator('[data-program="firewall"]').click();
|
||||
await window.getByRole('tab', { name: 'Log' }).click();
|
||||
|
||||
Reference in New Issue
Block a user