Fix #13868 — Export AI conversations & summaries to Markdown/JSON#14501
Fix #13868 — Export AI conversations & summaries to Markdown/JSON#14501Shubh03-m wants to merge 6 commits into
Conversation
|
Hey @Shubh03-m! 👋 Thank you for contributing to JabRef! We have automated checks in place, based on which you will soon get feedback if any of them are failing. After all automated checks pass, a maintainer will also review your contribution. Once that happens, you can go through their comments in the "Files changed" tab and act on them, or reply to the conversation if you have further inputs. Please re-check our AI Usage Policy to ensure that your pull request is in line with it. It also contains links to our contribution guide in case of any other doubts related to our contribution workflow. |
|
Your code currently does not meet JabRef's code guidelines. We use Checkstyle to identify issues. You can see which checks are failing by locating the box "Some checks were not successful" on the pull request page. To see the test output, locate "Source Code Tests / Checkstyle (pull_request)" and click on it. In case of issues with the import order, double check that you activated Auto Import. You can trigger fixing imports by pressing Ctrl+Alt+O to trigger Optimize Imports. Please carefully follow the setup guide for the codestyle. Afterwards, please run checkstyle locally and fix the issues, commit, and push. |
| } | ||
|
|
||
| private String generateMarkdownExport(BibEntry entry) { | ||
| StringBuilder markdown = new StringBuilder(); |
There was a problem hiding this comment.
Use StringJoiner to add \n automatically.
There was a problem hiding this comment.
Even better - use a Markdown library: https://github.com/commonmark/commonmark-java#render-to-markdown
|
Your code currently does not meet JabRef's code guidelines. IntelliJ auto format covers some cases. There seem to be issues with your code style and autoformat configuration. Please reformat your code (Ctrl+Alt+L) and commit, then push. In special cases, consider using |
|
JUnit tests of You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide. |
| // implementation("org.openjfx:javafx-controls") | ||
| // implementation("org.openjfx:javafx-fxml") | ||
| // implementation("org.openjfx:javafx-graphics") | ||
| implementation("com.google.code.gson:gson:2.10.1") |
There was a problem hiding this comment.
We should already have GSON defined in versions gradle
|
PR supersed by #14486 |
Closes #13868
This PR implements export functionality for AI Chat conversations and AI Summaries, allowing users to save the generated content in both Markdown (.md) and JSON (.json) formats. The feature improves usability by enabling users to store, review, and reuse AI-generated text outside JabRef. Export buttons were added to the relevant UI components, and formatting + error handling were implemented on the backend.
Steps to test
Open JabRef in your IDE and run the application.
Navigate to the AI Chat view.
Create a test conversation or generate AI output.
Click the newly added Export button.
Choose either Markdown or JSON format.
Verify that:
The exported Markdown file contains clean, human-readable text.
The exported JSON file contains structured data representing the conversation.
Repeat the steps in the Summary view.
Confirm that success or error notifications appear appropriately.
Mandatory checks