diff --git a/web/e2e/netgraph-3d.spec.ts b/web/e2e/netgraph-3d.spec.ts index b915c0e..e1c8805 100644 --- a/web/e2e/netgraph-3d.spec.ts +++ b/web/e2e/netgraph-3d.spec.ts @@ -82,6 +82,13 @@ test('3D starts top-down, frames neighbours, inspects the drawn curve and preser if (await choice.isVisible()) await choice.click(); await expect(stage).toHaveAttribute('data-selected-route-id', 'visual-hop'); await expect(inspector).toBeVisible(); + await page.getByRole('button', { name: 'Close connection details' }).click(); + await page.locator('#graph-routes-button').click(); + await expect(stage).toHaveAttribute('data-history-routes', 'false'); + await stage.click({ position: { x: midpoint[0]!, y: midpoint[1]! } }); + await expect(stage).toHaveAttribute('data-selected-route-id', ''); + await expect(inspector).toBeHidden(); + await page.locator('#graph-routes-button').click(); await page.locator('#display-button').click(); await page.getByRole('button', { name: 'Rotate topology right' }).click(); await expect.poll(() => stage.getAttribute('data-view-yaw').then(Number)).toBeGreaterThan(0.2); diff --git a/web/src/netgraph/renderer.ts b/web/src/netgraph/renderer.ts index b08ebcf..3239520 100644 --- a/web/src/netgraph/renderer.ts +++ b/web/src/netgraph/renderer.ts @@ -1704,7 +1704,12 @@ export class NetgraphRenderer implements ViewportProjector { #nearestRoutes(x: number, y: number): string[] { const hits: Array<{ id: string; distance: number }> = []; + const lit = this.#regionLayout.routes ? null : new Set([ + ...this.#residue.map(r => r.routeId), + ...this.#activeRoutes.flatMap(a => a.packet.segments.map(s => s.routeId)), + ]); for (const route of this.#visibleRoutes) { + if (lit && !lit.has(route.id)) continue; const path = this.#routePath(route.fromId, route.toId); const distance = distanceToGraphPath(path, x, y); if (distance <= Math.max(7, displayPreferences().width + 4)) hits.push({ id: route.id, distance });