[codex] Productize runtime map UI#26
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fac4377c91
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| const runtime = model.runtime; | ||
|
|
||
| const filteredNodes = useMemo(() => { |
There was a problem hiding this comment.
Move the runtime filter hook before early returns
When /runtime is the first route rendered (direct URL/default route), model is initially null, so the component returns on the loading/empty branch before this useMemo runs. After the fetch completes the same component renders with an extra hook and React throws Rendered more hooks than during the previous render, leaving the Runtime page unusable; compute the memo before any conditional return or avoid a hook here.
Useful? React with 👍 / 👎.
| } | ||
|
|
||
| function runtimeLayerForNode(node: RuntimeMapNode): RuntimeLayerId { | ||
| return (node.layer ?? "unassigned") as RuntimeLayerId; |
There was a problem hiding this comment.
Populate layers for live runtime nodes
In live mode /api/runtime/map is proxied from the Rust daemon, whose RuntimeMapNode currently serializes no layer field (crates/dockermap-core/src/lib.rs:468-476), so this fallback puts every live node into unassigned. The new layer count/filter therefore only works with the demo data and is misleading for actual hosts; infer a layer from type/provider or add the field on the daemon side.
Useful? React with 👍 / 👎.
| if ( | ||
| value.includes("healthy") || | ||
| value.includes("running") || | ||
| value.includes("active") || |
There was a problem hiding this comment.
Check inactive statuses before active
For systemd nodes the daemon assigns node.status from ActiveState (systemd_runtime_node), so stopped units commonly arrive as inactive. Because this positive match uses substring search, inactive contains active and is classified as healthy, hiding those units from the attention count/filter; match exact active/running states or handle inactive as offline/unknown before this branch.
Useful? React with 👍 / 👎.
What changed
/api/snapshot+/api/graphto/api/runtime/map+/api/snapshotscripts/smoke-deploy.shto verify protected-route401behavior and a live/api/events/streamsnapshot eventCARGO_INCREMENTAL=0for the local daemon build on this MacWhy
The repo already exposed
/api/runtime/map, but the main UI still depended on the older Docker-centric snapshot/graph path. This change makes the runtime map a real product surface instead of a backend side channel.Impact
Validation
npm run checknpm run test:e2enpm run build:deployDOCKERMAP_API_TOKEN=test-token DOCKERMAP_SMOKE_URL=http://127.0.0.1:4000 ./scripts/smoke-deploy.sh