Skip to content

Investigate multi-tab/pane reactivity with LIVE SELECT updates #631

Closed

Description

@malibio

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 $state Map when events fire
  • Does NOT sync updates to SharedNodeStore

SharedNodeStore:

  • Does NOT subscribe to LIVE SELECT events
  • Has subscribeAll() callback that updates _updateTrigger for 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._updateTrigger for SharedNodeStore reactivity

Questions to Investigate

  1. 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() → $state Map updated
    • Does $derived in Tab 2 re-run when ReactiveNodeData Map changes?
  2. 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?
  3. 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?
  4. Browser mode (no LIVE SELECT):

Test Scenarios

Scenario 1: Content Update Propagation

  1. Open 2 tabs, both viewing same date node (e.g., Today)
  2. Tab 1: Edit a node's content, blur
  3. Tab 2: Verify content updates immediately without refresh
  4. Expected: Tab 2 shows new content ✅
  5. Test in both desktop (Tauri) and browser modes

Scenario 2: Structural Change Propagation

  1. Open 2 tabs, both viewing same parent node
  2. Tab 1: Indent a node (make it a child of previous sibling)
  3. Tab 2: Verify hierarchy updates (node moves, chevron appears)
  4. Expected: Tab 2 shows updated structure ✅
  5. Test in both desktop and browser modes

Scenario 3: Cross-Pane Reactivity

  1. Open split panes in same tab
  2. Pane 1: Edit node content
  3. Pane 2: Viewing same node or parent
  4. 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

Activity

  1. self-assigned this
    on Nov 23, 2025
  2. added a commit that references this issue on Nov 23, 2025
    15065ed
  3. added 2 commits that reference this issue on Nov 23, 2025
    64ffda2
    9ec88cf
  4. added 4 commits that reference this issue on Feb 4, 2026
    14efa81
    a1388b1
    d076242
    fa340c2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions