@sleep2agi/agent-network-dashboard 0.4.6-preview.8 → 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.
Files changed (259) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +1 -0
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/diagnostics/route-bundle-stats.json +69 -55
  5. package/.next/fallback-build-manifest.json +3 -3
  6. package/.next/prerender-manifest.json +3 -3
  7. package/.next/routes-manifest.json +6 -0
  8. package/.next/server/app/_global-error.html +1 -1
  9. package/.next/server/app/_global-error.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  15. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  16. package/.next/server/app/_not-found.html +2 -2
  17. package/.next/server/app/_not-found.rsc +12 -12
  18. package/.next/server/app/_not-found.segments/_full.segment.rsc +12 -12
  19. package/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  20. package/.next/server/app/_not-found.segments/_index.segment.rsc +7 -7
  21. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  22. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  23. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  24. package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
  25. package/.next/server/app/admin.html +2 -2
  26. package/.next/server/app/admin.rsc +14 -14
  27. package/.next/server/app/admin.segments/_full.segment.rsc +14 -14
  28. package/.next/server/app/admin.segments/_head.segment.rsc +4 -4
  29. package/.next/server/app/admin.segments/_index.segment.rsc +7 -7
  30. package/.next/server/app/admin.segments/_tree.segment.rsc +2 -2
  31. package/.next/server/app/admin.segments/admin/__PAGE__.segment.rsc +4 -4
  32. package/.next/server/app/admin.segments/admin.segment.rsc +3 -3
  33. package/.next/server/app/api/hub/servers/route/app-paths-manifest.json +3 -0
  34. package/.next/server/app/api/hub/servers/route/build-manifest.json +9 -0
  35. package/.next/server/app/api/hub/servers/route/server-reference-manifest.json +4 -0
  36. package/.next/server/app/api/hub/servers/route.js +7 -0
  37. package/.next/server/app/api/hub/servers/route.js.map +5 -0
  38. package/.next/server/app/api/hub/servers/route.js.nft.json +1 -0
  39. package/.next/server/app/api/hub/servers/route_client-reference-manifest.js +3 -0
  40. package/.next/server/app/index.html +2 -2
  41. package/.next/server/app/index.rsc +14 -14
  42. package/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
  43. package/.next/server/app/index.segments/_full.segment.rsc +14 -14
  44. package/.next/server/app/index.segments/_head.segment.rsc +4 -4
  45. package/.next/server/app/index.segments/_index.segment.rsc +7 -7
  46. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  47. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  48. package/.next/server/app/login.html +2 -2
  49. package/.next/server/app/login.rsc +14 -14
  50. package/.next/server/app/login.segments/_full.segment.rsc +14 -14
  51. package/.next/server/app/login.segments/_head.segment.rsc +4 -4
  52. package/.next/server/app/login.segments/_index.segment.rsc +7 -7
  53. package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  54. package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +4 -4
  55. package/.next/server/app/login.segments/login.segment.rsc +3 -3
  56. package/.next/server/app/logs/page_client-reference-manifest.js +1 -1
  57. package/.next/server/app/logs.html +2 -2
  58. package/.next/server/app/logs.rsc +14 -14
  59. package/.next/server/app/logs.segments/_full.segment.rsc +14 -14
  60. package/.next/server/app/logs.segments/_head.segment.rsc +4 -4
  61. package/.next/server/app/logs.segments/_index.segment.rsc +7 -7
  62. package/.next/server/app/logs.segments/_tree.segment.rsc +2 -2
  63. package/.next/server/app/logs.segments/logs/__PAGE__.segment.rsc +4 -4
  64. package/.next/server/app/logs.segments/logs.segment.rsc +3 -3
  65. package/.next/server/app/messages/page_client-reference-manifest.js +1 -1
  66. package/.next/server/app/messages.html +2 -2
  67. package/.next/server/app/messages.rsc +14 -14
  68. package/.next/server/app/messages.segments/_full.segment.rsc +14 -14
  69. package/.next/server/app/messages.segments/_head.segment.rsc +4 -4
  70. package/.next/server/app/messages.segments/_index.segment.rsc +7 -7
  71. package/.next/server/app/messages.segments/_tree.segment.rsc +2 -2
  72. package/.next/server/app/messages.segments/messages/__PAGE__.segment.rsc +4 -4
  73. package/.next/server/app/messages.segments/messages.segment.rsc +3 -3
  74. package/.next/server/app/node/page_client-reference-manifest.js +1 -1
  75. package/.next/server/app/node.html +2 -2
  76. package/.next/server/app/node.rsc +14 -14
  77. package/.next/server/app/node.segments/_full.segment.rsc +14 -14
  78. package/.next/server/app/node.segments/_head.segment.rsc +4 -4
  79. package/.next/server/app/node.segments/_index.segment.rsc +7 -7
  80. package/.next/server/app/node.segments/_tree.segment.rsc +2 -2
  81. package/.next/server/app/node.segments/node/__PAGE__.segment.rsc +4 -4
  82. package/.next/server/app/node.segments/node.segment.rsc +3 -3
  83. package/.next/server/app/nodes/page_client-reference-manifest.js +1 -1
  84. package/.next/server/app/nodes.html +2 -2
  85. package/.next/server/app/nodes.rsc +14 -14
  86. package/.next/server/app/nodes.segments/_full.segment.rsc +14 -14
  87. package/.next/server/app/nodes.segments/_head.segment.rsc +4 -4
  88. package/.next/server/app/nodes.segments/_index.segment.rsc +7 -7
  89. package/.next/server/app/nodes.segments/_tree.segment.rsc +2 -2
  90. package/.next/server/app/nodes.segments/nodes/__PAGE__.segment.rsc +4 -4
  91. package/.next/server/app/nodes.segments/nodes.segment.rsc +3 -3
  92. package/.next/server/app/page_client-reference-manifest.js +1 -1
  93. package/.next/server/app/server-logs/page_client-reference-manifest.js +1 -1
  94. package/.next/server/app/server-logs.html +2 -2
  95. package/.next/server/app/server-logs.rsc +14 -14
  96. package/.next/server/app/server-logs.segments/_full.segment.rsc +14 -14
  97. package/.next/server/app/server-logs.segments/_head.segment.rsc +4 -4
  98. package/.next/server/app/server-logs.segments/_index.segment.rsc +7 -7
  99. package/.next/server/app/server-logs.segments/_tree.segment.rsc +2 -2
  100. package/.next/server/app/server-logs.segments/server-logs/__PAGE__.segment.rsc +4 -4
  101. package/.next/server/app/server-logs.segments/server-logs.segment.rsc +3 -3
  102. package/.next/server/app/settings/networks/page_client-reference-manifest.js +1 -1
  103. package/.next/server/app/settings/networks.html +2 -2
  104. package/.next/server/app/settings/networks.rsc +14 -14
  105. package/.next/server/app/settings/networks.segments/_full.segment.rsc +14 -14
  106. package/.next/server/app/settings/networks.segments/_head.segment.rsc +4 -4
  107. package/.next/server/app/settings/networks.segments/_index.segment.rsc +7 -7
  108. package/.next/server/app/settings/networks.segments/_tree.segment.rsc +2 -2
  109. package/.next/server/app/settings/networks.segments/settings/networks/__PAGE__.segment.rsc +4 -4
  110. package/.next/server/app/settings/networks.segments/settings/networks.segment.rsc +3 -3
  111. package/.next/server/app/settings/networks.segments/settings.segment.rsc +3 -3
  112. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  113. package/.next/server/app/settings/tokens/page_client-reference-manifest.js +1 -1
  114. package/.next/server/app/settings/tokens.html +2 -2
  115. package/.next/server/app/settings/tokens.rsc +14 -14
  116. package/.next/server/app/settings/tokens.segments/_full.segment.rsc +14 -14
  117. package/.next/server/app/settings/tokens.segments/_head.segment.rsc +4 -4
  118. package/.next/server/app/settings/tokens.segments/_index.segment.rsc +7 -7
  119. package/.next/server/app/settings/tokens.segments/_tree.segment.rsc +2 -2
  120. package/.next/server/app/settings/tokens.segments/settings/tokens/__PAGE__.segment.rsc +4 -4
  121. package/.next/server/app/settings/tokens.segments/settings/tokens.segment.rsc +3 -3
  122. package/.next/server/app/settings/tokens.segments/settings.segment.rsc +3 -3
  123. package/.next/server/app/settings.html +2 -2
  124. package/.next/server/app/settings.rsc +14 -14
  125. package/.next/server/app/settings.segments/_full.segment.rsc +14 -14
  126. package/.next/server/app/settings.segments/_head.segment.rsc +4 -4
  127. package/.next/server/app/settings.segments/_index.segment.rsc +7 -7
  128. package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  129. package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
  130. package/.next/server/app/settings.segments/settings.segment.rsc +3 -3
  131. package/.next/server/app/tasks/[id]/page_client-reference-manifest.js +1 -1
  132. package/.next/server/app/tasks/page_client-reference-manifest.js +1 -1
  133. package/.next/server/app/tasks.html +2 -2
  134. package/.next/server/app/tasks.rsc +14 -14
  135. package/.next/server/app/tasks.segments/_full.segment.rsc +14 -14
  136. package/.next/server/app/tasks.segments/_head.segment.rsc +4 -4
  137. package/.next/server/app/tasks.segments/_index.segment.rsc +7 -7
  138. package/.next/server/app/tasks.segments/_tree.segment.rsc +2 -2
  139. package/.next/server/app/tasks.segments/tasks/__PAGE__.segment.rsc +4 -4
  140. package/.next/server/app/tasks.segments/tasks.segment.rsc +3 -3
  141. package/.next/server/app-paths-manifest.json +1 -0
  142. package/.next/server/chunks/0ykm__next-internal_server_app_api_hub_servers_route_actions_08-m-cs.js +3 -0
  143. package/.next/server/chunks/0ykm__next-internal_server_app_api_hub_servers_route_actions_08-m-cs.js.map +1 -0
  144. package/.next/server/chunks/[root-of-the-server]__0tx8s8i._.js +3 -0
  145. package/.next/server/chunks/[root-of-the-server]__0tx8s8i._.js.map +1 -0
  146. package/.next/server/chunks/ssr/[root-of-the-server]__03b.f76._.js +1 -1
  147. package/.next/server/chunks/ssr/[root-of-the-server]__03b.f76._.js.map +1 -1
  148. package/.next/server/chunks/ssr/[root-of-the-server]__0fhoq8i._.js +1 -1
  149. package/.next/server/chunks/ssr/[root-of-the-server]__0fhoq8i._.js.map +1 -1
  150. package/.next/server/chunks/ssr/[root-of-the-server]__0nw~zhp._.js +1 -1
  151. package/.next/server/chunks/ssr/[root-of-the-server]__0nw~zhp._.js.map +1 -1
  152. package/.next/server/chunks/ssr/agent-network-dashboard_09kk21a._.js +2 -1
  153. package/.next/server/chunks/ssr/agent-network-dashboard_09kk21a._.js.map +1 -1
  154. package/.next/server/chunks/ssr/agent-network-dashboard_app_01jhlxz._.js +1 -1
  155. package/.next/server/chunks/ssr/agent-network-dashboard_app_01jhlxz._.js.map +1 -1
  156. package/.next/server/chunks/ssr/agent-network-dashboard_app_057q.ne._.js +1 -1
  157. package/.next/server/chunks/ssr/agent-network-dashboard_app_057q.ne._.js.map +1 -1
  158. package/.next/server/chunks/ssr/agent-network-dashboard_app_09d29my._.js +1 -1
  159. package/.next/server/chunks/ssr/agent-network-dashboard_app_09d29my._.js.map +1 -1
  160. package/.next/server/chunks/ssr/agent-network-dashboard_app_0_d45-d._.js +1 -1
  161. package/.next/server/chunks/ssr/agent-network-dashboard_app_0_d45-d._.js.map +1 -1
  162. package/.next/server/chunks/ssr/agent-network-dashboard_app_0i3759l._.js +1 -1
  163. package/.next/server/chunks/ssr/agent-network-dashboard_app_0i3759l._.js.map +1 -1
  164. package/.next/server/chunks/ssr/agent-network-dashboard_app_0xgney8._.js +1 -1
  165. package/.next/server/chunks/ssr/agent-network-dashboard_app_0xgney8._.js.map +1 -1
  166. package/.next/server/chunks/ssr/agent-network-dashboard_app_10hjgv4._.js +1 -1
  167. package/.next/server/chunks/ssr/agent-network-dashboard_app_10hjgv4._.js.map +1 -1
  168. package/.next/server/chunks/ssr/agent-network-dashboard_app_1153xeb._.js +1 -1
  169. package/.next/server/chunks/ssr/agent-network-dashboard_app_1153xeb._.js.map +1 -1
  170. package/.next/server/chunks/ssr/agent-network-dashboard_app_12l4oto._.js +1 -1
  171. package/.next/server/chunks/ssr/agent-network-dashboard_app_12l4oto._.js.map +1 -1
  172. package/.next/server/chunks/ssr/agent-network-dashboard_app_components_0mvyi-4._.js +1 -1
  173. package/.next/server/chunks/ssr/agent-network-dashboard_app_components_0mvyi-4._.js.map +1 -1
  174. package/.next/server/middleware-build-manifest.js +3 -3
  175. package/.next/server/pages/404.html +2 -2
  176. package/.next/server/pages/500.html +1 -1
  177. package/.next/server/server-reference-manifest.js +1 -1
  178. package/.next/server/server-reference-manifest.json +1 -1
  179. package/.next/static/chunks/0-mpa_947ipeq.js +1 -0
  180. package/.next/static/chunks/01lmbsd37fybu.js +1 -0
  181. package/.next/static/chunks/03o.h6kvmw4l_.js +1 -0
  182. package/.next/static/chunks/03~~oirxz7~vc.js +1 -0
  183. package/.next/static/chunks/05uk96gc~9mni.js +1 -0
  184. package/.next/static/chunks/088ouqy7tekty.js +2 -0
  185. package/.next/static/chunks/08kf-.bgs10ze.js +1 -0
  186. package/.next/static/chunks/0glmrdj9112tc.js +7 -0
  187. package/.next/static/chunks/0hyl7mdapsz38.js +1 -0
  188. package/.next/static/chunks/0mqwn-l7wtcdo.js +7 -0
  189. package/.next/static/chunks/0rxrez_cjn.eh.js +1 -0
  190. package/.next/static/chunks/0tvn2l1pc.h65.js +1 -0
  191. package/.next/static/chunks/0x8x.29hkju5a.js +1 -0
  192. package/.next/static/chunks/127kw7~wsnyu7.css +2 -0
  193. package/.next/static/chunks/16yfxp9ak2gdm.js +1 -0
  194. package/.next/static/chunks/174re5ar~kxne.js +1 -0
  195. package/.next/trace +2 -2
  196. package/.next/trace-build +1 -1
  197. package/.next/types/routes.d.ts +2 -1
  198. package/.next/types/validator.ts +9 -0
  199. package/app/api/hub/servers/route.ts +39 -0
  200. package/app/components/AppShell.tsx +2 -0
  201. package/app/components/ChatPopover.tsx +38 -2
  202. package/app/components/HelpOverlay.tsx +18 -0
  203. package/app/components/ServersDrawer.tsx +206 -0
  204. package/app/components/TopoGraph.tsx +871 -162
  205. package/app/components/utils.ts +8 -7
  206. package/app/lib/time.ts +36 -0
  207. package/package.json +1 -1
  208. package/scripts/help-overlay-topo-test.mjs +44 -0
  209. package/scripts/servers-drawer-live-test.mjs +96 -0
  210. package/scripts/topo-active-links-chip-test.mjs +73 -0
  211. package/scripts/topo-arrow-tier-test.mjs +61 -0
  212. package/scripts/topo-auto-fit-test.mjs +73 -0
  213. package/scripts/topo-chat-focus-ring-test.mjs +77 -0
  214. package/scripts/topo-click-ripple-test.mjs +66 -0
  215. package/scripts/topo-cwd-tooltip-test.mjs +64 -0
  216. package/scripts/topo-dblclick-reset-test.mjs +74 -0
  217. package/scripts/topo-edge-hover-test.mjs +85 -0
  218. package/scripts/topo-edge-tooltip-test.mjs +70 -0
  219. package/scripts/topo-fit-key-test.mjs +106 -0
  220. package/scripts/topo-freshness-chip-test.mjs +74 -0
  221. package/scripts/topo-group-count-test.mjs +63 -0
  222. package/scripts/topo-group-hover-test.mjs +82 -0
  223. package/scripts/topo-hub-title-test.mjs +88 -0
  224. package/scripts/topo-label-lift-test.mjs +115 -0
  225. package/scripts/topo-label-scale-test.mjs +78 -0
  226. package/scripts/topo-lastseen-tooltip-test.mjs +59 -0
  227. package/scripts/topo-layout-key-test.mjs +91 -0
  228. package/scripts/topo-minimap-test.mjs +68 -0
  229. package/scripts/topo-mobile-chips-test.mjs +103 -0
  230. package/scripts/topo-offline-dim-test.mjs +70 -0
  231. package/scripts/topo-overlap-test.mjs +164 -0
  232. package/scripts/topo-p0round-test.mjs +2 -2
  233. package/scripts/topo-pan-cursor-test.mjs +62 -0
  234. package/scripts/topo-popover-meta-test.mjs +78 -0
  235. package/scripts/topo-pressure-bar-test.mjs +69 -0
  236. package/scripts/topo-pulse-rate-test.mjs +71 -0
  237. package/scripts/topo-recent-signal-empty-test.mjs +63 -0
  238. package/scripts/topo-reduced-motion-test.mjs +77 -0
  239. package/scripts/topo-tz-ghost-test.mjs +69 -0
  240. package/scripts/topo-wheel-zoom-test.mjs +79 -0
  241. package/scripts/topo-zoom-keys-test.mjs +89 -0
  242. package/.next/static/chunks/0-7iowzu4.798.js +0 -1
  243. package/.next/static/chunks/02t5jr4shh.hy.js +0 -1
  244. package/.next/static/chunks/0_qfg5s5uzs7..js +0 -7
  245. package/.next/static/chunks/0_rmxom9~1lmk.css +0 -2
  246. package/.next/static/chunks/0cbezu61m-e~z.js +0 -1
  247. package/.next/static/chunks/0cj5qr_a8dzky.js +0 -7
  248. package/.next/static/chunks/0elalb9n_.~di.js +0 -1
  249. package/.next/static/chunks/0j_q__o8p6g83.js +0 -1
  250. package/.next/static/chunks/0jl6_w50zh4l5.js +0 -1
  251. package/.next/static/chunks/0mn0ruf0g4op5.js +0 -1
  252. package/.next/static/chunks/0r4q73.-1bkyl.js +0 -1
  253. package/.next/static/chunks/0r_c8eccg3z2o.js +0 -1
  254. package/.next/static/chunks/0y9subfnntv1s.js +0 -1
  255. package/.next/static/chunks/10oi7l-tycgl9.js +0 -1
  256. package/.next/static/chunks/11uk1izuv3~0t.js +0 -1
  257. /package/.next/static/{7xem03-473G3qw-fC160p → 23MxP0RBVA4BaOJ_HMYmM}/_buildManifest.js +0 -0
  258. /package/.next/static/{7xem03-473G3qw-fC160p → 23MxP0RBVA4BaOJ_HMYmM}/_clientMiddlewareManifest.js +0 -0
  259. /package/.next/static/{7xem03-473G3qw-fC160p → 23MxP0RBVA4BaOJ_HMYmM}/_ssgManifest.js +0 -0
