codebase-memory-mcp icon indicating copy to clipboard operation
codebase-memory-mcp copied to clipboard

fix(graph-ui): clear ADR content on delete

Open ShiroKSH opened this issue 4 months ago • 1 comments

## Summary

Fixes ADR deletion in the graph UI. The delete action cleared React state and then saved through the stale state value, so the old ADR content could be posted back instead of an empty body.

Changes

  • Allows the ADR save helper to receive the content that should be posted.
  • Sends an explicit empty ADR body from the delete action.
  • Wraps the normal save click handler so React mouse events are not treated as content.
  • Adds a regression test for deleting an existing ADR.

Validation

  • npm test -- --run src/components/StatsTab.test.tsx
  • npm test
  • npm run build
  • git diff --check

ShiroKSH avatar Jul 09 '26 18:07 ShiroKSH

Thanks for the graph UI fix. I have triaged this into 0.9.1-rc as a normal-priority UX/behavior bug fix. Review focus will be the explicit empty delete body and making sure the UI event handling stays consistent with the ADR endpoints.

DeusData avatar Jul 10 '26 19:07 DeusData

Merged. Verified end-to-end with vitest: the new "posts empty ADR content when deleting" test is a genuine guard — RED without your fix (the delete re-posts the stale "old decision text" because the save read through the cleared-but-not-yet-committed React state), GREEN with it. Passing the intended content explicitly to the save helper is the right fix for the stale-closure bug. All 11 StatsTab tests pass. Thank you — clean ADR data-safety fix.

DeusData avatar Jul 15 '26 23:07 DeusData