Repository navigation
Closed as not planned
Description
Schema-Driven Relationship UI Components
Overview
Implement UI components in the schema-driven property system (BaseNode) to render, create, and manage relationships defined in schema nodes.
Background
Backend Status (Issue #703): ✅ Complete
- Relationships can be defined in schema nodes
- Edge tables are generated via DDL
- CRUD API exists for managing relationships
- Data model supports cardinality, direction, edge fields
Frontend Status: ❌ Missing
- Schema-driven UI renders regular fields (text, number, enum, etc.)
- No UI components exist for relationship fields
- Users cannot view or interact with relationships through the property UI
Example Scenario
Given this schema definition:
{
"id": "task",
"fields": [
{ "name": "status", "type": "enum", "values": ["open", "done"] }
],
"relationships": [
{
"name": "assigned_to",
"targetType": "person",
"cardinality": "many"
}
]
}Current behavior:
- ✅
statusfield renders as dropdown with enum values - ❌
assigned_torelationship has no UI representation
Desired behavior:
- ✅
statusfield renders as dropdown with enum values - ✅
assigned_torelationship renders with:- Display of currently assigned people
- UI to add new assignments (search/dropdown)
- UI to remove assignments
Requirements
1. Display Existing Relationships
- Show all current relationships for a node
- Handle both
oneandmanycardinality - Display related node content/title
- Show edge field data (e.g., "assigned on 2025-01-15")
2. Create New Relationships
- Provide search/autocomplete for target nodes
- Filter by target type from schema definition
- Respect cardinality constraints (prevent multiple for "one")
- Support adding edge field data during creation
3. Edit/Remove Relationships
- Allow removing existing relationships
- Support editing edge field data
- Confirm destructive actions
4. UI Patterns to Consider
- Cardinality "one": Dropdown or autocomplete (single selection)
- Cardinality "many": Multi-select with search, tag-style display
- Edge fields: Inline form or modal for additional data
- Reverse relationships: Display only (not editable from this side)
Implementation Phases
Phase 1: Read-Only Display
- Render existing relationships in property UI
- Handle both cardinality types
- Show related node basic info
Phase 2: Basic CRUD
- Add UI to create new relationships
- Add UI to remove relationships
- Simple dropdown/search for target selection
Phase 3: Advanced Features
- Edge field editing
- Reverse relationship display
- Validation and error handling
- Optimistic UI updates
Technical Notes
Schema-Driven UI Location:
- BaseNode component renders properties based on schema
- SchemaPropertyForm or similar component handles field rendering
- Need new relationship-specific renderer component
API Integration:
- Use existing relationship CRUD from Phase 4 of Issue Schema Support for Relational Fields - Architecture Design #703
create_relationship(source_id, relationship_name, target_id, edge_data)delete_relationship(source_id, relationship_name, target_id)get_related_nodes(node_id, relationship_name, direction)
State Management:
- Integrate with existing node state and reactivity
- Handle optimistic updates for better UX
- Sync with backend on success/failure
Dependencies
- Issue Schema Support for Relational Fields - Architecture Design #703 (Schema Relationship Backend) - ✅ Complete
- BaseNode schema-driven property system - ✅ Exists
- Relationship CRUD API (Phase 4 of Schema Support for Relational Fields - Architecture Design #703) - ⏳ Pending
Acceptance Criteria
- Relationship fields render in BaseNode property UI
- Users can view existing relationships
- Users can create new relationships via search/dropdown
- Users can remove existing relationships
- Cardinality constraints are enforced in UI
- Edge fields can be added during relationship creation
- UI updates reactively when relationships change
- Works for both "one" and "many" cardinality
- Comprehensive tests for relationship UI components
Related Issues
- Schema Support for Relational Fields - Architecture Design #703 - Schema Support for Relational Fields (Backend)
Notes
Until this issue is resolved, the DDL generation for relationships is commented out in node_service.rs to avoid creating edge tables that users cannot interact with through the UI.
Metadata
Metadata
Assignees
Labels
No labels
Activity
Clarify relationship UI status with Issue #710
Remove premature #710 UI comments from Phase 3
Phase 4 Complete: Relationship CRUD API (Issue #703)
WIP: Schema Relationship Implementation - Phases 1-4 Complete
Schema Support for Relational Fields - Architecture Design (#708)
Schema Support for Relational Fields - Architecture Design (#708)
Schema Support for Relational Fields - Architecture Design (#708)
Schema Support for Relational Fields - Architecture Design (#708)
malibio commentedon Jul 5, 2026
Architecture-review note: this assumes the edge-table DDL generator, which is being deleted as dead SurrealDB code (#1496 — the SQLite store discards that DDL). Re-scope this against the current SQLite/graph-edge model when picked up.
malibio commentedon Aug 3, 2026
Closing as superseded by #1918 (Relationship viewer: view and manage typed relationships between nodes).
#1918 covers the same goal — surfacing schema-declared typed relationships in the UI — but is scoped against the current SQLite/graph-edge model rather than the SurrealDB one, with verified references:
relationshipedge table —packages/core/src/db/schema.sql:43SchemaRelationship(name, target_type, direction, cardinality, reverse_name, edge_fields) —packages/nodespace-types/src/schema.rs:122packages/core/src/ops/rel_ops.rsRelationshipCache—packages/core/src/services/relationship_cache.rsIt also identifies gaps this issue did not: there is no Tauri command surface for schema-declared relationships (
commands/nodes.rsexposes mention commands only), so the frontend cannot reachrel_opsat all; and cardinality is stored and cached but never enforced on any write path.The July note on this issue already flagged the blocker: this spec assumes the edge-table DDL generator that was deleted as dead SurrealDB code in #1496. Rather than re-scope it, the work continues in #1918.