@@ -0,0 +1,164 @@
1
+ /* Issue #112 acceptance: ZERO overlap in the topology (Vincent's hard
2
+ * done-criterion). At ~30 nodes, in both ring and grid layouts, asserts:
3
+ * - node ↔ node — status rings don't intersect
4
+ * - node ↔ panel — no node circle intersects an overlay panel rect
5
+ * - node ↔ group-label — no group-box label text covers a node
6
+ * - group-box ↔ box — no two group boxes overlap
7
+ * - label ↔ label — no two text labels overlap (Round 27 — caught
8
+ * the dense-node-label vs group-label collision
9
+ * Vincent reported in preview.29) */
10
+ import { chromium } from 'playwright';
11
+ import { readFileSync, mkdirSync } from 'node:fs';
12
+
13
+ const TOKEN = JSON.parse(readFileSync('/home/vansin/.anet/config.json', 'utf8')).token;
14
+ mkdirSync('/tmp/anet-issue-112', { recursive: true });
15
+ const browser = await chromium.launch({ headless: true });
16
+
17
+ // ~30 nodes: 4 prefix groups + a workdir group + singletons
18
+ const FLEET = [
19
+ ...['A站内容', 'A站评测', 'A站数据', 'A站设计', 'A站运营', 'A站工程'].map(a => ({ alias: a })),
20
+ ...['B站产品', 'B站工程', 'B站测试', 'B站运维', 'B站运营'].map(a => ({ alias: a })),
21
+ ...['P站产品', 'P站工程', 'P站测试', 'P站运维'].map(a => ({ alias: a })),
22
+ ...['通信龙', '通信牛', '通信马', '通信SDK马'].map(a => ({ alias: a })),
23
+ ...['srv-a', 'srv-b', 'srv-c'].map(a => ({ alias: a, project_dir: '/home/v/agent-orchestra' })),
24
+ ...['群星马', '书生1号', '微信马', '飞书马', '独立节点', '研究员1号', '研究员2号', '游侠马'].map(a => ({ alias: a })),
25
+ ];
26
+
27
+ const overlaps1D = (a0, a1, b0, b1, tol) => a0 < b1 - tol && b0 < a1 - tol;
28
+
29
+ async function check(layout) {
30
+ const ctx = await browser.newContext({ viewport: { width: 1280, height: 920 } });
31
+ await ctx.addCookies([{ name: 'anet_dashboard_session', value: `v3:${TOKEN}`, domain: '127.0.0.1', path: '/' }]);
32
+ await ctx.addInitScript((lay) => {
33
+ try {
34
+ localStorage.setItem('anet-theme', 'cyber');
35
+ localStorage.removeItem('anet-brand');
36
+ localStorage.removeItem('anet-topo-view');
37
+ localStorage.removeItem('anet-topo-nodescale'); // default M
38
+ localStorage.setItem('anet-topo-layout', lay);
39
+ sessionStorage.setItem('anet_v3_auth', '1');
40
+ } catch {}
41
+ }, layout);
42
+ await ctx.route('**/api/hub/status*', async (route) => {
43
+ const r = await route.fetch();
44
+ const b = await r.json();
45
+ const nid = (b.sessions || [])[0]?.network_id || 'default';
46
+ const sessions = FLEET.map((f, i) => ({
47
+ alias: f.alias, status: i % 5 === 0 ? 'working' : 'idle', network_id: nid,
48
+ project_dir: f.project_dir ?? null,
49
+ created_at: '2026-05-15T00:00:00Z', updated_at: '2026-05-15T00:00:00Z', last_seen_at: new Date().toISOString(),
50
+ }));
51
+ await route.fulfill({ response: r, json: { ...b, sessions } });
52
+ });
53
+ await ctx.route('**/api/hub/tasks*', (route) => route.fulfill({ json: { tasks: [] } }));
54
+ const page = await ctx.newPage();
55
+ await page.goto('http://127.0.0.1:3000/', { waitUntil: 'domcontentloaded' });
56
+ await page.waitForFunction(() => {
57
+ const svg = document.querySelector('svg[viewBox="0 0 1000 680"]');
58
+ return !!svg && svg.querySelectorAll('g[data-node]').length > 20;
59
+ }, { timeout: 30000 }).catch(() => {});
60
+ await page.waitForTimeout(800);
61
+
62
+ const data = await page.evaluate(() => {
63
+ const svg = document.querySelector('svg[viewBox="0 0 1000 680"]');
64
+ // node status rings: stroke-width 3 (online) / 1.5 (offline), centred on the node
65
+ const nodes = [...svg.querySelectorAll('g[data-node]')].map(g => {
66
+ const ring = g.querySelector('circle[stroke-width="3"], circle[stroke-width="1.5"]');
67
+ if (!ring) return null;
68
+ return { alias: g.getAttribute('data-node'), cx: +ring.getAttribute('cx'), cy: +ring.getAttribute('cy'), r: +ring.getAttribute('r') };
69
+ }).filter(Boolean);
70
+ // overlay panels (direct svg children, fixed)
71
+ const panels = [...svg.querySelectorAll(':scope > g[transform^="translate(28, 34)"], :scope > g[transform^="translate(720, 34)"]')].map(g => {
72
+ const m = g.getAttribute('transform').match(/translate\(([\d.]+),\s*([\d.]+)\)/);
73
+ const rect = g.querySelector('rect');
74
+ return { x: +m[1], y: +m[2], w: +rect.getAttribute('width'), h: +rect.getAttribute('height') };
75
+ });
76
+ // group boxes + their label text bounding boxes
77
+ const groups = [...svg.querySelectorAll('g[data-group]')].map(g => {
78
+ const rect = g.querySelector('rect');
79
+ const text = g.querySelector('text');
80
+ const bb = text.getBBox();
81
+ return {
82
+ box: { x: +rect.getAttribute('x'), y: +rect.getAttribute('y'), w: +rect.getAttribute('width'), h: +rect.getAttribute('height') },
83
+ label: { x: bb.x, y: bb.y, w: bb.width, h: bb.height },
84
+ };
85
+ });
86
+ // Round 27 / P0: every visible label bbox (node alias text + group
87
+ // headings) so we can assert label↔label clearance. Skip elements
88
+ // with empty bboxes (e.g., text inside an unrendered <g>).
89
+ const allLabels = [];
90
+ for (const t of svg.querySelectorAll('g[data-node] text, g[data-group] text')) {
91
+ const bb = t.getBBox();
92
+ if (bb.width === 0 || bb.height === 0) continue;
93
+ allLabels.push({
94
+ kind: t.closest('g[data-group]') ? 'group' : 'node',
95
+ owner: (t.closest('g[data-group]')?.getAttribute('data-group')) || (t.closest('g[data-node]')?.getAttribute('data-node')) || '?',
96
+ x: bb.x, y: bb.y, w: bb.width, h: bb.height,
97
+ });
98
+ }
99
+ return { nodes, panels, groups, allLabels };
100
+ });
101
+
102
+ const TOL = 2; // px slack — touching edges is fine, real overlap is not
103
+ let nodeNode = 0, nodePanel = 0, nodeLabel = 0, boxBox = 0, labelLabel = 0;
104
+
105
+ // node ↔ node
106
+ for (let i = 0; i < data.nodes.length; i++) {
107
+ for (let j = i + 1; j < data.nodes.length; j++) {
108
+ const a = data.nodes[i], b = data.nodes[j];
109
+ const d = Math.hypot(a.cx - b.cx, a.cy - b.cy);
110
+ if (d < a.r + b.r - TOL) nodeNode++;
111
+ }
112
+ }
113
+ // node ↔ panel (circle vs rect)
114
+ for (const n of data.nodes) {
115
+ for (const p of data.panels) {
116
+ const qx = Math.max(p.x, Math.min(n.cx, p.x + p.w));
117
+ const qy = Math.max(p.y, Math.min(n.cy, p.y + p.h));
118
+ if (Math.hypot(n.cx - qx, n.cy - qy) < n.r - TOL) nodePanel++;
119
+ }
120
+ }
121
+ // node ↔ group label (circle vs label text bbox)
122
+ for (const n of data.nodes) {
123
+ for (const g of data.groups) {
124
+ const L = g.label;
125
+ const qx = Math.max(L.x, Math.min(n.cx, L.x + L.w));
126
+ const qy = Math.max(L.y, Math.min(n.cy, L.y + L.h));
127
+ if (Math.hypot(n.cx - qx, n.cy - qy) < n.r - TOL) nodeLabel++;
128
+ }
129
+ }
130
+ // group box ↔ group box
131
+ for (let i = 0; i < data.groups.length; i++) {
132
+ for (let j = i + 1; j < data.groups.length; j++) {
133
+ const a = data.groups[i].box, b = data.groups[j].box;
134
+ if (overlaps1D(a.x, a.x + a.w, b.x, b.x + b.w, TOL) &&
135
+ overlaps1D(a.y, a.y + a.h, b.y, b.y + b.h, TOL)) boxBox++;
136
+ }
137
+ }
138
+ // label ↔ label (Round 27)
139
+ // Same-node node-labels (e.g. alias + sub-status in the full card) are
140
+ // intentionally close and adjacent — skip pairs that share an owner.
141
+ for (let i = 0; i < data.allLabels.length; i++) {
142
+ for (let j = i + 1; j < data.allLabels.length; j++) {
143
+ const a = data.allLabels[i], b = data.allLabels[j];
144
+ if (a.owner === b.owner) continue;
145
+ if (overlaps1D(a.x, a.x + a.w, b.x, b.x + b.w, TOL) &&
146
+ overlaps1D(a.y, a.y + a.h, b.y, b.y + b.h, TOL)) labelLabel++;
147
+ }
148
+ }
149
+
150
+ await page.screenshot({ path: `/tmp/anet-issue-112/overlap-${layout}.png` });
151
+ await ctx.close();
152
+ const ok = nodeNode === 0 && nodePanel === 0 && nodeLabel === 0 && boxBox === 0 && labelLabel === 0;
153
+ console.log(`${ok ? '✅' : '❌'} [${layout}] nodes=${data.nodes.length} groups=${data.groups.length} — ` +
154
+ `node↔node:${nodeNode} node↔panel:${nodePanel} node↔label:${nodeLabel} box↔box:${boxBox} label↔label:${labelLabel}`);
155
+ return ok;
156
+ }
157
+
158
+ const all = [];
159
+ all.push(await check('grid'));
160
+ all.push(await check('ring'));
161
+ await browser.close();
162
+ const pass = all.every(Boolean);
163
+ console.log(pass ? '\n✅ ZERO OVERLAP' : '\n❌ OVERLAP DETECTED');
164
+ process.exit(pass ? 0 : 1);
@@ -68,7 +68,7 @@ const results = {};
68
68
  results.panelOcclusion = await page.evaluate(() => {
69
69
  const svg = document.querySelector('svg[viewBox="0 0 1000 680"]');
70
70
  // overlay panels: <g transform="translate(28, 34)"> and translate(720, 34)
71
- const panels = [...svg.querySelectorAll(':scope > g[transform^="translate(28, 34)"], :scope > g[transform^="translate(720, 34)"]')]
71
+ const panels = [...svg.querySelectorAll(':scope > g[transform^="translate(16, 16)"], :scope > g[transform^="translate(760, 16)"]')]
72
72
  .map(g => {
73
73
  const m = g.getAttribute('transform').match(/translate\(([\d.]+),\s*([\d.]+)\)/);
74
74
  const rect = g.querySelector('rect');
@@ -92,7 +92,7 @@ const results = {};
92
92
  // panels exist and are OUTSIDE the zoom/pan transform group (direct svg children)
93
93
  results.panelsOutsideTransform = await page.evaluate(() => {
94
94
  const svg = document.querySelector('svg[viewBox="0 0 1000 680"]');
95
- const panels = [...svg.querySelectorAll(':scope > g[transform^="translate(28, 34)"], :scope > g[transform^="translate(720, 34)"]')];
95
+ const panels = [...svg.querySelectorAll(':scope > g[transform^="translate(16, 16)"], :scope > g[transform^="translate(760, 16)"]')];
96
96
  return panels.length === 2; // :scope > = direct children, not inside the view <g>
97
97
  });
98
98
  await page.screenshot({ path: '/tmp/anet-issue-112/grid-occlusion.png' });
@@ -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);