-
Notifications
You must be signed in to change notification settings - Fork 99
Description
Add an export capability for conversations directly from the Chats experience. Users can export one or multiple conversations through the ellipse menu. A multi step modal wizard guides users through selecting conversations, choosing export format, selecting output packaging, and downloading the final file.
This enables users to archive, share, or externally analyze chat history in JSON or Markdown format with optional file content inclusion.
Problem Statement
Currently there is no native way to export conversations from SimpleChat. Users must rely on manual copy or external tooling, which is inefficient for multi conversation workflows, auditing, or offline analysis.
Proposed Solution
Introduce a multi conversation export workflow triggered from the ellipse menu in Chats.html. Support single conversation export and multi select export via sidebar selection mode. Provide a guided modal wizard to configure export options and generate downloadable files.
User Experience
Entry Points
- Ellipse menu on each conversation includes Export option for single conversation
- Sidebar multi select mode enables Export Selected action button
Modal Wizard Steps
Step 1:
List selected conversations
Show title, last updated timestamp, and message count
Step 2:
Select export format
- JSON
- Markdown
Optional checkbox - Exclude file content
Step 3:
Select output packaging
- Single combined file
- One file per conversation archived as zip
Step 4:
Progress and download
- Progress indicator
- Status messages
- Download button
- Close button
Admin Configuration
Add new system setting to control export limits.
Setting:
max_export_conversations
Default 25
Range 1 to 100
Exposed in Admin Settings General tab under System Settings.
Backend API
Endpoint:
POST /api/conversations/export
Request:
{
"conversation_ids": ["id1", "id2", "..."]
}Validation:
- Enforce max_export_conversations limit
- Return validation error if exceeded
Response:
{
"conversations": [...],
"messages": {
"conversation_id": [...]
}
}Include full message metadata:
- thread_info
- user_info
- token_usage
- roles including user, assistant, file, image
Frontend Implementation Plan
Based on proposed Copilot implementation plan.
- Add
max_export_conversationstofunctions_settings.py - Add admin UI number input in
admin_settings.html - Wire setting in
route_frontend_admin_settings.py - Add export modal HTML to
chats.html - Bundle JSZip locally under
static/js/libs/jszip.min.js - Create
static/js/chat/chat-export.js- Modal stepper controller
- Fetch conversation metadata
- Execute export workflow
- Generate filenames
- Add Export option to ellipse dropdown in
chat-sidebar-conversations.js - Add Export Selected button in
_sidebar_nav.htmland_sidebar_short_nav.html - Add backend export API endpoint
Format Details
JSON
- Full structured export of conversations and messages
Markdown
- Conversation headers
- Messages formatted with role labels
- Preserve thread relationships via thread_id references
Progress and Error Handling
- Step 4 shows progress states
- Fetching conversations
- Generating files
- Creating archive
- Partial failure handling
- List failed conversation IDs
- Allow download of successful exports
Plan: Multi-Conversation Export Modal Feature
Add a multi-step export wizard allowing users to export conversations with all messages (including file content), with admin-configurable limit (default 25), local JSZip bundling, and JSON/Markdown format options.
Steps
-
Add
max_export_conversationssetting to functions_settings.py- Add
'max_export_conversations': 25todefault_settingsdict (around line 50, near other limit settings likeconversation_history_limit) - Setting allows values 1-100, default 25
- Add
-
Add export limit UI to admin_settings.html General tab
- Add "Conversation Export" card after
#system-settings-sectionin#generaltab (around line 1408) - Include number input with id
max_export_conversations, min=1, max=100, default=25 - Add descriptive text explaining the limit applies to multi-conversation export
- Add "Conversation Export" card after
-
Update route_frontend_admin_settings.py to handle the setting
- Add default check in GET handler:
if 'max_export_conversations' not in settings: settings['max_export_conversations'] = 25 - Add form extraction in POST handler:
max_export_conversations = int(form_data.get('max_export_conversations', 25)) - Include in
new_settingsdict construction
- Add default check in GET handler:
-
Add Export Modal HTML to chats.html
- Create 4-step wizard modal
#export-conversations-modalafter existing modals (around line 720) - Step 1: List selected conversations (title, last_updated, message count indicator)
- Step 2: Format selection (JSON/Markdown radios) + "Exclude file content" checkbox
- Step 3: Output type (Single file / Zip archive with one file per conversation)
- Step 4: Progress bar, status text, download button, close button
- Create 4-step wizard modal
-
Bundle JSZip locally at
static/js/libs/jszip.min.js- Download JSZip 3.10.1 from GitHub releases
- Add
<script src="/static/js/libs/jszip.min.js"></script>to chats.html before chat scripts
-
Create
static/js/chat/chat-export.jsmodule- Implement
ExportModalStepperclass withcurrentStep,selectedIds,format,excludeFileContent,outputTypestate - Step navigation methods:
nextStep(),prevStep(),goToStep(),updateStepIndicator() populateStep1(): fetch conversation metadata, display list with titles/datesexecuteExport(): call API, generate content, handle progress, trigger download- Generate filenames as
simplechat_export_YYYY-MM-DD_HHmmss.json|md|zip - Expose via
window.chatExport = { openExportModal, addConversationToExport }
- Implement
-
Add "Export" option to ellipse menu in chat-sidebar-conversations.js
- Add
<li><a class="dropdown-item export-btn"><i class="bi bi-download me-2"></i>Export</a></li>to dropdown menu - Handle click: open export modal with single conversation pre-selected
- Add "Export Selected" button
#sidebar-export-selected-btnto#conversations-actionsdiv
- Add
-
Update sidebar templates for export button
- In _sidebar_nav.html add export button in
#conversations-actions - In _sidebar_short_nav.html add matching export button
- In _sidebar_nav.html add export button in
-
Create backend API endpoint
POST /api/conversations/export- Add route in
route_api_conversations.pyor appropriate API routes file - Accept
{ conversation_ids: string[] }, validate againstmax_export_conversationssetting - Return
{ conversations: [...], messages: { [conversation_id]: [...] } } - Include full message metadata:
thread_info,user_info,token_usage, all roles (user,assistant,file,image)
- Add route in
Further Considerations
-
Format details: JSON exports full structure; Markdown uses headers for conversations with message content formatted as blockquotes/code blocks. Thread relationships preserved via
thread_idreferences. -
Progress tracking: Step 4 shows "Fetching conversation X of Y..." then "Generating files..." then "Creating archive..." for zip output.
-
Error handling: If any conversation fails to fetch, show partial success with list of failed IDs and option to download successful ones.
Sub-issues
Metadata
Metadata
Assignees
Labels
Type
Projects
Status