feat: show all topology overlay on the map (closes #72) #77
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "agent/feat_72_show_all_topology"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Backend
Frontend
Follow-ups
Test plan
☑ go test ./... — all green.
☑ go vet ./... — clean.
☑ golangci-lint run ./internal/... — 0 issues.
☑ npm run typecheck — clean.
☑ npm run lint — clean.
☑ npm test — 136/136 pass.
☑ npm run build — succeeds, refreshes internal/frontend/assets/dist/.
☑ go build ./cmd/server — succeeds.
Manual QA
Toggle off → on: snapshot fetches, label flips to 🕸️ (N), edges render.
Toggle on → off: edges disappear, store resets on next page navigation.
Refreshing the page with the toggle on: toggle is off (in-memory only).
Cache: rapid toggle off/on within the TTL window does not refetch.
Truncation: at topology_max_edges: 3, the response shows truncated: true and the label shows 🕸️ (3+).
Mobile: control sits above the iOS Safari home indicator and does not overlap Leaflet attribution.
Add a 'Show all topology' toggle to the map view. When enabled, the UI fetches a fresh snapshot of /api/v1/topology/edges and renders every edge that has both endpoints positioned. The toggle lives in the bottom-right corner of the map stage, uses a spider-web emoji, and shows the live edge count in the label. Truncation is reflected when the backend hits its configurable cap. Backend: - Add web.map.topology_max_edges config (default 2000, MML_WEB__MAP__TOPOLOGY_MAX_EDGES override, normalised to default when zero or negative). - Reuse the existing web.map.topology_cache_ttl for a new server-side cache of /api/v1/topology/edges responses. The cache key includes the parsed query so different filters get their own slot. - Wrap the /api/v1/topology/edges response in {items, truncated}. This is an intentional, documented shape change. - Apply the cap as a SQL LIMIT on the existing newest-first ordering and signal truncation when the result fills the slot. - Update openapi.yaml, config.example.yaml, and README.md. Frontend: - Reuse the existing meta.map.topology_cache_ttl for an in-memory TTL check so toggling off and on within the window does not refetch. - Topology toggle state is in-memory only; no localStorage or URL persistence, matching the rest of the project rules for transient UI state. - Add topologyColorFromEdge helper, MapTopologyToggle component, useTopologyAllStore, and a LeafletMapAdapter.renderAllTopology() method that draws the global layer under the focal-node layer.48f36a954ce314a52670