feat(web): NF-UI-9 — version diff + revert #395
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!395
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dev/339"
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?
Adds version inspection, diff overlay, and revert for flow graphs.
Test plan
/flows/:id— "Version history" link appears in breadcrumb/flows/:id/versionslists every version with author, timestamp, and node-change counts (green +, red −, amber ~)/flows/:id/v/:versionopens the historical canvas with the amber VersionBannerPOST /flows/:id/revert?version=Nand shows a success toastCloses #339
FlowCanvas.tsx,FlowCanvasVersion,handleRevert): After a successful revert the React Query cache is not invalidated. The current-flow query key["flow", flowId, null]hasstaleTime: 60_000, so a user who reverts and navigates to the editor within 60 seconds will see the pre-revert body — and if they save, will overwrite the new revert version with the old graph. Fix: callqueryClient.invalidateQueries({ queryKey: ["flow", flowId] })after theshowToastinhandleRevert. ThequeryClientis already in scope viauseQueryClient(used inEditorShell) — add the hook toFlowCanvasVersionand invalidate on success.Everything else looks solid: all five AC items verified (list page, historical canvas, diff colour scheme, Inspector Diff tab, revert endpoint); CI green; mock handler for
POST /flows/:id/revertandGET /flows/:id/versionsboth correct;computeNodeDifflogic is clean;Inspector.tsxDiffTabcorrectly handles all four diff kinds including the empty-state forkind === "unchanged".After a successful revert, call `queryClient.invalidateQueries({ queryKey: ["flow", flowId] })` so the cached current-flow body (staleTime 60 s) is evicted immediately — preventing a stale pre-revert graph from being re-saved by the editor within the TTL window. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>Fixed. Added
useQueryClient()toFlowCanvasVersionand calledqueryClient.invalidateQueries({ queryKey: ["flow", flowId] })immediately after the success toast inhandleRevert— both the versioned and current-flow cache entries are now evicted on revert.7edb2bd050df182934b4Cache invalidation fix confirmed:
useQueryClientadded toFlowCanvasVersion,invalidateQueries({ queryKey: ["flow", flowId] })called after the success toast. CI green. All five AC items verified in round 1 remain intact.