Skip to content

Qt-removal R7.5b-1: Faded Connections canvas visual#148

Merged
dovvnloading merged 1 commit into
mainfrom
qt-removal/r7-5b1-faded-connections
Jul 26, 2026
Merged

Qt-removal R7.5b-1: Faded Connections canvas visual#148
dovvnloading merged 1 commit into
mainfrom
qt-removal/r7-5b1-faded-connections

Conversation

@dovvnloading

Copy link
Copy Markdown
Owner

Summary

Ports the legacy scene's faded connections toggle into the new React Flow canvas — the first and smallest of R7.5's three remaining canvas-visual parity gaps (faded connections → orthogonal routing → smart guides, shipping in that order). When enabled, every connection on the canvas dims to low opacity except the one currently under the mouse, matching the legacy ChatScene's exact behavior (confirmed via fresh recon of graphlink_connections.py/graphlink_scene.py, not reimplemented from memory).

What changed

  • backend/canvas.py: SceneDocument gains fade_connections_enabled: bool = False, published on the existing "scene" topic. A setFadeConnections intent (name matches the legacy GridControlBridge's own Slot name 1:1, per this file's established convention) flips it and republishes — identical shape to the existing setSnapToGrid.
  • graphlink_app/graphlink_scene_payload.py: the codegen source-of-truth dataclass for the SPA's wire type gains the matching field (confirmed this is a separate file from backend/canvas.py's runtime payload dict, not redundant — codegen reads from here).
  • web_ui/src/app/canvas/SceneCanvas.tsx: toFlowEdges (now exported for direct unit testing, same as toFlowNodes) takes a hoveredEdgeId and applies the legacy-exact 0.08 opacity to every edge except the hovered one, wired through new onEdgeMouseEnter/onEdgeMouseLeave props on <ReactFlow>. Legacy's is_selected stay-bright exemption was deliberately not ported — the recon confirmed it's dead code (never set True anywhere in the Qt codebase).
  • web_ui/src/app/canvas/sceneStore.ts: setFadeConnections intent wrapper, matching setSnapToGrid.
  • web_ui/src/app/chrome/ViewPopover.tsx: a new "Fade Connections" checkbox in the Grid section, same view-check-row markup as the existing Snap to Grid checkbox.
  • web_ui/src/app/chrome/help-data/sections.ts: Help panel text updated to list faded connections as available (R7.5a had corrected it to say "not available yet"; orthogonal routing and smart guides remain honestly listed as not-yet-available until their own increments land).
  • Generated codegen artifacts (scene-state.ts/.schema.json) regenerated via graphlink_island_codegen.py --write.

Test plan

  • backend/tests/test_canvas.py: new intent test (default False, setter flips + republishes)
  • SceneCanvas.test.tsx: 4 new toFlowEdges unit tests (no-op when disabled regardless of hover, fades all-but-hovered when enabled, fades everything when nothing is hovered, docked-node edge suppression still holds independent of fade state)
  • ViewPopover.test.tsx (new file): the new checkbox reflects state and calls the right store method — ViewPopover.tsx had zero prior test coverage; this intentionally covers only the new control, not a full backfill
  • Full verification: 865 backend / 1112 frontend tests passing, typecheck/lint/build clean, codegen confirmed in sync, Qt-free burn-down gate unchanged
  • One right-sized adversarial review (backend/frontend/integration) — zero confirmed defects
  • Live-verified in an actual browser against a real running backend (not just automated tests): started a real create_app() instance (isolated scratch settings/chat-db so the real ~/.graphlink/session.dat is never touched) plus the real Vite dev server, drove real nodes/edges into the live scene over the actual WebSocket protocol, and confirmed on the real rendered SVG:
    • toggling Fade Connections on sets the edge path's computed style to exactly opacity: 0.08
    • hovering the edge clears the override; un-hovering restores it
    • the real "Fade Connections" checkbox in the real View popover (not a raw WS call) correctly reflects and toggles the live state end-to-end

Ports the legacy scene's faded-connections toggle into the React Flow
canvas - the first (smallest) of R7.5's 3 remaining canvas-visual
parity gaps. When enabled, every connection dims to the legacy's exact
0.08 opacity except the one currently under the mouse.

Same bare-bool/"scene"-topic shape as the existing snap-to-grid
setting; the intent name matches the legacy GridControlBridge's own
Slot name 1:1. Legacy's dead is_selected stay-bright branch (confirmed
never set True anywhere in the Qt codebase) is deliberately not
ported - hover is the only exemption.
@dovvnloading
dovvnloading merged commit b6b6681 into main Jul 26, 2026
2 checks passed
@dovvnloading
dovvnloading deleted the qt-removal/r7-5b1-faded-connections branch July 26, 2026 17:56
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