Skip to content

feat(ui): premium refinement pass + React Flow service map#111

Merged
aksOps merged 3 commits into
mainfrom
ui/react-flow-service-map
Jun 18, 2026
Merged

feat(ui): premium refinement pass + React Flow service map#111
aksOps merged 3 commits into
mainfrom
ui/react-flow-service-map

Conversation

@aksOps

@aksOps aksOps commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Two commits, building on the v0.3.0 map-centric "Service Map" redesign:

1. Premium refinement pass — feat(ui)

  • Inspector is now a single floating popup (Radix dialog, non-modal, top-anchored) carrying Overview / Why / Impact / Dependencies tabs on every breakpoint — the docked category rail is gone.
  • Type system: Martian Grotesk + Martian Mono (Evil Martians, OFL; latin-subset, vendored, air-gap-safe).
  • Colour: refined indigo accent + deeper surfaces.
  • Map polish: node click reliably opens the inspector (fixed setPointerCapture swallowing the click), node size by edge count, outline-led status chips, light grid, straight edges.
  • Side panel: collapsible status groups with always-visible counts + an "Anomalies" group; service rows are name-first (numeric stats moved into the popup).
  • Shell: removed the single-item nav rail, the top anomalies strip, and the investigation TrailBar.

2. React Flow service map — refactor(ui)

  • Replaced the hand-rolled SVG map with React Flow (@xyflow/react, MIT) while keeping our own deterministic radial layout (radialLayout.ts). React Flow owns pan/zoom/pinch, fit-view, grid background and a11y focus; nodes are token-themed React components; edges are straight centre-to-centre.
  • @xyflow/react@12.11.0 is fully lazy (lands in the ConstellationHome chunk, +~52 KB gz) — initial JS unchanged (~103 KB gz). npm audit clean; transitives (zustand / classcat / d3-zoom) all permissive.
  • Cleanup of now-dead code: AnomalyStrip, lib/sheet, and assorted dead CSS.

Validation

  • tsc clean · 377 unit tests pass · production build + bundle budgets green · jscpd 0.45%
  • CDP browser click-through: nodes / edges / grid render and a node click opens the inspector.

Notes

  • dagLayout / radialLayout keep a few exports the app no longer calls (edgePath, walkFrom, zoomAt, fitTransform, layoutGraph, walkRadial) — tree-shaken out of the bundle, still unit-tested; can be pruned in a follow-up.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LDQVJrixs2nJoea67a8pEG

aksOps and others added 2 commits June 18, 2026 03:10
…p polish

Iterates on the v0.3.0 map-centric redesign with a batch of UI refinements.

Inspector
- Drop the docked category rail; the details popup is the sole surface,
  carrying the Overview/Why/Impact/Dependencies tabs on every breakpoint.
- Top-anchor the popup so switching tabs no longer re-centers/jumps it.
- Prominent, explicitly-coloured service name.

Service map (FlowMap)
- Fix node clicks being swallowed: defer pointer capture until a drag passes
  DRAG_SLOP, so a tap falls through to onSelect (setPointerCapture-on-down was
  retargeting the click to the <svg>). Pan/pinch unchanged.
- Outline-led nodes: full status-hue border + neutral (--bg-inset) fill.
- Node size scales with edge count; clean label truncation; light grid bg.

Side panel
- Status groups are collapsible (chevron + always-visible count); Healthy
  starts collapsed. Add a collapsible "Anomalies" group.
- ServiceRow drops the inline rps/err/p99 columns so names stay legible;
  full stats live in the popup.

Shell / chrome
- Remove the single-item nav rail; the canvas fills the width.
- Remove the top anomalies strip (anomalies now live in the side panel).
- Remove the investigation TrailBar.

Type + colour
- Vendor Martian Grotesk + Martian Mono (Evil Martians, OFL; sans subset
  36KB, mono 24KB) replacing Inter + JetBrains Mono.
- Refine the accent to indigo; deepen surfaces; theme-color + ErrorBoundary
  fallbacks updated.

tsc clean, 413 unit tests pass, bundle budgets met. Tests updated across
App/Shell/Inspector/FlowMap/ConstellationHome.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LDQVJrixs2nJoea67a8pEG
Replace the hand-rolled SVG service map with React Flow (@xyflow/react, MIT)
while keeping our own deterministic radial layout. React Flow now owns
pan/zoom/pinch, fit-view, the grid background and a11y focus, so a large
amount of bespoke interaction code is gone.

- FlowMap.tsx: feed radialLayout positions into <ReactFlow>; a token-themed
  chip as a custom node; straight centre-to-centre floating edges (failing
  edges keep the marching-dash style); grid <Background>; node click → inspector;
  fit() exposed via the ref. (Edges were straightened first — quadratic bow → a
  line — which is now native to React Flow.)
- FlowMap.module.css: theme React Flow's own DOM to the dark token system.
- @xyflow/react@12.11.0 added (peer react>=17; transitives zustand/classcat/
  d3-zoom, all permissive; npm audit clean). Fully lazy — it lives in the
  ConstellationHome chunk (+~52 KB gz), so initial JS is unchanged (~103 KB);
  budgets.json gains a ConstellationHome lazy-chunk exception.
- Tests: FlowMap.test rewritten for React Flow; ConstellationHome.test map
  assertions adapted (async node queries; fireEvent click to dodge a jsdom
  d3-zoom crash); test-setup gains React Flow jsdom shims.

Cleanup (dead after this + prior refactors):
- Remove the unused AnomalyStrip component + CSS + test (the top strip was
  dropped; anomalies live in the side panel now).
- Remove orphaned lib/sheet.ts + test (bottom-sheet → popup).
- Drop dead CSS: ServiceInspector .tabs/.sheet*/.srOnly, FlowMap .minimap.

CLAUDE.md updated to document React Flow as the sanctioned map library.

tsc clean, 377 unit tests pass, build + bundle budgets green, jscpd 0.45%, and
a CDP browser click-through confirms nodes/edges/grid render and a node click
opens the inspector.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LDQVJrixs2nJoea67a8pEG
@socket-security

socket-security Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​xyflow/​react@​12.11.09910010091100

View full report

SonarCloud S2871 (CRITICAL/HIGH reliability) flagged the bare `.sort()`
on the shape-hash edge-key strings in FlowMap — the default sort coerces
to UTF-16 code units, so it's not a reliable alphabetical sort. Add a
`localeCompare` comparator (mirrors the sibling `.sort(compareIds)` on
the ids line). The shape hash stays deterministic; no behaviour change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LDQVJrixs2nJoea67a8pEG
@sonarqubecloud

Copy link
Copy Markdown

@aksOps aksOps merged commit c64f057 into main Jun 18, 2026
17 checks passed
@aksOps aksOps deleted the ui/react-flow-service-map branch June 18, 2026 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant