feat: sync agent-created MCP workspaces into the GUI#11
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
list_registry_workspacesandregistry_dirover the existingdocsreader-coreregistry loader; a coreexisting_workspacesfilter drops entries whose directory no longer exists so a deleted workspace never shows as a broken empty root.Tests
existing_workspacesfilter; registry loader present/absent/malformed.Full suite green: 98 Rust tests, 43 frontend tests, clippy
-D warnings, tsc clean.