Skip to content

R8a: restore Open Document View for chat and conversation nodes - #170

Merged
dovvnloading merged 1 commit into
mainfrom
r8a/document-view
Jul 29, 2026
Merged

R8a: restore Open Document View for chat and conversation nodes#170
dovvnloading merged 1 commit into
mainfrom
r8a/document-view

Conversation

@dovvnloading

Copy link
Copy Markdown
Owner

Summary

Restores the "Open Document View" menu action on chat nodes and conversation nodes, replacing a disabled placeholder with a working read-only overlay.

Problem

Both node kinds' right-click menus carried the item disabled, with the tooltip "Document view integration isn't wired into the SPA yet". The R7.6b Qt cutover deleted the legacy embedded document-viewer panel (graphlink_document_viewer_web.py) without porting a successor.

Changes

DocumentViewDialog.tsx is a new read-only, scrollable modal showing a node's full content as markdown. The feature is frontend-only: the content is already client-side (a chat node's own text, or a conversation node's message history), so no backend change or new WS intent was needed — only formatting and display.

It reuses the app's existing shared Dialog surface, the same centered, single-open-across-the-app modal About/Help/Settings/Chat Library already use, rather than the raw-createPortal anchored-popup pattern NodeMenu/CodeExecutionApprovalPanel use — this surface isn't anchored to a click point.

Conversation transcript formatting is ported from the deleted application's own _history_to_markdown + _build_document_section("Conversation Transcript", ...): each non-blank message becomes ### N. Role, numbered 1-indexed over the full history including skipped blanks (a blank message consumes its number rather than compressing the sequence), joined under one ## Conversation Transcript heading.

SceneCanvas.tsx owns the one piece of state this needs — which markdown is currently displayed — and threads an onOpenDocumentView callback through toFlowNodes as a new optional third parameter, so the ~50 existing two-argument call sites in SceneCanvas.test.tsx are unaffected. Both node kinds guard against opening on empty content.

Verification

Check Result
Backend suite 1033 passed (unaffected — no backend changes)
Frontend tsc --noEmit / ESLint / tests / build clean / 0 errors / 813 passed (16 new) / succeeds
Live: menu item enabled, no tooltip confirmed against the running app
Live: real chat node's content renders inside the dialog confirmed
Live: Escape closes the dialog confirmed
Live: no console errors confirmed

Live verification covered the chat-node path end to end. The conversation-transcript formatter — including the blank-message numbering edge case — was hand-verified against the exact ported algorithm and covered by dedicated unit tests, but not observed live, as the available test data contained no conversation nodes.

Related

Hide Other Branches remains disabled — a distinct legacy feature (branch-visibility toggling) with no backend or frontend equivalent yet, tracked as separate work.

Both node kinds' right-click menus carried a disabled "Open Document View"
stub with the tooltip "Document view integration isn't wired into the SPA
yet" since the R7.6b Qt cutover deleted the legacy embedded document-
viewer panel (graphlink_document_viewer_web.py) without a successor.

DocumentViewDialog.tsx restores it as a read-only, scrollable modal
showing a node's full content as markdown. Frontend-only: the content is
already client-side (a chat node's own text, or a conversation node's
message history), so there is no backend change and no new WS intent -
only formatting and display. It reuses the app's existing shared Dialog
surface (the same one About/Help/Settings/Chat Library use - a centered,
single-open-across-the-app modal) rather than the raw-createPortal
anchored-popup pattern NodeMenu/CodeExecutionApprovalPanel use, since this
is not anchored to a click point.

Conversation nodes format their message history into a numbered
transcript, ported from the deleted app's own _history_to_markdown +
_build_document_section("Conversation Transcript", ...): each non-blank
message becomes "### N. Role", 1-indexed over the full history including
skipped blanks (a blank message consumes its number rather than
compressing the sequence), joined under one "## Conversation Transcript"
heading.

SceneCanvas.tsx owns the one piece of state this needs (which markdown is
currently on display) and threads an onOpenDocumentView callback through
toFlowNodes as a new optional third parameter, so the ~50 existing
two-argument call sites in SceneCanvas.test.tsx are unaffected. Both node
kinds guard against opening on empty content.

Built via four agents working in parallel on disjoint files against one
shared contract, then reviewed by two independent passes (cross-file
contract correctness, and transcript-format/test-quality fidelity) - both
came back clean. Verified independently: full backend suite (1033),
frontend typecheck/lint/tests/build (813 tests, 0 lint errors), and a live
browser check confirming the menu item is enabled, a real chat node's
content renders in the dialog, and Escape closes it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@dovvnloading
dovvnloading merged commit 161fd3c into main Jul 29, 2026
2 checks passed
@dovvnloading
dovvnloading deleted the r8a/document-view branch July 29, 2026 00:04
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