Skip to content

Collections sidebar should reactively update when member_of relationships change #832

Closed

Description

@malibio

Summary

The Collections sidebar doesn't automatically refresh when new collections are created or when nodes are added to collections via MCP or other external sources.

Current Behavior

  • Events for member_of relationship changes are received in tauri-sync-listener.ts and browser-sync-service.ts
  • These events are only logged, not acted upon:
    } else if (rel.relationshipType === 'member_of') {
      // Collection membership - currently just log, could update collection state if needed
      log.debug(\`Member added: \${rel.fromId} to collection \${rel.toId}\`);
    }
  • User must manually click on Collections to trigger a refresh

Expected Behavior

  • When a member_of relationship is created/deleted, the collections sidebar should automatically update
  • New collections should appear immediately
  • Member counts should update in real-time

Technical Approach

  1. In tauri-sync-listener.ts (line ~140) and browser-sync-service.ts (line ~274):

    • Import collectionsData from $lib/stores/collections
    • On member_of relationship created: call collectionsData.loadCollections()
    • Optionally: if the target collection is currently selected, also refresh its members
  2. Consider debouncing if many relationships are created in quick succession (like during bulk imports)

Files to Modify

  • packages/desktop-app/src/lib/services/tauri-sync-listener.ts
  • packages/desktop-app/src/lib/services/browser-sync-service.ts

Discovered During

Issue #770 - Documentation import created 30+ collections but sidebar didn't update until manually refreshed.

Activity

  1. added
    enhancement
    on Jan 26, 2026
  2. malibio commented on Jan 26, 2026

    @malibio
    CollaboratorAuthor

    Test Baseline (Pre-Implementation)

    Frontend Tests: 3468 passed (102 test files)
    Rust Backend Tests: 722 passed

    Starting implementation of reactive collection sidebar updates.

  3. self-assigned this
    on Jan 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions