Skip to content

Add option to export single conversation#2

Open
krystof-k wants to merge 12 commits intolevysoft:mainfrom
krystof-k:claude/add-conversation-export-01UX8V5uLFGAha94UmvJxUJu
Open

Add option to export single conversation#2
krystof-k wants to merge 12 commits intolevysoft:mainfrom
krystof-k:claude/add-conversation-export-01UX8V5uLFGAha94UmvJxUJu

Conversation

@krystof-k
Copy link
Copy Markdown

No description provided.

- Added export button with dropdown menu in content header
- Implemented exportAsMarkdown() function to export conversations as .md files
- Implemented exportAsHTML() function to export conversations as standalone .html files
- Added helper functions for file sanitization and download
- Export button appears when a conversation is selected
- Supports both ChatGPT and Claude conversation formats
- Maintains conversation metadata (title, date, source) in exports
- HTML export respects current dark/light mode theme
- Added getExportStyles() function to dynamically extract CSS from main stylesheet
- Reuses existing CSS classes and variables instead of duplicating styles
- Automatically inherits dark mode styles when applicable
- Reduces code duplication and improves maintainability
- Remove currentChatData global variable
- Store chatData globally as window.chatData
- Use data-chat-id attribute on export button to track selected chat
- Simplify CSS export by copying styles directly instead of regex parsing
- More maintainable and easier to understand
- Read CSS directly from the document's <style> tag
- Extract only the rules needed for message display
- No more hardcoded CSS values in JavaScript
- Remove all CSS parsing/extraction logic
- Just copy the entire content of the style tag directly
- Much simpler and always in sync with the app
- Use existing formatMessage function directly for HTML export
- Eliminates code duplication
- Ensures consistent message formatting across app and exports
- Extract formatMessage from processData function scope
- Make it globally accessible so exportAsHTML can use it
- Remove duplicate formatMessage definition from within processData
- Clone the rendered content-header and chat-content from the page
- Remove interactive elements (share, export buttons) from export
- Reuse exact same HTML structure and styling as the app
- Ensures exported HTML looks identical to browsing view
- Much more DRY - no duplicate HTML generation
- Remove only share button, keep title in header
- Remove entire right-side div with export/link buttons
- Add date next to title in header when available
- Date displayed in lighter color as metadata
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.

2 participants