Add option to export single conversation#2
Open
krystof-k wants to merge 12 commits intolevysoft:mainfrom
Open
Conversation
- 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
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.
No description provided.