@sleep2agi/agent-network-dashboard 0.4.6-preview.9 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +1 -0
- package/.next/build-manifest.json +3 -3
- package/.next/diagnostics/route-bundle-stats.json +69 -55
- package/.next/fallback-build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +6 -0
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +2 -2
- package/.next/server/app/_not-found.rsc +12 -12
- package/.next/server/app/_not-found.segments/_full.segment.rsc +12 -12
- package/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
- package/.next/server/app/_not-found.segments/_index.segment.rsc +7 -7
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin.html +2 -2
- package/.next/server/app/admin.rsc +14 -14
- package/.next/server/app/admin.segments/_full.segment.rsc +14 -14
- package/.next/server/app/admin.segments/_head.segment.rsc +4 -4
- package/.next/server/app/admin.segments/_index.segment.rsc +7 -7
- package/.next/server/app/admin.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/admin.segments/admin/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/admin.segments/admin.segment.rsc +3 -3
- package/.next/server/app/api/hub/servers/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/hub/servers/route/build-manifest.json +9 -0
- package/.next/server/app/api/hub/servers/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/hub/servers/route.js +7 -0
- package/.next/server/app/api/hub/servers/route.js.map +5 -0
- package/.next/server/app/api/hub/servers/route.js.nft.json +1 -0
- package/.next/server/app/api/hub/servers/route_client-reference-manifest.js +3 -0
- package/.next/server/app/index.html +2 -2
- package/.next/server/app/index.rsc +14 -14
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/index.segments/_full.segment.rsc +14 -14
- package/.next/server/app/index.segments/_head.segment.rsc +4 -4
- package/.next/server/app/index.segments/_index.segment.rsc +7 -7
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login.html +2 -2
- package/.next/server/app/login.rsc +14 -14
- package/.next/server/app/login.segments/_full.segment.rsc +14 -14
- package/.next/server/app/login.segments/_head.segment.rsc +4 -4
- package/.next/server/app/login.segments/_index.segment.rsc +7 -7
- package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/login.segments/login.segment.rsc +3 -3
- package/.next/server/app/logs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/logs.html +2 -2
- package/.next/server/app/logs.rsc +14 -14
- package/.next/server/app/logs.segments/_full.segment.rsc +14 -14
- package/.next/server/app/logs.segments/_head.segment.rsc +4 -4
- package/.next/server/app/logs.segments/_index.segment.rsc +7 -7
- package/.next/server/app/logs.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/logs.segments/logs/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/logs.segments/logs.segment.rsc +3 -3
- package/.next/server/app/messages/page_client-reference-manifest.js +1 -1
- package/.next/server/app/messages.html +2 -2
- package/.next/server/app/messages.rsc +14 -14
- package/.next/server/app/messages.segments/_full.segment.rsc +14 -14
- package/.next/server/app/messages.segments/_head.segment.rsc +4 -4
- package/.next/server/app/messages.segments/_index.segment.rsc +7 -7
- package/.next/server/app/messages.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/messages.segments/messages/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/messages.segments/messages.segment.rsc +3 -3
- package/.next/server/app/node/page_client-reference-manifest.js +1 -1
- package/.next/server/app/node.html +2 -2
- package/.next/server/app/node.rsc +14 -14
- package/.next/server/app/node.segments/_full.segment.rsc +14 -14
- package/.next/server/app/node.segments/_head.segment.rsc +4 -4
- package/.next/server/app/node.segments/_index.segment.rsc +7 -7
- package/.next/server/app/node.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/node.segments/node/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/node.segments/node.segment.rsc +3 -3
- package/.next/server/app/nodes/page_client-reference-manifest.js +1 -1
- package/.next/server/app/nodes.html +2 -2
- package/.next/server/app/nodes.rsc +14 -14
- package/.next/server/app/nodes.segments/_full.segment.rsc +14 -14
- package/.next/server/app/nodes.segments/_head.segment.rsc +4 -4
- package/.next/server/app/nodes.segments/_index.segment.rsc +7 -7
- package/.next/server/app/nodes.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/nodes.segments/nodes/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/nodes.segments/nodes.segment.rsc +3 -3
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/server-logs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/server-logs.html +2 -2
- package/.next/server/app/server-logs.rsc +14 -14
- package/.next/server/app/server-logs.segments/_full.segment.rsc +14 -14
- package/.next/server/app/server-logs.segments/_head.segment.rsc +4 -4
- package/.next/server/app/server-logs.segments/_index.segment.rsc +7 -7
- package/.next/server/app/server-logs.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/server-logs.segments/server-logs/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/server-logs.segments/server-logs.segment.rsc +3 -3
- package/.next/server/app/settings/networks/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/networks.html +2 -2
- package/.next/server/app/settings/networks.rsc +14 -14
- package/.next/server/app/settings/networks.segments/_full.segment.rsc +14 -14
- package/.next/server/app/settings/networks.segments/_head.segment.rsc +4 -4
- package/.next/server/app/settings/networks.segments/_index.segment.rsc +7 -7
- package/.next/server/app/settings/networks.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/settings/networks.segments/settings/networks/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/settings/networks.segments/settings/networks.segment.rsc +3 -3
- package/.next/server/app/settings/networks.segments/settings.segment.rsc +3 -3
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/tokens/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/tokens.html +2 -2
- package/.next/server/app/settings/tokens.rsc +14 -14
- package/.next/server/app/settings/tokens.segments/_full.segment.rsc +14 -14
- package/.next/server/app/settings/tokens.segments/_head.segment.rsc +4 -4
- package/.next/server/app/settings/tokens.segments/_index.segment.rsc +7 -7
- package/.next/server/app/settings/tokens.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/settings/tokens.segments/settings/tokens/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/settings/tokens.segments/settings/tokens.segment.rsc +3 -3
- package/.next/server/app/settings/tokens.segments/settings.segment.rsc +3 -3
- package/.next/server/app/settings.html +2 -2
- package/.next/server/app/settings.rsc +14 -14
- package/.next/server/app/settings.segments/_full.segment.rsc +14 -14
- package/.next/server/app/settings.segments/_head.segment.rsc +4 -4
- package/.next/server/app/settings.segments/_index.segment.rsc +7 -7
- package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/settings.segments/settings.segment.rsc +3 -3
- package/.next/server/app/tasks/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/tasks/page_client-reference-manifest.js +1 -1
- package/.next/server/app/tasks.html +2 -2
- package/.next/server/app/tasks.rsc +14 -14
- package/.next/server/app/tasks.segments/_full.segment.rsc +14 -14
- package/.next/server/app/tasks.segments/_head.segment.rsc +4 -4
- package/.next/server/app/tasks.segments/_index.segment.rsc +7 -7
- package/.next/server/app/tasks.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/tasks.segments/tasks/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/tasks.segments/tasks.segment.rsc +3 -3
- package/.next/server/app-paths-manifest.json +1 -0
- package/.next/server/chunks/0ykm__next-internal_server_app_api_hub_servers_route_actions_08-m-cs.js +3 -0
- package/.next/server/chunks/0ykm__next-internal_server_app_api_hub_servers_route_actions_08-m-cs.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__0tx8s8i._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0tx8s8i._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__03b.f76._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__03b.f76._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0fhoq8i._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0fhoq8i._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0nw~zhp._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0nw~zhp._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_09kk21a._.js +2 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_09kk21a._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_01jhlxz._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_01jhlxz._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_057q.ne._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_057q.ne._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_09d29my._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_09d29my._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_0_d45-d._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_0_d45-d._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_0i3759l._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_0i3759l._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_0xgney8._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_0xgney8._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_10hjgv4._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_10hjgv4._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_1153xeb._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_1153xeb._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_12l4oto._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_12l4oto._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_components_0mvyi-4._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_components_0mvyi-4._.js.map +1 -1
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/404.html +2 -2
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/0-mpa_947ipeq.js +1 -0
- package/.next/static/chunks/01lmbsd37fybu.js +1 -0
- package/.next/static/chunks/03o.h6kvmw4l_.js +1 -0
- package/.next/static/chunks/03~~oirxz7~vc.js +1 -0
- package/.next/static/chunks/05uk96gc~9mni.js +1 -0
- package/.next/static/chunks/088ouqy7tekty.js +2 -0
- package/.next/static/chunks/08kf-.bgs10ze.js +1 -0
- package/.next/static/chunks/0glmrdj9112tc.js +7 -0
- package/.next/static/chunks/0hyl7mdapsz38.js +1 -0
- package/.next/static/chunks/0mqwn-l7wtcdo.js +7 -0
- package/.next/static/chunks/0rxrez_cjn.eh.js +1 -0
- package/.next/static/chunks/0tvn2l1pc.h65.js +1 -0
- package/.next/static/chunks/0x8x.29hkju5a.js +1 -0
- package/.next/static/chunks/127kw7~wsnyu7.css +2 -0
- package/.next/static/chunks/16yfxp9ak2gdm.js +1 -0
- package/.next/static/chunks/174re5ar~kxne.js +1 -0
- package/.next/trace +2 -2
- package/.next/trace-build +1 -1
- package/.next/types/routes.d.ts +2 -1
- package/.next/types/validator.ts +9 -0
- package/app/api/hub/servers/route.ts +39 -0
- package/app/components/AppShell.tsx +2 -0
- package/app/components/ChatPopover.tsx +38 -2
- package/app/components/HelpOverlay.tsx +18 -0
- package/app/components/ServersDrawer.tsx +206 -0
- package/app/components/TopoGraph.tsx +833 -138
- package/app/components/utils.ts +8 -7
- package/app/lib/time.ts +36 -0
- package/package.json +1 -1
- package/scripts/help-overlay-topo-test.mjs +44 -0
- package/scripts/servers-drawer-live-test.mjs +96 -0
- package/scripts/topo-active-links-chip-test.mjs +73 -0
- package/scripts/topo-arrow-tier-test.mjs +61 -0
- package/scripts/topo-auto-fit-test.mjs +73 -0
- package/scripts/topo-chat-focus-ring-test.mjs +77 -0
- package/scripts/topo-click-ripple-test.mjs +66 -0
- package/scripts/topo-cwd-tooltip-test.mjs +64 -0
- package/scripts/topo-dblclick-reset-test.mjs +74 -0
- package/scripts/topo-edge-hover-test.mjs +85 -0
- package/scripts/topo-edge-tooltip-test.mjs +70 -0
- package/scripts/topo-fit-key-test.mjs +106 -0
- package/scripts/topo-freshness-chip-test.mjs +74 -0
- package/scripts/topo-group-count-test.mjs +63 -0
- package/scripts/topo-group-hover-test.mjs +82 -0
- package/scripts/topo-hub-title-test.mjs +88 -0
- package/scripts/topo-label-lift-test.mjs +115 -0
- package/scripts/topo-label-scale-test.mjs +78 -0
- package/scripts/topo-lastseen-tooltip-test.mjs +59 -0
- package/scripts/topo-layout-key-test.mjs +91 -0
- package/scripts/topo-minimap-test.mjs +68 -0
- package/scripts/topo-mobile-chips-test.mjs +103 -0
- package/scripts/topo-offline-dim-test.mjs +70 -0
- package/scripts/topo-overlap-test.mjs +32 -5
- package/scripts/topo-pan-cursor-test.mjs +62 -0
- package/scripts/topo-popover-meta-test.mjs +78 -0
- package/scripts/topo-pressure-bar-test.mjs +69 -0
- package/scripts/topo-pulse-rate-test.mjs +71 -0
- package/scripts/topo-recent-signal-empty-test.mjs +63 -0
- package/scripts/topo-reduced-motion-test.mjs +77 -0
- package/scripts/topo-tz-ghost-test.mjs +69 -0
- package/scripts/topo-wheel-zoom-test.mjs +79 -0
- package/scripts/topo-zoom-keys-test.mjs +89 -0
- package/.next/static/chunks/0-7iowzu4.798.js +0 -1
- package/.next/static/chunks/02t5jr4shh.hy.js +0 -1
- package/.next/static/chunks/0_qfg5s5uzs7..js +0 -7
- package/.next/static/chunks/0_rmxom9~1lmk.css +0 -2
- package/.next/static/chunks/0cj5qr_a8dzky.js +0 -7
- package/.next/static/chunks/0elalb9n_.~di.js +0 -1
- package/.next/static/chunks/0j_q__o8p6g83.js +0 -1
- package/.next/static/chunks/0jl6_w50zh4l5.js +0 -1
- package/.next/static/chunks/0kgak.tfh2-~i.js +0 -1
- package/.next/static/chunks/0r4q73.-1bkyl.js +0 -1
- package/.next/static/chunks/0r_c8eccg3z2o.js +0 -1
- package/.next/static/chunks/10oi7l-tycgl9.js +0 -1
- package/.next/static/chunks/11uk1izuv3~0t.js +0 -1
- package/.next/static/chunks/131.zrqhdbu5x.js +0 -1
- package/.next/static/chunks/165lqf5.z.n10.js +0 -1
- /package/.next/static/{T0hK2WE0kVtyFouPsSpos → 23MxP0RBVA4BaOJ_HMYmM}/_buildManifest.js +0 -0
- /package/.next/static/{T0hK2WE0kVtyFouPsSpos → 23MxP0RBVA4BaOJ_HMYmM}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{T0hK2WE0kVtyFouPsSpos → 23MxP0RBVA4BaOJ_HMYmM}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/* Round 21 verification: SVG cursor flips from grab → grabbing during
|
|
2
|
+
* a pan drag and back to grab on release. */
|
|
3
|
+
import { chromium } from 'playwright';
|
|
4
|
+
import { readFileSync } from 'node:fs';
|
|
5
|
+
|
|
6
|
+
const TOKEN = JSON.parse(readFileSync('/home/vansin/.anet/config.json', 'utf8')).token;
|
|
7
|
+
const browser = await chromium.launch({ headless: true });
|
|
8
|
+
// Need a tall enough viewport to keep the SVG ABOVE the fold so real
|
|
9
|
+
// pointer events land — at 1280×900 the canvas starts at ~y=815 (the
|
|
10
|
+
// /admin hero + StatsBar above push it below the viewport bottom).
|
|
11
|
+
const ctx = await browser.newContext({ viewport: { width: 1280, height: 1600 } });
|
|
12
|
+
await ctx.addCookies([{ name: 'anet_dashboard_session', value: `v3:${TOKEN}`, domain: '127.0.0.1', path: '/' }]);
|
|
13
|
+
await ctx.addInitScript(() => {
|
|
14
|
+
try {
|
|
15
|
+
localStorage.setItem('anet-theme', 'cyber');
|
|
16
|
+
localStorage.setItem('anet-topo-layout', 'grid');
|
|
17
|
+
sessionStorage.setItem('anet_v3_auth', '1');
|
|
18
|
+
} catch {}
|
|
19
|
+
});
|
|
20
|
+
const fresh = new Date(Date.now() - 60 * 1000).toISOString();
|
|
21
|
+
await ctx.route('**/api/hub/status*', async (route) => {
|
|
22
|
+
const r = await route.fetch();
|
|
23
|
+
const b = await r.json();
|
|
24
|
+
const nid = (b.sessions || [])[0]?.network_id || 'default';
|
|
25
|
+
const sessions = ['a', 'b'].map(a => ({
|
|
26
|
+
alias: a, status: 'idle', network_id: nid, project_dir: null,
|
|
27
|
+
created_at: fresh, updated_at: fresh, last_seen_at: fresh,
|
|
28
|
+
}));
|
|
29
|
+
await route.fulfill({ response: r, json: { ...b, sessions } });
|
|
30
|
+
});
|
|
31
|
+
await ctx.route('**/api/hub/tasks*', (route) => route.fulfill({ json: { tasks: [] } }));
|
|
32
|
+
const page = await ctx.newPage();
|
|
33
|
+
await page.goto('http://127.0.0.1:3000/', { waitUntil: 'domcontentloaded' });
|
|
34
|
+
await page.waitForSelector('svg[viewBox="0 0 1000 680"]', { timeout: 30000 });
|
|
35
|
+
await page.waitForTimeout(400);
|
|
36
|
+
|
|
37
|
+
const cursorAt = () => page.$eval('svg[viewBox="0 0 1000 680"]', el => el.style.cursor);
|
|
38
|
+
const rest = await cursorAt();
|
|
39
|
+
|
|
40
|
+
// pick a pan-safe target far from any node — top-left empty canvas region
|
|
41
|
+
const box = await page.$eval('svg[viewBox="0 0 1000 680"]', el => el.getBoundingClientRect());
|
|
42
|
+
const sx = box.x + box.width * 0.08;
|
|
43
|
+
const sy = box.y + box.height * 0.40;
|
|
44
|
+
|
|
45
|
+
await page.mouse.move(sx, sy);
|
|
46
|
+
await page.mouse.down();
|
|
47
|
+
await page.mouse.move(sx + 40, sy + 30);
|
|
48
|
+
await page.waitForTimeout(50);
|
|
49
|
+
const during = await cursorAt();
|
|
50
|
+
await page.mouse.up();
|
|
51
|
+
await page.waitForTimeout(50);
|
|
52
|
+
const after = await cursorAt();
|
|
53
|
+
|
|
54
|
+
await browser.close();
|
|
55
|
+
const results = {
|
|
56
|
+
restIsGrab: rest === 'grab',
|
|
57
|
+
duringIsGrabbing: during === 'grabbing',
|
|
58
|
+
afterIsGrab: after === 'grab',
|
|
59
|
+
};
|
|
60
|
+
const ok = Object.values(results).every(Boolean);
|
|
61
|
+
console.log(`${ok ? '✅' : '❌'} pan cursor:`, JSON.stringify(results), `rest=${rest} during=${during} after=${after}`);
|
|
62
|
+
process.exit(ok ? 0 : 1);
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/* Round 37 verification: ChatPopover header carries cwd / last-seen
|
|
2
|
+
* lines pulled from the SWR session cache. Three cases:
|
|
3
|
+
* - online node with cwd → cwd line, no last-seen
|
|
4
|
+
* - offline node with cwd → both lines
|
|
5
|
+
* - bare node (no cwd, no last_seen) → drag/Esc fallback hint */
|
|
6
|
+
import { chromium } from 'playwright';
|
|
7
|
+
import { readFileSync } from 'node:fs';
|
|
8
|
+
|
|
9
|
+
const TOKEN = JSON.parse(readFileSync('/home/vansin/.anet/config.json', 'utf8')).token;
|
|
10
|
+
const browser = await chromium.launch({ headless: true });
|
|
11
|
+
|
|
12
|
+
async function probe(targetAlias) {
|
|
13
|
+
const ctx = await browser.newContext({ viewport: { width: 1400, height: 1000 } });
|
|
14
|
+
await ctx.addCookies([{ name: 'anet_dashboard_session', value: `v3:${TOKEN}`, domain: '127.0.0.1', path: '/' }]);
|
|
15
|
+
await ctx.addInitScript(() => {
|
|
16
|
+
try {
|
|
17
|
+
localStorage.setItem('anet-theme', 'cyber');
|
|
18
|
+
localStorage.setItem('anet-topo-layout', 'grid');
|
|
19
|
+
localStorage.setItem('anet-topo-nodescale', '1');
|
|
20
|
+
sessionStorage.setItem('anet_v3_auth', '1');
|
|
21
|
+
} catch {}
|
|
22
|
+
});
|
|
23
|
+
const fresh = new Date(Date.now() - 60 * 1000).toISOString();
|
|
24
|
+
const offline = new Date(Date.now() - 8 * 60 * 1000).toISOString(); // 8 min ago
|
|
25
|
+
await ctx.route('**/api/hub/status*', async (route) => {
|
|
26
|
+
const r = await route.fetch();
|
|
27
|
+
const b = await r.json();
|
|
28
|
+
const nid = (b.sessions || [])[0]?.network_id || 'default';
|
|
29
|
+
const sessions = [
|
|
30
|
+
{ alias: 'liveCwd', status: 'idle', network_id: nid,
|
|
31
|
+
project_dir: '/home/vansin/agent-orchestra',
|
|
32
|
+
created_at: fresh, updated_at: fresh, last_seen_at: fresh },
|
|
33
|
+
{ alias: 'offCwd', status: 'offline', network_id: nid,
|
|
34
|
+
project_dir: '/home/vansin/some-project',
|
|
35
|
+
created_at: fresh, updated_at: fresh, last_seen_at: offline },
|
|
36
|
+
{ alias: 'bare', status: 'idle', network_id: nid, project_dir: null,
|
|
37
|
+
created_at: fresh, updated_at: fresh, last_seen_at: fresh },
|
|
38
|
+
];
|
|
39
|
+
await route.fulfill({ response: r, json: { ...b, sessions } });
|
|
40
|
+
});
|
|
41
|
+
await ctx.route('**/api/hub/tasks*', (route) => route.fulfill({ json: { tasks: [] } }));
|
|
42
|
+
const page = await ctx.newPage();
|
|
43
|
+
await page.goto('http://127.0.0.1:3000/', { waitUntil: 'domcontentloaded' });
|
|
44
|
+
await page.waitForFunction(() => document.querySelectorAll('g[data-node]').length === 3, { timeout: 30000 });
|
|
45
|
+
await page.waitForTimeout(400);
|
|
46
|
+
await page.locator(`g[data-node="${targetAlias}"]`).click();
|
|
47
|
+
await page.waitForTimeout(300);
|
|
48
|
+
const meta = await page.evaluate(() => {
|
|
49
|
+
const cwd = document.querySelector('[data-popover-cwd]');
|
|
50
|
+
const ls = document.querySelector('[data-popover-lastseen]');
|
|
51
|
+
const popover = document.querySelector('[aria-label^="Chat with"]');
|
|
52
|
+
const dragHint = popover ? [...popover.querySelectorAll('div')].find(d => /Drag to move/.test(d.textContent || '')) : null;
|
|
53
|
+
return {
|
|
54
|
+
cwdText: cwd?.textContent || null,
|
|
55
|
+
lsText: ls?.textContent || null,
|
|
56
|
+
dragHintPresent: !!dragHint,
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
await ctx.close();
|
|
60
|
+
return meta;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const live = await probe('liveCwd');
|
|
64
|
+
const off = await probe('offCwd');
|
|
65
|
+
const bare = await probe('bare');
|
|
66
|
+
await browser.close();
|
|
67
|
+
|
|
68
|
+
const results = {
|
|
69
|
+
liveShowsCwd: live.cwdText === 'cwd: /home/vansin/agent-orchestra' && live.lsText === null && !live.dragHintPresent,
|
|
70
|
+
offlineShowsBoth: off.cwdText === 'cwd: /home/vansin/some-project'
|
|
71
|
+
&& /last seen: [78]m ago/.test(off.lsText || '')
|
|
72
|
+
&& !off.dragHintPresent,
|
|
73
|
+
bareFallsBackToDragHint: bare.cwdText === null && bare.lsText === null && bare.dragHintPresent,
|
|
74
|
+
};
|
|
75
|
+
const ok = Object.values(results).every(Boolean);
|
|
76
|
+
console.log(`${ok ? '✅' : '❌'} popover meta:`, JSON.stringify(results),
|
|
77
|
+
`\n live=`, live, `\n off=`, off, `\n bare=`, bare);
|
|
78
|
+
process.exit(ok ? 0 : 1);
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/* Round 31 verification: fleet-pressure chip with proportional segments.
|
|
2
|
+
* 4 working + 6 idle + 2 offline = 12 total → 33% / 50% / 17%. */
|
|
3
|
+
import { chromium } from 'playwright';
|
|
4
|
+
import { readFileSync } from 'node:fs';
|
|
5
|
+
|
|
6
|
+
const TOKEN = JSON.parse(readFileSync('/home/vansin/.anet/config.json', 'utf8')).token;
|
|
7
|
+
const browser = await chromium.launch({ headless: true });
|
|
8
|
+
const ctx = await browser.newContext({ viewport: { width: 1400, height: 1000 } });
|
|
9
|
+
await ctx.addCookies([{ name: 'anet_dashboard_session', value: `v3:${TOKEN}`, domain: '127.0.0.1', path: '/' }]);
|
|
10
|
+
await ctx.addInitScript(() => {
|
|
11
|
+
try {
|
|
12
|
+
localStorage.setItem('anet-theme', 'cyber');
|
|
13
|
+
localStorage.setItem('anet-topo-layout', 'grid');
|
|
14
|
+
sessionStorage.setItem('anet_v3_auth', '1');
|
|
15
|
+
} catch {}
|
|
16
|
+
});
|
|
17
|
+
const fresh = new Date(Date.now() - 60 * 1000).toISOString();
|
|
18
|
+
await ctx.route('**/api/hub/status*', async (route) => {
|
|
19
|
+
const r = await route.fetch();
|
|
20
|
+
const b = await r.json();
|
|
21
|
+
const nid = (b.sessions || [])[0]?.network_id || 'default';
|
|
22
|
+
const make = (alias, status) => ({
|
|
23
|
+
alias, status, network_id: nid, project_dir: null,
|
|
24
|
+
created_at: fresh, updated_at: fresh, last_seen_at: fresh,
|
|
25
|
+
});
|
|
26
|
+
const sessions = [
|
|
27
|
+
...Array.from({ length: 4 }, (_, i) => make(`w${i}`, 'working')),
|
|
28
|
+
...Array.from({ length: 6 }, (_, i) => make(`i${i}`, 'idle')),
|
|
29
|
+
...Array.from({ length: 2 }, (_, i) => make(`o${i}`, 'offline')),
|
|
30
|
+
];
|
|
31
|
+
await route.fulfill({ response: r, json: { ...b, sessions } });
|
|
32
|
+
});
|
|
33
|
+
await ctx.route('**/api/hub/tasks*', (route) => route.fulfill({ json: { tasks: [] } }));
|
|
34
|
+
const page = await ctx.newPage();
|
|
35
|
+
await page.goto('http://127.0.0.1:3000/', { waitUntil: 'domcontentloaded' });
|
|
36
|
+
await page.waitForSelector('[data-fleet-pressure]', { timeout: 30000 });
|
|
37
|
+
await page.waitForTimeout(400);
|
|
38
|
+
|
|
39
|
+
const chip = '[data-fleet-pressure]';
|
|
40
|
+
const titleText = await page.locator(chip).getAttribute('title');
|
|
41
|
+
// The chip layout: <chip> > <label-span> + <bar-span> ; bar-span has the 3 segment spans.
|
|
42
|
+
const segments = await page.evaluate(() => {
|
|
43
|
+
const chip = document.querySelector('[data-fleet-pressure]');
|
|
44
|
+
if (!chip) return [];
|
|
45
|
+
// The bar container is the inline-flex w-16 span (second child).
|
|
46
|
+
const bar = [...chip.children].find(c => c.classList?.contains('w-16'));
|
|
47
|
+
if (!bar) return [];
|
|
48
|
+
return [...bar.children].map(el => ({ width: el.style.width, background: el.style.background }));
|
|
49
|
+
});
|
|
50
|
+
const segmentWidths = segments.map(s => s.width);
|
|
51
|
+
const segmentColors = segments.map(s => s.background);
|
|
52
|
+
|
|
53
|
+
// 4/12 = 33.33%, 6/12 = 50.00%, 2/12 = 16.67%
|
|
54
|
+
const close = (a, b) => Math.abs(parseFloat(a) - b) < 0.5;
|
|
55
|
+
|
|
56
|
+
await browser.close();
|
|
57
|
+
const results = {
|
|
58
|
+
titleHasCounts: titleText === '4 working · 6 idle · 2 offline',
|
|
59
|
+
threeSegments: segmentWidths.length === 3,
|
|
60
|
+
workingProportion: close(segmentWidths[0], 100 * 4 / 12),
|
|
61
|
+
idleProportion: close(segmentWidths[1], 100 * 6 / 12),
|
|
62
|
+
offlineProportion: close(segmentWidths[2], 100 * 2 / 12),
|
|
63
|
+
workingColor: /22c55e|rgb\(34, 197, 94\)/.test(segmentColors[0] || ''),
|
|
64
|
+
idleColor: /2dd4bf|rgb\(45, 212, 191\)/.test(segmentColors[1] || ''),
|
|
65
|
+
offlineColor: /6b7280|rgb\(107, 114, 128\)/.test(segmentColors[2] || ''),
|
|
66
|
+
};
|
|
67
|
+
const ok = Object.values(results).every(Boolean);
|
|
68
|
+
console.log(`${ok ? '✅' : '❌'} pressure bar:`, JSON.stringify(results), `widths=${segmentWidths.join(',')} colors=${segmentColors.join(' | ')}`);
|
|
69
|
+
process.exit(ok ? 0 : 1);
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/* Round 24 verification: working-node pulse duration tiers by sse:N.
|
|
2
|
+
* sse 0-1 → 1.2s (calm)
|
|
3
|
+
* sse 2-3 → 0.9s (active)
|
|
4
|
+
* sse ≥ 4 → 0.7s (busy)
|
|
5
|
+
* Inject sse counts via mocked /api/hub/health → sse_sessions map. */
|
|
6
|
+
import { chromium } from 'playwright';
|
|
7
|
+
import { readFileSync } from 'node:fs';
|
|
8
|
+
|
|
9
|
+
const TOKEN = JSON.parse(readFileSync('/home/vansin/.anet/config.json', 'utf8')).token;
|
|
10
|
+
const browser = await chromium.launch({ headless: true });
|
|
11
|
+
|
|
12
|
+
const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 } });
|
|
13
|
+
await ctx.addCookies([{ name: 'anet_dashboard_session', value: `v3:${TOKEN}`, domain: '127.0.0.1', path: '/' }]);
|
|
14
|
+
await ctx.addInitScript(() => {
|
|
15
|
+
try {
|
|
16
|
+
localStorage.setItem('anet-theme', 'cyber');
|
|
17
|
+
localStorage.setItem('anet-topo-layout', 'grid');
|
|
18
|
+
sessionStorage.setItem('anet_v3_auth', '1');
|
|
19
|
+
} catch {}
|
|
20
|
+
});
|
|
21
|
+
const fresh = new Date(Date.now() - 60 * 1000).toISOString();
|
|
22
|
+
// Three working sessions with different sse counts. Use a known network_id
|
|
23
|
+
// so the `${nid}:${alias}` sse-map key works (the page's grouped lookup).
|
|
24
|
+
const NID = 'net_test';
|
|
25
|
+
await ctx.route('**/api/hub/status*', async (route) => {
|
|
26
|
+
await route.fulfill({ json: {
|
|
27
|
+
ok: true,
|
|
28
|
+
sessions: ['calm', 'active', 'busy'].map(alias => ({
|
|
29
|
+
alias, status: 'working', network_id: NID, project_dir: null,
|
|
30
|
+
created_at: fresh, updated_at: fresh, last_seen_at: fresh,
|
|
31
|
+
})),
|
|
32
|
+
} });
|
|
33
|
+
});
|
|
34
|
+
await ctx.route('**/api/hub/health*', async (route) => {
|
|
35
|
+
await route.fulfill({ json: {
|
|
36
|
+
ok: true,
|
|
37
|
+
version: '0.8.0-test',
|
|
38
|
+
sse_sessions: {
|
|
39
|
+
[`${NID}:calm`]: 1,
|
|
40
|
+
[`${NID}:active`]: 2,
|
|
41
|
+
[`${NID}:busy`]: 4,
|
|
42
|
+
},
|
|
43
|
+
} });
|
|
44
|
+
});
|
|
45
|
+
await ctx.route('**/api/hub/tasks*', (route) => route.fulfill({ json: { tasks: [] } }));
|
|
46
|
+
const page = await ctx.newPage();
|
|
47
|
+
await page.goto('http://127.0.0.1:3000/', { waitUntil: 'domcontentloaded' });
|
|
48
|
+
await page.waitForFunction(() => {
|
|
49
|
+
const svg = document.querySelector('svg[viewBox="0 0 1000 680"]');
|
|
50
|
+
return !!svg && svg.querySelectorAll('g[data-node]').length === 3;
|
|
51
|
+
}, { timeout: 30000 }).catch(() => {});
|
|
52
|
+
await page.waitForTimeout(600);
|
|
53
|
+
|
|
54
|
+
const durOf = alias => page.$eval(
|
|
55
|
+
`g[data-node="${alias}"] circle[data-pulse-dur]`,
|
|
56
|
+
el => el.getAttribute('data-pulse-dur'),
|
|
57
|
+
).catch(() => null);
|
|
58
|
+
|
|
59
|
+
const calm = await durOf('calm');
|
|
60
|
+
const active = await durOf('active');
|
|
61
|
+
const busy = await durOf('busy');
|
|
62
|
+
|
|
63
|
+
await browser.close();
|
|
64
|
+
const results = {
|
|
65
|
+
calmIs1_2s: calm === '1.2s',
|
|
66
|
+
activeIs0_9s: active === '0.9s',
|
|
67
|
+
busyIs0_7s: busy === '0.7s',
|
|
68
|
+
};
|
|
69
|
+
const ok = Object.values(results).every(Boolean);
|
|
70
|
+
console.log(`${ok ? '✅' : '❌'} pulse rate:`, JSON.stringify(results), `calm=${calm} active=${active} busy=${busy}`);
|
|
71
|
+
process.exit(ok ? 0 : 1);
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/* Round 45 verification: recent-signal panel shows "no flow yet" placeholder
|
|
2
|
+
* when flowLinks is empty; renders normal link rows when populated. */
|
|
3
|
+
import { chromium } from 'playwright';
|
|
4
|
+
import { readFileSync } from 'node:fs';
|
|
5
|
+
|
|
6
|
+
const TOKEN = JSON.parse(readFileSync('/home/vansin/.anet/config.json', 'utf8')).token;
|
|
7
|
+
const browser = await chromium.launch({ headless: true });
|
|
8
|
+
|
|
9
|
+
async function probe({ msgs }) {
|
|
10
|
+
const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 } });
|
|
11
|
+
await ctx.addCookies([{ name: 'anet_dashboard_session', value: `v3:${TOKEN}`, domain: '127.0.0.1', path: '/' }]);
|
|
12
|
+
await ctx.addInitScript(() => {
|
|
13
|
+
try {
|
|
14
|
+
localStorage.setItem('anet-theme', 'cyber');
|
|
15
|
+
localStorage.setItem('anet-topo-layout', 'grid');
|
|
16
|
+
sessionStorage.setItem('anet_v3_auth', '1');
|
|
17
|
+
} catch {}
|
|
18
|
+
});
|
|
19
|
+
const fresh = new Date(Date.now() - 60 * 1000).toISOString();
|
|
20
|
+
await ctx.route('**/api/hub/status*', async (route) => {
|
|
21
|
+
const r = await route.fetch();
|
|
22
|
+
const b = await r.json();
|
|
23
|
+
const nid = (b.sessions || [])[0]?.network_id || 'default';
|
|
24
|
+
const sessions = ['a', 'b'].map(a => ({
|
|
25
|
+
alias: a, status: 'idle', network_id: nid, project_dir: null,
|
|
26
|
+
created_at: fresh, updated_at: fresh, last_seen_at: fresh,
|
|
27
|
+
}));
|
|
28
|
+
await route.fulfill({ response: r, json: { ...b, sessions } });
|
|
29
|
+
});
|
|
30
|
+
await ctx.route('**/api/hub/messages*', (route) => route.fulfill({ json: { messages: msgs } }));
|
|
31
|
+
await ctx.route('**/api/hub/tasks*', (route) => route.fulfill({ json: { tasks: [] } }));
|
|
32
|
+
const page = await ctx.newPage();
|
|
33
|
+
await page.goto('http://127.0.0.1:3000/', { waitUntil: 'domcontentloaded' });
|
|
34
|
+
await page.waitForSelector('svg[viewBox="0 0 1000 680"]', { timeout: 30000 });
|
|
35
|
+
await page.waitForTimeout(500);
|
|
36
|
+
const data = await page.evaluate(() => {
|
|
37
|
+
const svg = document.querySelector('svg[viewBox="0 0 1000 680"]');
|
|
38
|
+
const empty = svg.querySelector('text[data-recent-signal-empty]');
|
|
39
|
+
// count flow-link description rows in the recent-signal panel (translate(16,16))
|
|
40
|
+
const panel = [...svg.querySelectorAll(':scope > g[transform^="translate(16, 16)"]')][0];
|
|
41
|
+
const linkRows = panel ? [...panel.querySelectorAll('text')].filter(t => /->.*\/.*\//.test(t.textContent || '')).length : 0;
|
|
42
|
+
return { emptyShown: !!empty, emptyText: empty?.textContent || null, linkRows };
|
|
43
|
+
});
|
|
44
|
+
await ctx.close();
|
|
45
|
+
return data;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const noFlow = await probe({ msgs: [] });
|
|
49
|
+
const withFlow = await probe({ msgs: [
|
|
50
|
+
{ from_alias: 'a', to_alias: 'b', content: 'hello', created_at: new Date().toISOString() },
|
|
51
|
+
] });
|
|
52
|
+
await browser.close();
|
|
53
|
+
|
|
54
|
+
const results = {
|
|
55
|
+
emptyShowsPlaceholder: noFlow.emptyShown === true && /no flow yet/i.test(noFlow.emptyText || ''),
|
|
56
|
+
emptyHidesLinkRows: noFlow.linkRows === 0,
|
|
57
|
+
populatedHidesPlaceholder: withFlow.emptyShown === false,
|
|
58
|
+
populatedShowsLinkRows: withFlow.linkRows >= 1,
|
|
59
|
+
};
|
|
60
|
+
const ok = Object.values(results).every(Boolean);
|
|
61
|
+
console.log(`${ok ? '✅' : '❌'} recent-signal empty state:`, JSON.stringify(results),
|
|
62
|
+
`\n noFlow=`, noFlow, `\n withFlow=`, withFlow);
|
|
63
|
+
process.exit(ok ? 0 : 1);
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/* Round 36 verification: prefers-reduced-motion disables all SMIL
|
|
2
|
+
* animations in the topology. Round 29 zeroed CSS via media query;
|
|
3
|
+
* SVG <animate> / <animateMotion> elements need JS to opt out and
|
|
4
|
+
* this round wires that via the useReducedMotion hook. */
|
|
5
|
+
import { chromium } from 'playwright';
|
|
6
|
+
import { readFileSync } from 'node:fs';
|
|
7
|
+
|
|
8
|
+
const TOKEN = JSON.parse(readFileSync('/home/vansin/.anet/config.json', 'utf8')).token;
|
|
9
|
+
const browser = await chromium.launch({ headless: true });
|
|
10
|
+
|
|
11
|
+
async function probe({ reduce, layout }) {
|
|
12
|
+
const ctx = await browser.newContext({
|
|
13
|
+
viewport: { width: 1280, height: 1600 },
|
|
14
|
+
reducedMotion: reduce ? 'reduce' : 'no-preference',
|
|
15
|
+
});
|
|
16
|
+
await ctx.addCookies([{ name: 'anet_dashboard_session', value: `v3:${TOKEN}`, domain: '127.0.0.1', path: '/' }]);
|
|
17
|
+
await ctx.addInitScript((lay) => {
|
|
18
|
+
try {
|
|
19
|
+
localStorage.setItem('anet-theme', 'cyber');
|
|
20
|
+
localStorage.setItem('anet-topo-layout', lay);
|
|
21
|
+
localStorage.setItem('anet-topo-view', JSON.stringify({ zoom: 1, x: 0, y: 0 }));
|
|
22
|
+
sessionStorage.setItem('anet_v3_auth', '1');
|
|
23
|
+
} catch {}
|
|
24
|
+
}, layout);
|
|
25
|
+
const fresh = new Date(Date.now() - 60 * 1000).toISOString();
|
|
26
|
+
await ctx.route('**/api/hub/status*', async (route) => {
|
|
27
|
+
const r = await route.fetch();
|
|
28
|
+
const b = await r.json();
|
|
29
|
+
const nid = (b.sessions || [])[0]?.network_id || 'default';
|
|
30
|
+
// Include a 'working' status so the working pulse path renders.
|
|
31
|
+
const sessions = [
|
|
32
|
+
{ alias: 'wkr', status: 'working', network_id: nid, project_dir: null,
|
|
33
|
+
created_at: fresh, updated_at: fresh, last_seen_at: fresh },
|
|
34
|
+
{ alias: 'idl', status: 'idle', network_id: nid, project_dir: null,
|
|
35
|
+
created_at: fresh, updated_at: fresh, last_seen_at: fresh },
|
|
36
|
+
];
|
|
37
|
+
await route.fulfill({ response: r, json: { ...b, sessions } });
|
|
38
|
+
});
|
|
39
|
+
// Inject a tiny message so a flow link + particle render.
|
|
40
|
+
await ctx.route('**/api/hub/messages*', (route) => route.fulfill({ json: { messages: [
|
|
41
|
+
{ from_alias: 'wkr', to_alias: 'idl', content: 'hi', created_at: fresh },
|
|
42
|
+
] } }));
|
|
43
|
+
await ctx.route('**/api/hub/tasks*', (route) => route.fulfill({ json: { tasks: [] } }));
|
|
44
|
+
const page = await ctx.newPage();
|
|
45
|
+
await page.goto('http://127.0.0.1:3000/', { waitUntil: 'domcontentloaded' });
|
|
46
|
+
await page.waitForFunction(() => document.querySelectorAll('g[data-node]').length === 2, { timeout: 30000 });
|
|
47
|
+
await page.waitForTimeout(600);
|
|
48
|
+
// Click a node so the click ripple is invoked (it should NOT render under reduced motion).
|
|
49
|
+
await page.locator('g[data-node="wkr"]').click().catch(() => {});
|
|
50
|
+
await page.waitForTimeout(120);
|
|
51
|
+
const counts = await page.evaluate(() => {
|
|
52
|
+
const svg = document.querySelector('svg[viewBox="0 0 1000 680"]');
|
|
53
|
+
return {
|
|
54
|
+
animate: svg.querySelectorAll('animate').length,
|
|
55
|
+
animateMotion: svg.querySelectorAll('animateMotion').length,
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
await ctx.close();
|
|
59
|
+
return counts;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Baseline (no reduce) — many SMIL elements expected.
|
|
63
|
+
const normalRing = await probe({ reduce: false, layout: 'ring' });
|
|
64
|
+
// Reduced motion — every SMIL element should be gone.
|
|
65
|
+
const reducedRing = await probe({ reduce: true, layout: 'ring' });
|
|
66
|
+
const reducedGrid = await probe({ reduce: true, layout: 'grid' });
|
|
67
|
+
|
|
68
|
+
await browser.close();
|
|
69
|
+
const results = {
|
|
70
|
+
baselineHasAnimations: normalRing.animate + normalRing.animateMotion > 0,
|
|
71
|
+
reducedRingDropsAll: reducedRing.animate === 0 && reducedRing.animateMotion === 0,
|
|
72
|
+
reducedGridDropsAll: reducedGrid.animate === 0 && reducedGrid.animateMotion === 0,
|
|
73
|
+
};
|
|
74
|
+
const ok = Object.values(results).every(Boolean);
|
|
75
|
+
console.log(`${ok ? '✅' : '❌'} reduced motion:`, JSON.stringify(results),
|
|
76
|
+
`\n normalRing=`, normalRing, `\n reducedRing=`, reducedRing, `\n reducedGrid=`, reducedGrid);
|
|
77
|
+
process.exit(ok ? 0 : 1);
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/* Round 35 verification: SQL-style timestamps (CommHub format) parse as
|
|
2
|
+
* UTC regardless of the browser's local timezone. Reproduces the latent
|
|
3
|
+
* bug from Round 34 — a 30-min-old offline node would have been ghosted
|
|
4
|
+
* on a UTC+8 browser without parseHubTime. */
|
|
5
|
+
import { chromium } from 'playwright';
|
|
6
|
+
import { readFileSync } from 'node:fs';
|
|
7
|
+
|
|
8
|
+
const TOKEN = JSON.parse(readFileSync('/home/vansin/.anet/config.json', 'utf8')).token;
|
|
9
|
+
const browser = await chromium.launch({ headless: true });
|
|
10
|
+
|
|
11
|
+
// SQL-style timestamp = ISO with the T replaced by space and Z stripped.
|
|
12
|
+
// This is exactly what the CommHub returns (see /api/status probe).
|
|
13
|
+
const sqlMin = (m) => {
|
|
14
|
+
const d = new Date(Date.now() - m * 60 * 1000);
|
|
15
|
+
return d.toISOString().replace('T', ' ').replace(/\.\d+Z$/, '');
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
async function probe(timezoneId) {
|
|
19
|
+
const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 }, timezoneId });
|
|
20
|
+
await ctx.addCookies([{ name: 'anet_dashboard_session', value: `v3:${TOKEN}`, domain: '127.0.0.1', path: '/' }]);
|
|
21
|
+
await ctx.addInitScript(() => {
|
|
22
|
+
try {
|
|
23
|
+
localStorage.setItem('anet-theme', 'cyber');
|
|
24
|
+
localStorage.setItem('anet-topo-layout', 'grid');
|
|
25
|
+
sessionStorage.setItem('anet_v3_auth', '1');
|
|
26
|
+
} catch {}
|
|
27
|
+
});
|
|
28
|
+
const fresh = sqlMin(0.1);
|
|
29
|
+
await ctx.route('**/api/hub/status*', async (route) => {
|
|
30
|
+
const r = await route.fetch();
|
|
31
|
+
const b = await r.json();
|
|
32
|
+
const nid = (b.sessions || [])[0]?.network_id || 'default';
|
|
33
|
+
const sessions = [
|
|
34
|
+
{ alias: 'live', status: 'idle', network_id: nid, project_dir: null,
|
|
35
|
+
created_at: fresh, updated_at: fresh, last_seen_at: fresh },
|
|
36
|
+
{ alias: 'off30', status: 'offline', network_id: nid, project_dir: null,
|
|
37
|
+
created_at: fresh, updated_at: fresh, last_seen_at: sqlMin(30) }, // 30 min ago, SQL format
|
|
38
|
+
{ alias: 'ghost', status: 'offline', network_id: nid, project_dir: null,
|
|
39
|
+
created_at: fresh, updated_at: fresh, last_seen_at: sqlMin(75) }, // 75 min ago — should ghost
|
|
40
|
+
];
|
|
41
|
+
await route.fulfill({ response: r, json: { ...b, sessions } });
|
|
42
|
+
});
|
|
43
|
+
await ctx.route('**/api/hub/tasks*', (route) => route.fulfill({ json: { tasks: [] } }));
|
|
44
|
+
const page = await ctx.newPage();
|
|
45
|
+
await page.goto('http://127.0.0.1:3000/', { waitUntil: 'domcontentloaded' });
|
|
46
|
+
await page.waitForSelector('svg[viewBox="0 0 1000 680"]', { timeout: 30000 });
|
|
47
|
+
await page.waitForTimeout(600);
|
|
48
|
+
const rendered = await page.$$eval('g[data-node]', els => els.map(e => e.getAttribute('data-node')));
|
|
49
|
+
await ctx.close();
|
|
50
|
+
return rendered;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const utc = await probe('UTC');
|
|
54
|
+
const shanghai = await probe('Asia/Shanghai'); // UTC+8 — the failing case before Round 35
|
|
55
|
+
const losAngeles = await probe('America/Los_Angeles'); // UTC-7/8 — the opposite skew
|
|
56
|
+
await browser.close();
|
|
57
|
+
|
|
58
|
+
const expectsLiveAndOff30 = list =>
|
|
59
|
+
list.includes('live') && list.includes('off30') && !list.includes('ghost');
|
|
60
|
+
|
|
61
|
+
const results = {
|
|
62
|
+
utcRendersLiveAndOff30: expectsLiveAndOff30(utc),
|
|
63
|
+
shanghaiRendersLiveAndOff30: expectsLiveAndOff30(shanghai),
|
|
64
|
+
losAngelesRendersLiveAndOff30: expectsLiveAndOff30(losAngeles),
|
|
65
|
+
};
|
|
66
|
+
const ok = Object.values(results).every(Boolean);
|
|
67
|
+
console.log(`${ok ? '✅' : '❌'} TZ-safe ghost:`, JSON.stringify(results),
|
|
68
|
+
`\n UTC=${JSON.stringify(utc)}\n Asia/Shanghai=${JSON.stringify(shanghai)}\n America/Los_Angeles=${JSON.stringify(losAngeles)}`);
|
|
69
|
+
process.exit(ok ? 0 : 1);
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/* Round 23 verification: wheel-zoom is guarded inline (requires
|
|
2
|
+
* ctrl/meta) but unconditional in fullscreen. Plain wheel over the
|
|
3
|
+
* canvas must let page scroll through. */
|
|
4
|
+
import { chromium } from 'playwright';
|
|
5
|
+
import { readFileSync } from 'node:fs';
|
|
6
|
+
|
|
7
|
+
const TOKEN = JSON.parse(readFileSync('/home/vansin/.anet/config.json', 'utf8')).token;
|
|
8
|
+
const browser = await chromium.launch({ headless: true });
|
|
9
|
+
const ctx = await browser.newContext({ viewport: { width: 1280, height: 1600 } });
|
|
10
|
+
await ctx.addCookies([{ name: 'anet_dashboard_session', value: `v3:${TOKEN}`, domain: '127.0.0.1', path: '/' }]);
|
|
11
|
+
await ctx.addInitScript(() => {
|
|
12
|
+
try {
|
|
13
|
+
localStorage.setItem('anet-theme', 'cyber');
|
|
14
|
+
localStorage.setItem('anet-topo-layout', 'grid');
|
|
15
|
+
sessionStorage.setItem('anet_v3_auth', '1');
|
|
16
|
+
} catch {}
|
|
17
|
+
});
|
|
18
|
+
const fresh = new Date(Date.now() - 60 * 1000).toISOString();
|
|
19
|
+
await ctx.route('**/api/hub/status*', async (route) => {
|
|
20
|
+
const r = await route.fetch();
|
|
21
|
+
const b = await r.json();
|
|
22
|
+
const nid = (b.sessions || [])[0]?.network_id || 'default';
|
|
23
|
+
const sessions = ['a', 'b'].map(a => ({
|
|
24
|
+
alias: a, status: 'idle', network_id: nid, project_dir: null,
|
|
25
|
+
created_at: fresh, updated_at: fresh, last_seen_at: fresh,
|
|
26
|
+
}));
|
|
27
|
+
await route.fulfill({ response: r, json: { ...b, sessions } });
|
|
28
|
+
});
|
|
29
|
+
await ctx.route('**/api/hub/tasks*', (route) => route.fulfill({ json: { tasks: [] } }));
|
|
30
|
+
const page = await ctx.newPage();
|
|
31
|
+
await page.goto('http://127.0.0.1:3000/', { waitUntil: 'domcontentloaded' });
|
|
32
|
+
await page.waitForSelector('svg[viewBox="0 0 1000 680"]', { timeout: 30000 });
|
|
33
|
+
await page.waitForTimeout(400);
|
|
34
|
+
|
|
35
|
+
const readZoom = () => page.evaluate(() => {
|
|
36
|
+
const span = document.querySelector('button[aria-label="Zoom in"]').parentElement.querySelector('span[title*="zoom level"]');
|
|
37
|
+
return +span.textContent.replace('%', '');
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// Move cursor over the SVG centre
|
|
41
|
+
const box = await page.$eval('svg[viewBox="0 0 1000 680"]', el => el.getBoundingClientRect());
|
|
42
|
+
const cx = box.x + box.width / 2;
|
|
43
|
+
const cy = box.y + box.height / 2;
|
|
44
|
+
await page.mouse.move(cx, cy);
|
|
45
|
+
const start = await readZoom();
|
|
46
|
+
|
|
47
|
+
// PLAIN wheel — must NOT zoom (guard active inline)
|
|
48
|
+
await page.mouse.wheel(0, -100);
|
|
49
|
+
await page.waitForTimeout(80);
|
|
50
|
+
const afterPlainWheel = await readZoom();
|
|
51
|
+
|
|
52
|
+
// PLAIN wheel must let page scroll
|
|
53
|
+
const scrollBefore = await page.evaluate(() => window.scrollY);
|
|
54
|
+
await page.mouse.wheel(0, 200);
|
|
55
|
+
await page.waitForTimeout(80);
|
|
56
|
+
const scrollAfter = await page.evaluate(() => window.scrollY);
|
|
57
|
+
// scroll back so the next test has the SVG in view
|
|
58
|
+
await page.evaluate(() => window.scrollTo(0, 0));
|
|
59
|
+
await page.mouse.move(cx, cy);
|
|
60
|
+
await page.waitForTimeout(100);
|
|
61
|
+
|
|
62
|
+
// CTRL+wheel — must zoom inline
|
|
63
|
+
const beforeCtrl = await readZoom();
|
|
64
|
+
await page.keyboard.down('Control');
|
|
65
|
+
await page.mouse.wheel(0, -100);
|
|
66
|
+
await page.keyboard.up('Control');
|
|
67
|
+
await page.waitForTimeout(80);
|
|
68
|
+
const afterCtrl = await readZoom();
|
|
69
|
+
|
|
70
|
+
await browser.close();
|
|
71
|
+
const results = {
|
|
72
|
+
plainWheelDoesNotZoom: afterPlainWheel === start,
|
|
73
|
+
plainWheelPageScrolls: scrollAfter > scrollBefore,
|
|
74
|
+
ctrlWheelZooms: afterCtrl > beforeCtrl,
|
|
75
|
+
};
|
|
76
|
+
const ok = Object.values(results).every(Boolean);
|
|
77
|
+
console.log(`${ok ? '✅' : '❌'} wheel zoom guard:`, JSON.stringify(results),
|
|
78
|
+
`start=${start} plainWheel=${afterPlainWheel} scrollBefore=${scrollBefore} scrollAfter=${scrollAfter} beforeCtrl=${beforeCtrl} afterCtrl=${afterCtrl}`);
|
|
79
|
+
process.exit(ok ? 0 : 1);
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/* Round 22 verification: keyboard zoom shortcuts (+/=, -, 0) + matching
|
|
2
|
+
* title hints on the existing buttons. The handler must NOT fire while
|
|
3
|
+
* an input/textarea has focus. */
|
|
4
|
+
import { chromium } from 'playwright';
|
|
5
|
+
import { readFileSync } from 'node:fs';
|
|
6
|
+
|
|
7
|
+
const TOKEN = JSON.parse(readFileSync('/home/vansin/.anet/config.json', 'utf8')).token;
|
|
8
|
+
const browser = await chromium.launch({ headless: true });
|
|
9
|
+
const ctx = await browser.newContext({ viewport: { width: 1280, height: 1600 } });
|
|
10
|
+
await ctx.addCookies([{ name: 'anet_dashboard_session', value: `v3:${TOKEN}`, domain: '127.0.0.1', path: '/' }]);
|
|
11
|
+
await ctx.addInitScript(() => {
|
|
12
|
+
try {
|
|
13
|
+
localStorage.setItem('anet-theme', 'cyber');
|
|
14
|
+
localStorage.setItem('anet-topo-layout', 'grid');
|
|
15
|
+
sessionStorage.setItem('anet_v3_auth', '1');
|
|
16
|
+
} catch {}
|
|
17
|
+
});
|
|
18
|
+
const fresh = new Date(Date.now() - 60 * 1000).toISOString();
|
|
19
|
+
await ctx.route('**/api/hub/status*', async (route) => {
|
|
20
|
+
const r = await route.fetch();
|
|
21
|
+
const b = await r.json();
|
|
22
|
+
const nid = (b.sessions || [])[0]?.network_id || 'default';
|
|
23
|
+
const sessions = ['a', 'b'].map(a => ({
|
|
24
|
+
alias: a, status: 'idle', network_id: nid, project_dir: null,
|
|
25
|
+
created_at: fresh, updated_at: fresh, last_seen_at: fresh,
|
|
26
|
+
}));
|
|
27
|
+
await route.fulfill({ response: r, json: { ...b, sessions } });
|
|
28
|
+
});
|
|
29
|
+
await ctx.route('**/api/hub/tasks*', (route) => route.fulfill({ json: { tasks: [] } }));
|
|
30
|
+
const page = await ctx.newPage();
|
|
31
|
+
await page.goto('http://127.0.0.1:3000/', { waitUntil: 'domcontentloaded' });
|
|
32
|
+
await page.waitForSelector('svg[viewBox="0 0 1000 680"]', { timeout: 30000 });
|
|
33
|
+
await page.waitForTimeout(400);
|
|
34
|
+
|
|
35
|
+
const readZoomPct = () => page.$eval(
|
|
36
|
+
'button[title^="Zoom in"]',
|
|
37
|
+
btn => +btn.parentElement.querySelector('span[title*="zoom level"]').textContent.replace('%', ''),
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
const start = await readZoomPct();
|
|
41
|
+
await page.keyboard.press('=');
|
|
42
|
+
await page.waitForTimeout(50);
|
|
43
|
+
const afterPlus = await readZoomPct();
|
|
44
|
+
|
|
45
|
+
await page.keyboard.press('-');
|
|
46
|
+
await page.waitForTimeout(50);
|
|
47
|
+
const afterMinus = await readZoomPct();
|
|
48
|
+
|
|
49
|
+
// Zoom in twice via + then reset via 0
|
|
50
|
+
await page.keyboard.press('=');
|
|
51
|
+
await page.keyboard.press('=');
|
|
52
|
+
await page.waitForTimeout(50);
|
|
53
|
+
const beforeReset = await readZoomPct();
|
|
54
|
+
await page.keyboard.press('0');
|
|
55
|
+
await page.waitForTimeout(50);
|
|
56
|
+
const afterReset = await readZoomPct();
|
|
57
|
+
|
|
58
|
+
// Titles present
|
|
59
|
+
const titles = await page.evaluate(() => ({
|
|
60
|
+
out: document.querySelector('button[aria-label="Zoom out"]').getAttribute('title'),
|
|
61
|
+
in: document.querySelector('button[aria-label="Zoom in"]').getAttribute('title'),
|
|
62
|
+
reset: document.querySelector('button[aria-label="Reset view"]').getAttribute('title'),
|
|
63
|
+
}));
|
|
64
|
+
|
|
65
|
+
// Input-focus suppression: open Cmd+K, type "-", expect topology NOT to zoom
|
|
66
|
+
await page.keyboard.press('Meta+k');
|
|
67
|
+
await page.waitForTimeout(200);
|
|
68
|
+
const palette = await page.locator('input[placeholder*="Search"], input[type="search"], [role="dialog"] input').first();
|
|
69
|
+
await palette.focus().catch(() => {});
|
|
70
|
+
const zoomBeforeTyping = await readZoomPct();
|
|
71
|
+
await page.keyboard.press('-');
|
|
72
|
+
await page.waitForTimeout(80);
|
|
73
|
+
const zoomAfterTyping = await readZoomPct();
|
|
74
|
+
await page.keyboard.press('Escape');
|
|
75
|
+
|
|
76
|
+
await browser.close();
|
|
77
|
+
const results = {
|
|
78
|
+
startsAt100: start === 100,
|
|
79
|
+
plusZoomsIn: afterPlus === 120,
|
|
80
|
+
minusReverts: afterMinus === 100,
|
|
81
|
+
zeroResets: beforeReset > 100 && afterReset === 100,
|
|
82
|
+
titleOut: /Zoom out.*[(−\-]/.test(titles.out || ''),
|
|
83
|
+
titleIn: /Zoom in.*\(\+/.test(titles.in || ''),
|
|
84
|
+
titleReset: /\b0\b/.test(titles.reset || ''),
|
|
85
|
+
noZoomWhileTyping: zoomAfterTyping === zoomBeforeTyping,
|
|
86
|
+
};
|
|
87
|
+
const ok = Object.values(results).every(Boolean);
|
|
88
|
+
console.log(`${ok ? '✅' : '❌'} zoom keys:`, JSON.stringify(results), `titles=`, titles);
|
|
89
|
+
process.exit(ok ? 0 : 1);
|