Repository navigation
fix: support browser chat archive transfer and home paths - #741
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
What Changed
Browser Settings now accepts an archive folder path and hides the unavailable native export-directory picker. Empty paths disable import; invalid paths retain the existing error feedback. Desktop folder selection stays inside the error/busy-state guard.
Reuse
expandHomePathfor archive writes, reads, and the imported project's workspace metadata. Extend the existing round-trip regression to cover absolute and home-relative paths, and document which machine owns these paths.Why
Without a desktop bridge, importing silently returned without selecting a folder. The suggested
~/t3-chat-exportspath also failed bulk export. Expanding paths only when reading the archive left imported projects pointing at a nonexistent literal~directory; the real-client pass caught that remaining surface.Validation:
pnpm --filter t3 exec vp test run src/orchestration/chatArchive.test.ts src/orchestration/decider.chatArchive.test.ts src/pathExpansion.test.ts— passed, 16 tests. The added home-relative case first failed with the originalENOENT.pnpm lint— passed, with existing warnings.pnpm typecheck— passed.pnpm exec vp fmt --check README.md apps/server/src/orchestration/chatArchive.ts apps/server/src/orchestration/chatArchive.test.ts apps/server/src/ws.ts apps/web/src/components/settings/SettingsPanels.tsx— passed.pnpm fmt:check— failed on six unchanged baseline files:bench-packaged-startup.mjs,ProviderCommandReactor.test.ts,ChatMarkdown.browser.tsx,ChatView.browser.tsx,MessagesTimeline.browser.tsx, andMessagesTimeline.perf.bench.test.ts.pnpm test— failed on 11 existingapps/web/src/localApi.test.tscases whose RPC fixture omitsstorage.getUsage. The failing test,environmentApi.ts, andlocalApi.tsare unchanged by this PR.UI Changes
Tested revision:
1cf9a1b5a939b9411629a3cda0ad6d2341d4765f, in a worktree-isolated development environment.Created two chats with real Copilot replies (
ALPHA-7412,BRAVO-9931), exported them through Settings using a~/directory, actually deleted both originals through the live CLI, then imported the exported folder through the browser path input without a picker stub. Production CLI reads and an assert-based acceptance check verified both restored chats, all four messages, exact text/roles/order/message timestamps, preserved models/modes/creation dates, fresh IDs, and the correctly expanded reference-only workspace path. The restored conversation and reference-only banner were also checked in the browser.Whitespace paths disable import; a missing archive produces the error toast. Picker pending, cancellation, and rejection recovery were exercised with a temporary native-dialog dependency stub; an actual OS folder dialog was not tested.
The final stable feature pass had no new console errors or failed requests. An earlier attempt during the backend watcher restart produced 502/reconnect diagnostics and was discarded; the browser was reloaded before repeating the pass. Before/after Settings screenshots, the restored conversation, and a recording of the successful final import are published below.
Checklist
Feature captures
PR head at upload:
1cf9a1b5a939b9411629a3cda0ad6d2341d4765f. See the testing notes for exercised behavior and limitations; uploading media is not a test result.chat-transfer-import.webm
chat-transfer-import.webm