Repository navigation
Editable relationship modal + dual-mode relationship transport (#1918) - #2002
Merged
Merged
Conversation
Make the relationship viewer modal editable (slices a + c) and route the whole relationship feature through the dual-mode backend-adapter so it works in browser dev mode, not only the packaged Tauri app. Transport (dual-mode): - backend-adapter (+ adapter-core): add getNodeRelationships / createRelationship / deleteRelationship / updateRelationshipProperties / searchNodesByTitle across the Tauri (invoke), Http (fetch), and Mock adapters; HTTP_ROUTES entries; `titleContains` on NodeQuery. RawNodeRelationships imported type-only. - dev-proxy: GET /api/nodes/:id/relationships and method-differentiated POST/DELETE/PATCH /api/relationships forwarding to the gRPC NodeService. - relationship-viewer-service: fetch via backendAdapter (was raw invoke); add addEdge / removeEdge / updateEdgeProperties / searchTargets, with edge orientation centralized in the pure `resolveEdgeEndpoints` (out: source=node, target=other; in: flipped) so mutations hit the correct endpoints from either direction. Modal editing: - Edit/Done toggle. Per row: remove (with a confirm on the last edge of a `required` group) and editable edge-field inputs with a per-row Save. Per group: an Add control with a type-ahead target picker (search by title, filtered to the declared target_type, or paste a UUID) and an edge-field prompt before create. - View model carries relationshipName / required / edgeFields. First-edge support: `rel_ops::get_node_relationships` now emits declared outbound relationship groups even when empty (inbound still only when non-empty); the modal shows empty groups only in edit mode (read mode stays clean) so the first edge of a relationship can be added. datetime edge fields use datetime-local; a successful mutation no longer discards other rows' unsaved drafts. Validated end-to-end against a running daemon (read/update/create/delete round trips, including adding the first edge of an empty relationship). New relationship-orientation test; grouping tests updated for retained empty groups. Co-Authored-By: Claude <[email protected]>
Contributor
Author
|
Adversarial review → addressed → APPROVE. Independent review confirmed the implementation is correct + safe (orientation correct in both directions; no dangling/wrong-typed edge can be persisted — FK-backed; error handling surfaces, not swallowed; reload covers both directions; full Tauri/Http/Mock adapter parity). The one MAJOR finding — the first-edge gap (Add couldn't create the first edge of an empty relationship) — is fixed (declared outbound groups now surface in edit mode). Minors fixed: datetime→datetime-local, unsaved-draft preservation. Live-validated end-to-end (read/update/create/delete + first-edge) against a running daemon; gate green. APPROVE. |
This was referenced Aug 7, 2026
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.
Part of #1918 (relationship viewer) — slices a (editing) + c (target selection), building on the read-only viewer (#1992) and the backend command surface (#1993). Does not close #1918 (slice d, view-settings, remains).
What
Makes the relationship modal editable and routes the whole relationship feature through the dual-mode backend-adapter, so it works in browser dev mode — not only the packaged Tauri app.
Editing (a): Edit/Done toggle. Per row: remove (confirm on the last edge of a
requiredgroup) + editable edge-field inputs with a per-row Save (reusing property-form-style controls). Per group: an Add control with a target picker — type-ahead search by title filtered to the declaredtarget_type, or paste a UUID — and an edge-field prompt before create. Edge orientation is centralized in a pureresolveEdgeEndpointsso mutations hit the correct (source,target) from either direction.First-edge support:
rel_ops::get_node_relationshipsnow emits declared outbound relationship groups even when empty (inbound only when non-empty); the modal shows empty groups only in edit mode (read mode stays clean), so a relationship's first edge can be added.Transport (dual-mode):
backend-adapter(+adapter-core) gainsgetNodeRelationships/createRelationship/deleteRelationship/updateRelationshipProperties/searchNodesByTitleacross the Tauri / Http / Mock adapters;dev-proxygainsGET /api/nodes/:id/relationships+ method-differentiatedPOST/DELETE/PATCH /api/relationships.Validation — live, end-to-end against a running daemon
Every operation exercised in the running app (via an isolated daemon + dev-proxy + Chromium): read (loads edges), update (role edited → PATCH → persisted), create (picker → POST 204), delete (✕ → DELETE 204), and the first edge of an empty relationship (empty group shows Add in edit mode → POST 204). Rust relationship tests pass (38+); a new
relationship-orientationtest + updated grouping tests; svelte-check / eslint / vitest clean; pre-push gate green.Adversarial review → addressed
Independent review confirmed the core is correct + safe (orientation both directions; no dangling/wrong-typed edge possible — FK-backed; errors surface, not swallowed; reload covers both directions; full adapter parity) and flagged the first-edge gap (fixed, above) + minor items: datetime edge fields now use
datetime-local; a successful mutation no longer discards other rows' unsaved drafts. Deferred follow-ups: dev-mode picker-label title, title-null picker search, undeclared-key value coercion.