Skip to content

fix: support browser chat archive transfer and home paths - #741

Merged
ronak-guliani merged 1 commit into
mainfrom
t3code/address-review-thread
Oct 8, 2026
Merged

ronak-guliani merged 1 commit into
mainfrom
t3code/address-review-thread

Conversation

@ronak-guliani

@ronak-guliani ronak-guliani commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

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 expandHomePath for 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-exports path 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 original ENOENT.
  • 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, and MessagesTimeline.perf.bench.test.ts.
  • pnpm test — failed on 11 existing apps/web/src/localApi.test.ts cases whose RPC fixture omits storage.getUsage. The failing test, environmentApi.ts, and localApi.ts are 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

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

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-before.png

chat-transfer-after.png

chat-transfer-restored.png

chat-transfer-import.webm

chat-transfer-import.webm

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Oct 8, 2026
@ronak-guliani
ronak-guliani merged commit 8f87557 into main Oct 8, 2026
5 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant