Skip to content

Phase 5: graph + claims views - #6

Open
MaggieAppleton wants to merge 1 commit into
mainfrom
claude/laughing-brahmagupta
Open

Phase 5: graph + claims views#6
MaggieAppleton wants to merge 1 commit into
mainfrom
claude/laughing-brahmagupta

Conversation

@MaggieAppleton

Copy link
Copy Markdown
Owner

Summary

  • Adds ArgumentGraph component (ReactFlow-based) reading nodes from EditorContext.highlights, edges from session.relationships, and positions from session.graphPositions. Supports drag-to-persist positions, edge create/delete, and node deletion (removes the mark from the Remirror doc).
  • Adds ClaimsView and ClaimCard components that derive claims and their supporting evidence from the same highlights + relationships sources — no second LLM pass.
  • Extends EditorContext with four structural commands (addHighlightAtSelection, appendHighlight, updateHighlightText, removeHighlight) so graph and claims views can mutate the document without touching the DB directly.
  • Wires both new views into AnalysisPage.tsx, replacing the Phase 4 placeholders.

Architecture notes

All three analysis tabs (text / graph / claims) share a single Remirror editor instance mounted above the tab conditional. State is never remounted on tab switch — graph/claims read useEditorContext().highlights directly, which re-derives from the live ProseMirror doc on every state change.

Graph positions are persisted to session.graphPositions (Dexie) on drag-stop only — not per-pixel — to avoid excessive DB writes.

Test plan

  • npm run build exits 0
  • npm run test exits 15/15
  • Open an analysed session → all three tabs render content
  • Add a highlight in text view → appears as node in graph tab and (if claim) card in claims tab
  • Drag a graph node → reload preserves position
  • Create an edge between nodes → shows in claims as evidence-of-claim, persists on reload
  • Delete a node from graph → mark removed from text view, edges pruned, confirmed on reload
  • Edit highlight text in claims view → new text appears in text view

🤖 Generated with Claude Code

Adds ArgumentGraph (ReactFlow), ClaimsView, and ClaimCard components.
Extends EditorContext with structural commands (appendHighlight,
updateHighlightText, removeHighlight, addHighlightAtSelection) so all
three analysis tabs share a single Remirror source of truth.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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