jabref icon indicating copy to clipboard operation
jabref copied to clipboard

feat(ai): Add Markdown and JSON export buttons to AI Summary and Chat tabs

Open CXZHANG0508 opened this issue 3 weeks ago • 6 comments

Closes #13868

Implemented the export functionality for AI Summary and AI Chat as requested. Users can now save the content to Markdown (human-readable) or JSON (machine-readable, OpenAI format). Added an export menu button to the UI and handled the file saving logic.

Steps to test

  1. Open an entry that has a citation key and a linked PDF. I tested the UI logic in a simulated local environment (since I don't have an AI API key)

  2. Go to the AI Summary or AI Chat tab. image

  3. Even without an API key (interface might show an error), you should see the new Export button (floppy disk icon) in the toolbar. In the AI Summary tab, the Export button is only visible after a summary has been successfully generated.

屏幕截图 2025-12-01 104756 屏幕截图 2025-11-30 194147
  1. Click the button and select Export to Markdown or Export to JSON. 屏幕截图 2025-12-01 104854
  2. Save the file and verify the content:
    • Markdown: Should contain the BibTeX source and the text.
    • JSON: Should contain metadata and a conversation list compatible with OpenAI format.
    • I confirmed that clicking the Export button correctly triggers the 'Save As' file dialog and generates the file with the expected structure.

Mandatory checks

  • [x] I own the copyright of the code submitted and I license it under the MIT license
  • [x] I manually tested my changes in running JabRef (always required)
  • [ ] I added JUnit tests for changes (if applicable)
  • [x] I added screenshots in the PR description (if change is visible to the user)
  • [x] I described the change in CHANGELOG.md in a way that is understandable for the average user (if change is visible to the user)
  • [ ] I checked the user documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request updating file(s) in https://github.com/JabRef/user-documentation/tree/main/en.

CXZHANG0508 avatar Dec 01 '25 14:12 CXZHANG0508

@CXZHANG0508 Please do not close PRs and open new ones. Just push changes to your branch.

koppor avatar Dec 01 '25 14:12 koppor

Understood, thanks!

CXZHANG0508 avatar Dec 01 '25 15:12 CXZHANG0508

Hi, thanks for your contribution.

Please use a proper PR title. "Feat ai export" is not enough to quickly understand from the table what this PR is about. Remember that in open source you occansionally happen to work with other people together and as long as we dont have the technology for mind sharing and telepathy, we need to keep communicating in a mutual understandable way.

calixtus avatar Dec 02 '25 13:12 calixtus

Thank you for your feedback! I apologize for the previous simple title. I have updated the PR title to be more descriptive.I hope that is clearer.

CXZHANG0508 avatar Dec 02 '25 14:12 CXZHANG0508

See https://github.com/JabRef/jabref/issues/13868#issuecomment-3604371479 why there are two PRs.

koppor avatar Dec 04 '25 14:12 koppor

Apologies for the oversight, it was a careless mistake on my part.Now I had fixed it.

CXZHANG0508 avatar Dec 12 '25 11:12 CXZHANG0508

Moreover, consistency please!!

image image

Export always right - as in AI summary

koppor avatar Dec 12 '25 12:12 koppor

JUnit tests of jablib are failing. 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 / Unit tests (pull_request)" and click on it.

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.

jabref-machine avatar Dec 13 '25 14:12 jabref-machine