Skip to content

fix(node-ui): stabilize swm graph coloring#600

Merged
Jurij89 merged 2 commits into
mainfrom
codex/cgux-m3-swm-graph-color
May 23, 2026
Merged

fix(node-ui): stabilize swm graph coloring#600
Jurij89 merged 2 commits into
mainfrom
codex/cgux-m3-swm-graph-color

Conversation

@Jurij89
Copy link
Copy Markdown
Contributor

@Jurij89 Jurij89 commented May 22, 2026

Summary

  • Remount Context Graph layer graphs per context/layer identity so stale RdfGraph styling cannot carry across WM/SWM/VM switches.
  • Gate the SWM graph until attribution lookup resolves or fails, preventing a first paint with missing nodeColors.
  • Invalidate in-flight SWM attribution requests when the hook is disabled, so leaving and returning to SWM cannot unlock a stale render.

Related

Files changed

File What
packages/node-ui/src/ui/views/project/components.tsx Keys layer graph instances and shows an SWM attribution loading placeholder before graph render.
packages/node-ui/src/ui/hooks/useSwmAttributions.ts Tracks resolved context graph id and invalidates stale in-flight attribution requests.
packages/node-ui/test/layer-graph-panel.test.ts Covers SWM first-paint gating, attribution failure fallback, in-flight invalidation, and graph remounting.

Test plan

  • pnpm --filter @origintrail-official/dkg-node-ui exec vitest run test/layer-graph-panel.test.ts
  • pnpm --filter @origintrail-official/dkg-node-ui exec vitest run test/layer-graph-panel.test.ts test/ui-compat.test.ts test/use-memory-entities-live-updates.test.ts test/use-memory-entities-partial.test.ts
  • pnpm --filter @origintrail-official/dkg-node-ui run build
  • pnpm --filter @origintrail-official/dkg-node-ui run build:ui
  • git diff --check
  • Browser boot smoke at http://localhost:9200/ui/ with no console errors.
  • Populated-node browser graph check on Hello World: WM and SWM graph canvases render nonblank; WM→SWM→WM keeps WM slate and does not carry amber back into WM.
  • Local PR review: 2 rounds, final result had no actionable comments.

Note: multi-agent attribution quality remains out of scope for M3 and is still gated for N3/G-Q15.

);
}

if (swmAttributionPending) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Bug: This now blocks the entire SWM graph on the attribution lookup, but useSwmAttributions never aborts or times out its /api/query request. If that request stalls during a daemon restart or slow backend query, swmAttr.loading never clears and the SWM tab becomes permanently blank. Before this PR users could still inspect the graph without attribution colors. Please either render the graph with fallback colors while attribution is pending, or add an abort/timeout path so this placeholder cannot hang forever.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex review produced 4 comment(s) but all targeted lines outside the diff and were dropped. Check the workflow logs for details.

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