Repository navigation
Closed
Description
Investigate Multi-Tab Reactivity with LIVE SELECT Updates
Problem
Currently unclear if LIVE SELECT events properly propagate to all tabs/panes viewing the same node.
Current Architecture
ReactiveNodeData:
- Subscribes to LIVE SELECT events (node:created, node:updated, node:deleted)
- Updates its own
$stateMap when events fire - Does NOT sync updates to SharedNodeStore
SharedNodeStore:
- Does NOT subscribe to LIVE SELECT events
- Has
subscribeAll()callback that updates_updateTriggerfor local changes - Source of truth for optimistic updates
BaseNodeViewer:
- Reads from
reactiveNodeData.getNode(id)first (has $state reactivity) - Falls back to
sharedNodeStore.getNode(id)if not in ReactiveNodeData - Depends on
nodeManager._updateTriggerfor SharedNodeStore reactivity
Questions to Investigate
-
Content changes from LIVE SELECT:
- Tab 1 edits node → persisted → LIVE SELECT event fires
- Does Tab 2 (viewing same node) see the update immediately?
- Path: LIVE SELECT → ReactiveNodeData.updateNodeData() →
$stateMap updated - Does
$derivedin Tab 2 re-run when ReactiveNodeData Map changes?
-
Structural changes from LIVE SELECT:
- Tab 1 indents node → edge created → LIVE SELECT edge event fires
- ReactiveStructureTree updates (subscribes to edge:created)
- Does Tab 2's hierarchy view update correctly?
- Do expand chevrons appear/disappear appropriately?
-
SharedNodeStore sync:
- Should ReactiveNodeData sync updates to SharedNodeStore?
- Or is fallback pattern sufficient (ReactiveNodeData first, SharedNodeStore second)?
- What happens if node exists in SharedNodeStore but not ReactiveNodeData?
-
Browser mode (no LIVE SELECT):
- LIVE SELECT doesn't work in browser HTTP mode
- Multiple tabs editing same node - do changes propagate?
- Current: Only via SharedNodeStore._updateTrigger
- Is this sufficient or do we need SSE (Issue Add Server-Sent Events (SSE) for Real-Time Sync in Browser Dev Mode #622)?
Test Scenarios
Scenario 1: Content Update Propagation
- Open 2 tabs, both viewing same date node (e.g., Today)
- Tab 1: Edit a node's content, blur
- Tab 2: Verify content updates immediately without refresh
- Expected: Tab 2 shows new content ✅
- Test in both desktop (Tauri) and browser modes
Scenario 2: Structural Change Propagation
- Open 2 tabs, both viewing same parent node
- Tab 1: Indent a node (make it a child of previous sibling)
- Tab 2: Verify hierarchy updates (node moves, chevron appears)
- Expected: Tab 2 shows updated structure ✅
- Test in both desktop and browser modes
Scenario 3: Cross-Pane Reactivity
- Open split panes in same tab
- Pane 1: Edit node content
- Pane 2: Viewing same node or parent
- Expected: Pane 2 updates immediately ✅
Acceptance Criteria
- Document current reactivity flow (which stores update which)
- Verify content changes propagate across all tabs/panes (desktop mode)
- Verify structural changes propagate across all tabs/panes (desktop mode)
- Identify any gaps in browser mode multi-tab reactivity
- Recommend solution if issues found (SharedNodeStore sync, SSE, or other)
- Add integration tests for multi-tab scenarios
- Update architecture documentation with reactivity flow diagrams
Priority
High - Multi-tab/pane editing is a core use case for NodeSpace
Related Issues
- Add Server-Sent Events (SSE) for Real-Time Sync in Browser Dev Mode #622 - SSE for browser mode sync (may be needed if LIVE SELECT insufficient)
- Delete 15 obsolete services replaced by LIVE SELECT #594 - EventBus deletion (removed old sync mechanism)
Activity
WIP: Browser dev mode fixes complete - Indent lag investigation next
Document multi-tab/pane reactivity investigation (closes #631)
Investigate multi-tab/pane reactivity with LIVE SELECT updates (#637)
Fix: Enter key on child nodes creating sibling at wrong hierarchy lev…
Investigate multi-tab/pane reactivity with LIVE SELECT updates (#637)
Fix: Enter key on child nodes creating sibling at wrong hierarchy lev…
Investigate multi-tab/pane reactivity with LIVE SELECT updates (#637)
Fix: Enter key on child nodes creating sibling at wrong hierarchy lev…
Fix: Enter key on child nodes creating sibling at wrong hierarchy lev…