feat(desktop): live-refresh the Knowledge graph after a turn (no close/reopen)#63
Merged
Conversation
…e/reopen)
The KG only re-rendered on open/import/unlock, so facts learned during a chat
(learnFromTurn, background) never appeared until you closed and reopened the panel.
Add a position-preserving GraphHandle.update(data) that MERGES fresh data into the
running force simulation: existing nodes keep their x/y (no layout jump), new nodes
animate in near the centre, removed nodes drop, edges rebuild, and the sim reheats
so new nodes settle. After each turn, if the KG is open, poll twice (1.5s + 4.5s,
covering the fast heuristic and slower model extractor) and update() only when a
cheap change-signature differs — so an unchanged graph is a no-op.
Verified live: sent 'I prefer working in dark mode' with the KG open; the graph went
4 -> 5 nodes ('working in dark mode' appeared) without reopening, all original nodes
preserved, no console errors. 277 desktop tests green; tsc clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
mlcyclops
added a commit
that referenced
this pull request
Jun 24, 2026
…f it was its last) (#64) The forget handler dropped the fact from the side panel but never refreshed the graph, so a node lingered until close/reopen. Call refreshKnowledgeLive() after forgetting — same position-preserving merge path added in #63 — so the node disappears immediately when its last fact is forgotten. tsc clean. Co-authored-by: mlcyclops <mlcyclops@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the KG-refresh half of the #54 discussion.
Problem
The Knowledge graph only re-rendered when you opened it (or after import/unlock). Facts learned during a chat (
learnFromTurn, background) never showed until you closed and reopened the panel.Fix
GraphHandle.update(data)that merges fresh data into the live force simulation: existing nodes keep their x/y (no jump), new nodes animate in, removed nodes drop, edges rebuild, sim reheats so new nodes settle.update()only when a cheap change-signature differs (unchanged graph = no-op, no flicker).Verified live (preview)
Sent
I prefer working in dark modewith the KG open → graph went 4 → 5 nodes (working in dark modeappeared) without reopening, all original nodes preserved, no console errors (screenshot in the session). 277 desktop tests green; tsc clean.🤖 Generated with Claude Code