Repository navigation
V0-08: Reconnect graph view and Relationship focus - #28
Merged
Merged
Conversation
Adds a graph view of the active Thinking Workspace and makes Relationship focus consistent across all three views. Degree, related Notes, relate candidates, dimming, and the drawn graph previously would have counted the same Relationships in three places. They now all read one projection, `thinkingGraph(notes, relationships)`, which admits a link only when both endpoints are Notes of the Workspace it was given and admits each canonical pair once. A dangling or cross-Workspace link therefore cannot be built, and a node's degree is by construction the number of lines drawn to it. The arrangement is derived, never stored: `graphLayout` runs a force simulation to rest inside a pure call and returns placements, so there is no simulation to own, no coordinate to persist, and a restart rebuilds the same picture from SQLite alone. Focus stays transient. Hovering a node previews what it is related to, clicking locks that focus, and clicking again, Escape, or the Note leaving the screen lets it go. Focus survives a view change, because the accepted outcome that tiling and kanban dim against the same related set is only observable if it does, and because #8 shipped a test asserting it; the audit records this deviation from the issue's clearing list. Selecting a node opens the same Note card the other views place, over the same intents, so the graph offers no action the other views lack. 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 #9.
What changed
A third way of reading the committed Notes — the Thinking Graph, drawn — plus Relationship focus that behaves the same in all three views.
One projection, so nothing can disagree
thinkingGraph(notes, relationships)is now the only place a Relationship becomes a link. Degree, related Notes, relate candidates, dimming, and the drawn graph all read it. Previouslydegreecounted endpoints inRelationship[]whilerelatedNotesfilteredNote[], and the graph would have counted a third time; the acceptance criterion that degree and related highlighting agree is now something you cannot express the negation of.A link is admitted only when both endpoints name a Note in the list the projection was given, and App gives it the active Workspace's Notes. A Relationship left behind by a moved Note, or one naming another Workspace, has no node to attach to and is never built — no view has to check for it. Canonical pairs are deduplicated on the way in, and a self-pair is refused.
The arrangement is derived, never stored
graph-layout.tsruns a d3 force simulation to rest inside a pure function and returns the placements. There is no simulation to own, no animation frame scheduled, no coordinate to persist, and no reconciliation after a mutation. A restart rebuilds the same picture from SQLite alone, which a test asserts by comparing the drawn markup across a remount. Node radius grows with degree against the most related Note in the graph, floored so an unrelated Note is a smaller node rather than an invisible one.Focus
Hovering a node previews what it is related to; clicking locks that focus; clicking again, Escape, or the Note leaving the screen (deletion, search, Workspace switch) lets it go. One lit set drives dimming in graph, tiling, and kanban. Selecting a node opens the same
NoteCardthe other views place, over the same intents, so the graph offers no action the other views lack. Nothing about focus or dimming is committed.One deviation from the issue, deliberate
The issue lists a view change among the things that clear a locked focus. Two accepted outcomes contradict it: tiling and kanban must dim against the same related set, which is only observable if focus survives the switch between them, and #8 shipped a test asserting the navigated-to Note stays selected across a view switch. Focus therefore survives a view change. This is recorded in the audit rather than resolved silently — say the word if you want it the other way and I will change both.
The graph reads the Workspace's Notes rather than the search-narrowed result, so that every active-Workspace Note appears once and a search cannot make a Note look less connected than it is. Search still narrows tiling and kanban.
Testing
src/thinking-graph.test.ts— node and link uniqueness, degree as drawn links, dangling and cross-Workspace endpoints, self-pairs, and what a focus lights, including that degree and the lit set agree for every Note.src/graph-layout.test.ts— every Note placed once and whole inside the canvas; radius monotonic in degree; the same committed state laying out identically; empty, single-Note, disconnected, and dense graphs.src/App.test.tsx— hover preview, lock and unlock, Escape, cross-view dimming, deletion while focused, Relationship removal redrawing from committed state, a moved Note's link disappearing, and a restart.npm run checkpasses: typecheck, lint, 91 frontend tests, 19 Rust tests, and the Tauri smoke build. The UI only runs against the Tauri backend, so it was verified through the DOM rather than in a browser.Delivery workflow
prd-simplicity-auditis recorded indocs/v0/audits/09-graph-view.md.src-tauri/is untouched — no new command, no migration.🤖 Generated with Claude Code