Skip to content

feat: add JSON export/import for session backup#3705

Open
30BTW wants to merge 6 commits into
chatboxai:mainfrom
30BTW:feature/json-export-import
Open

feat: add JSON export/import for session backup#3705
30BTW wants to merge 6 commits into
chatboxai:mainfrom
30BTW:feature/json-export-import

Conversation

@30BTW

@30BTW 30BTW commented May 6, 2026

Copy link
Copy Markdown

Summary

This PR adds JSON export and import functionality for individual chat sessions, allowing users to backup and restore complete conversation data.

Features Added

Export:

  • Added "JSON" format option in the export dialog
  • Exports complete session data including messages, settings, and threads
  • Generated files use .chatbox.json extension for easy identification

Import:

  • Added "Import Session" section in Settings → General
  • Supports importing .chatbox.json files
  • Automatically generates new IDs to avoid conflicts
  • Shows success/error feedback after import

Technical Details

  • Added SessionExportData interface with version control for future compatibility
  • Implemented exportSessionAsJson() and importSessionFromJson() functions
  • Import properly triggers UI refresh using updateSessionList()
  • Added i18n support for both English and Chinese

File Changes

  • src/shared/types.ts - Added type definitions and version constant
  • src/renderer/stores/sessionHelpers.ts - Core export/import logic
  • src/renderer/modals/ExportChat.tsx - Added JSON format option
  • src/renderer/routes/settings/general.tsx - Added import UI
  • src/renderer/i18n/locales/en/translation.json - English translations
  • src/renderer/i18n/locales/zh-Hans/translation.json - Chinese translations

Export File Format

{
  "__version": 1,
  "__exported_at": "2026-05-06T17:35:04.791Z",
  "__source": "chatbox",
  "session": { ... }
}

Test Plan

  • Export session as JSON file
  • Verify JSON file contains complete session data
  • Import JSON file and verify session appears in list
  • Test ID conflict handling (imported sessions get new IDs)
  • Test version compatibility check
  • Test with both English and Chinese UI

- Add JSON format option to export dialog for full session data backup
- Add import session feature in Settings > General
- Exported JSON includes version, timestamp, and complete session data
- Imported sessions get new IDs to avoid conflicts
- Support both English and Chinese translations
@coderabbitai

coderabbitai Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: edd42cf0-c1ee-436a-9ab3-847de5dcaefd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

lkbtw and others added 5 commits May 11, 2026 22:14
- Add Import Chat menu item to toolbar for easier access
- Fix imported session to appear at top of list (not starred)
- Fix welcome card not hiding after login (return 'none' instead of null)
- Add translations for Import Chat in English and Chinese
- Add parallel output: generate multiple responses sequentially, display side-by-side for comparison, user can accept one
- Add branch output: create new conversation from any message point
- Add settings for parallel output count and interval
- Add debug logs for troubleshooting parallel output display issues
- Add parallel output handling to home page (index.tsx) handleSubmit
- Fix horizontal scrolling for parallel output cards on narrow windows
- Disable TanStack Router autoCodeSplitting to fix Vite caching issues
- Add deploy-to-local.ps1 script for quick local deployment
- Force Windows userData path to xyz.chatboxapp.app to preserve existing chat data
- Disable Windows code signing (sign: null) to fix build failures behind GFW
- Change release app name/productName to match original Chatbox app
- Add getAllStoreKeys IPC handler in main process
- Add try-catch for getAllStoreKeys IPC call in renderer
- Add orphaned session recovery logic in init_data.ts
- Make initData non-blocking in migration to prevent IndexedDB hang from blocking UI

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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