Skip to content

feat: sync agent-created MCP workspaces into the GUI#11

Merged
anbturki merged 2 commits into
mainfrom
feat/registry-gui-sync
Jul 3, 2026
Merged

feat: sync agent-created MCP workspaces into the GUI#11
anbturki merged 2 commits into
mainfrom
feat/registry-gui-sync

Conversation

@anbturki

@anbturki anbturki commented Jul 3, 2026

Copy link
Copy Markdown
Owner

The app displayed only user-added roots and ignored the MCP server's workspace registry (~/.docsreader/workspaces.json), so workspaces an agent created (e.g. the default ~/notes, or project-scoped folders) were invisible until added by hand - the app looked empty even though agents had written docs.

What changed

  • New Tauri commands list_registry_workspaces and registry_dir over the existing docsreader-core registry loader; a core existing_workspaces filter drops entries whose directory no longer exists so a deleted workspace never shows as a broken empty root.
  • useLibrary sync: merges registry workspaces into the sidebar on launch, live-watches the registry directory (plus a window-focus fallback) so agent-created workspaces appear without a restart, selects the first when the app was empty, and remembers dismissals so a removed workspace stays gone.
  • Concurrency hardening: an authoritative roots ref and serialized store writes prevent concurrent reconcile/add/remove from dropping an entry; dismissals are recorded only for actual registry workspaces, not manually added folders.

Tests

  • Rust: existing_workspaces filter; registry loader present/absent/malformed.
  • Frontend: reconcile adds to an empty app and selects the first, keeps stored roots, skips dismissed, does not steal an existing active root, records a dismissal only for synced workspaces.

Full suite green: 98 Rust tests, 43 frontend tests, clippy -D warnings, tsc clean.

anbturki added 2 commits July 3, 2026 17:00
Add list_registry_workspaces and registry_dir Tauri commands over the
existing docsreader-core registry loader, plus an existing_workspaces
filter that drops entries whose directory is gone so a deleted workspace
never surfaces as a broken empty root. Deduplicate home-dir resolution
behind a helper.
The GUI showed only user-added roots and ignored workspaces the MCP
server created, so agent-written docs were invisible until the folder
was added by hand. useLibrary now merges registry workspaces on launch,
live-watches the registry directory (with a window-focus fallback) so
new ones appear without a restart, selects the first when the app was
empty, and remembers dismissals so a removed workspace stays gone.

Registry reads run through an authoritative roots ref and serialized
store writes so concurrent reconcile/add/remove cannot drop an entry;
dismissals are recorded only for actual registry workspaces.
@anbturki anbturki merged commit e626a52 into main Jul 3, 2026
2 checks passed
@anbturki anbturki deleted the feat/registry-gui-sync branch July 3, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant