From 034cc8f71a0d5fb30fff41f7ef187c2840cdccd4 Mon Sep 17 00:00:00 2001
From: n30nex
Date: Sun, 11 Oct 2026 22:37:33 -0400
Subject: [PATCH] Use native control templates and share duplicated view
styling
---
web/e2e/netgraph-regions.spec.ts | 6 +-
web/netgraph/index.html | 3 +
web/src/main.ts | 1 +
web/src/netgraph/cameraControls.ts | 8 +-
web/src/netgraph/main.ts | 1 +
web/src/netgraph/regionControls.ts | 7 +-
web/src/netgraph/styles.css | 164 ++++---------------
web/src/networkControls.css | 63 +++++++
web/src/styles.css | 255 ++++-------------------------
9 files changed, 152 insertions(+), 356 deletions(-)
create mode 100644 web/src/networkControls.css
diff --git a/web/e2e/netgraph-regions.spec.ts b/web/e2e/netgraph-regions.spec.ts
index 4600a1a..8f73a74 100644
--- a/web/e2e/netgraph-regions.spec.ts
+++ b/web/e2e/netgraph-regions.spec.ts
@@ -40,7 +40,8 @@ test('spacing and dragging survive refresh while live packets keep their routes
const stage = page.locator('#netgraph-stage');
await expect(stage).toHaveAttribute('data-render-state', 'idle');
await layoutPanel(page);
- await page.getByLabel('Region spacing', { exact: true }).fill('2');
+ await page.getByLabel('Region spacing', { exact: true }).focus(); await page.keyboard.press('Home');
+ for (let i = 0; i < 10; i++) await page.keyboard.press('ArrowRight');
await expect(stage).toHaveAttribute('data-region-spacing', '2');
await expect(stage).toHaveAttribute('data-visible-routes', '2');
await page.getByRole('button', { name: 'Move region right', exact: true }).click();
@@ -76,6 +77,8 @@ test('spacing and dragging survive refresh while live packets keep their routes
await expect(stage).toHaveAttribute('data-last-packet-hops', '1');
await expect.poll(() => stage.getAttribute('data-active-packets').then(Number)).toBeGreaterThan(0);
await page.screenshot({ path: info.outputPath('netgraph-arranged-live-only.png') });
+ await expect(stage).toHaveAttribute('data-active-packets', '0', { timeout: 12_000 });
+ await expect(stage).toHaveAttribute('data-residue-count', '0', { timeout: 5_000 });
await page.reload(); await expect(stage).toHaveAttribute('data-render-state', 'idle');
expect(await saved(page)).toEqual({ ...moved, routes: false });
await expect(stage).toHaveAttribute('data-region-spacing', '2');
@@ -88,6 +91,7 @@ test('spacing and dragging survive refresh while live packets keep their routes
await page.locator('#region-filter > summary').click();
const box = (await page.locator('.region-options').boundingBox())!;
expect(box.x).toBeGreaterThanOrEqual(0); expect(box.x + box.width).toBeLessThanOrEqual(page.viewportSize()!.width);
+ expect(box.y + box.height).toBeLessThan((await page.locator('.controls').boundingBox())!.y);
await page.keyboard.press('Escape'); await expect(page.locator('#region-filter')).not.toHaveAttribute('open', '');
await expect(page.locator('#region-filter > summary')).toBeFocused();
});
diff --git a/web/netgraph/index.html b/web/netgraph/index.html
index 07b8e27..0ed3a83 100644
--- a/web/netgraph/index.html
+++ b/web/netgraph/index.html
@@ -93,6 +93,9 @@
Try again
+
+ Regions · All
+ Region layout
Drag a region label to move its whole bubble. Saved on this device.