-
-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: added /export comment to export self-contained HTML file built from webui #235
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Changes requested. Reviewed everything up to cb9bea6 in 40 seconds
More details
- Looked at
223
lines of code in3
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. gptme/export.py:8
- Draft comment:
Thereplace_or_fail
function is a good practice to ensure that the HTML structure is as expected. However, ensure that the error message provides enough context for debugging. - Reason this comment was not posted:
Confidence changes required:50%
Thereplace_or_fail
function is used to ensure that specific HTML elements are replaced in the template. However, if the template changes and the expected elements are not found, this will raise an error. This is a good practice to ensure that the HTML structure is as expected.
2. gptme/commands.py:152
- Draft comment:
Ensure thatmanager.undo(1, quiet=True)
is necessary for the/export
command. It might not be needed if the command itself doesn't alter the log in a way that needs undoing. - Reason this comment was not posted:
Confidence changes required:50%
Thehandle_cmd
function usesmanager.undo(1, quiet=True)
before executing commands. This is likely intended to undo the command itself from the log, but it might not be necessary for all commands.
Workflow ID: wflow_lhAvWB9cr5T3qCU2
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
@@ -244,6 +258,12 @@ new Vue({ | |||
}, | |||
mdToHtml(md) { | |||
// TODO: Use DOMPurify.sanitize |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using DOMPurify.sanitize
to sanitize HTML content before rendering to prevent XSS vulnerabilities.
// TODO: Use DOMPurify.sanitize | |
return DOMPurify.sanitize(html); |
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #235 +/- ##
==========================================
- Coverage 74.54% 73.89% -0.66%
==========================================
Files 58 59 +1
Lines 3677 3719 +42
==========================================
+ Hits 2741 2748 +7
- Misses 936 971 +35
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Replaces #105
Closes #32
Re-uses the web UI so that we maximize code reuse
In the future, we should also embed images/media from the conversation. Possibly by base64 encoding (downscaled?) versions into messages.
Important
Adds
/export
command to export chat logs as standalone HTML files, with updates to handle embedded data in JavaScript./export
command incommands.py
to export chat logs as standalone HTML files usingexport_chat_to_html()
.export.py
module for exporting chat logs to HTML, embedding chat data and styles directly into the HTML.main.js
to check forwindow.CHAT_DATA
and handle embedded chat data for exported HTML files.mdToHtml()
inmain.js
to unescape HTML entities before processing markdown.This description was created by for cb9bea6. It will automatically update as commits are pushed.