Settings: offer to copy existing captures when the capture library moves#1360
Open
r3dbars wants to merge 1 commit into
Open
Settings: offer to copy existing captures when the capture library moves#1360r3dbars wants to merge 1 commit into
r3dbars wants to merge 1 commit into
Conversation
Picking a new capture library folder used to just flip the pref and rewrite mcp-directories.json, silently stranding every saved meeting and dictation in the old folder where the app, MCP helper, and agents no longer look. Now, when the current library still holds captures, Settings asks before switching: copy them to the new folder (default, copy-only, skip-on-collision, originals never deleted), just switch with an honest note that captures stay behind, or cancel. The copy runs off the main actor with inline progress/completion status in the Storage section; on any copy error the pref is not switched and the status names the old path. Successful switches broadcast a library-wide change so Home re-resolves. Decision and copy-plan logic lives in the new CaptureLibraryMigrationPlanner (Sources/Support/) with fast tests registered in Tests/FastTests.manifest and the runner's APP_SOURCES. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GuGZaFRmNrqfGPpqf7WH4n
11 tasks
Owner
Author
|
Merge-room hold: draft plus storage/UI migration proof is incomplete. Live state checked 2026-07-02: head |
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.
Why
Changing the capture library in Settings only rewrites the preference and
mcp-directories.json— existing meetings and dictations silently stay in the old folder, where the app, the MCP helper, and any connected agent no longer look. Users believe they moved their library; their history effectively disappears from every agent surface. Found in the agent-surface audit.Product Impact
meetings/dictation/agent artifactsagent workflowWhat changed
Sources/Support/CaptureLibraryMigrationPlanner.swift: pure, FileManager-injected planner —libraryHasCaptures(at:),makePlan(from:to:),copy(_:onProgress:). Enumeratesmeetings/*.md(incl..summary.mdsidecars),meetings/audio/*_audio/dirs, anddictations/*.md. Copies never overwrite (skip-with-count on collisions, re-checked at copy time) and never delete originals.TranscriptedSettingsView.swift: when the chosen folder differs and the old library still has captures, a three-way alert — Copy to New Folder (default), Just Switch (states plainly that captures stay in the old folder and agents will only see the new one), Cancel. Destination validated up front so a bad folder fails before a multi-GB copy. The copy runs off the main actor with an inline progress row; on error the pref is not switched and the status names the old path. Successful switches (copy, just-switch, reset-to-default) now signalCaptureLibraryChangeBroadcasterso Home re-resolves.Tests/CaptureLibraryMigrationPlannerTests.swift(7 suites: detection, plan enumeration, same-folder no-op, collisions at plan and copy time, originals preserved, progress counts, vanished-source error), registered inTests/FastTests.manifest; planner added torun-tests.shAPP_SOURCES.Sources/Support/CLAUDE.mdfile list updated.Deliberately not touched:
docs/storage-paths.mdwording (owned by #1356; needs a one-line follow-up to mention the copy offer after both merge).How I checked it
scripts/dev/agent-preflight.sh(pluspython3 scripts/dev/check-build-source-lists.py,bash -non both test-runner scripts, manifest/Tests-dir sync check).agents/test-matrix.yml—Sources/**rulebash build.sh --no-open(incl. launch smoke + bundle gate) andbash run-tests.sh(incl. the new planner tests) — run by Swift CI on macOS at this exact head (9b3d282), green: https://github.com/r3dbars/transcripted/actions/runs/28621486036.agent-review/visuals/. CI proves compile + unit behavior but cannot produce dialog evidence.Authoring context: written in a Linux session with no local Swift toolchain; build/test verification is the green macOS Swift CI run above.
Risk Review
.agent-review/visuals/evidence — pending the manual Mac pass aboveNotes
Part of the agent-surface audit series (#1356–#1359). Known edge: if the copy succeeds but
setCaptureLibraryURLthen fails (racing FS change), the user gets the existing folder-error alert with copies already made — harmless (copy-only) but noted. "Just Switch" and reset-to-default now also broadcast a library-wide change so Home refreshes; small intentional behavior addition.Agent handoff
COORD_DONE: BRIEF | (this PR) | relocation now offers capture copy + honest just-switch | none | none | Swift CI green at head 9b3d282 (build + fast tests) | manual dialog pass + screenshots on a Mac, then mark ready🤖 Generated with Claude Code
https://claude.ai/code/session_01GuGZaFRmNrqfGPpqf7WH4n