Skip to content

Add right-click option to delete custom BST styles for entry preview#14628

Merged
calixtus merged 13 commits into
JabRef:mainfrom
TimeTriggerx:feature/remove-custom-bst-v2
Dec 19, 2025
Merged

Add right-click option to delete custom BST styles for entry preview#14628
calixtus merged 13 commits into
JabRef:mainfrom
TimeTriggerx:feature/remove-custom-bst-v2

Conversation

@TimeTriggerx

@TimeTriggerx TimeTriggerx commented Dec 15, 2025

Copy link
Copy Markdown
Contributor

Closes #14352

Added a context menu option to the "Entry Preview" preferences tab to remove custom BST styles. This allows users to delete styles they have added. I also updated BstPreviewLayout to store the file path so the removal persists after a restart.

Steps to test

  1. Open JabRef and navigate to Options > Preferences > Entry Preview.
  2. Click the folder icon to add a custom BST file.
  3. Right-click the newly added style in the list.
  4. Click Remove.
  5. Verify the style disappears.
  6. Restart JabRef and confirm the style is still gone.
Screenshot 2025-12-16 012418

Mandatory checks

  • I own the copyright of the code submitted and I license it under the MIT license
  • I manually tested my changes in running JabRef (always required)
  • [/] I added JUnit tests for changes (if applicable)
  • I added screenshots in the PR description (if change is visible to the user)
  • 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.

@github-actions github-actions Bot added good first issue An issue intended for project-newcomers. Varies in difficulty. status: changes-required Pull requests that are not yet complete labels Dec 15, 2025
};

dialogService.notify(message);
dialogService.notifyAll(message);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong! This is a bug in openrewrite

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have just pushed a commit that reverts those accidental changes and ensures only the relevant files for this feature (PreviewTab, PreviewTabViewModel, and BstPreviewLayout) are modified. The checkstyle issues in PreviewTab.java should also be resolved now.

String message = Localization.lang("Error creating email");
LOGGER.warn(message, e);
dialogService.notify(message);
dialogService.notifyAll(message);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert this is a bug in openrewrite

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Siedlerchr!

The rewriteDryRun CI check is still failing because OpenRewrite wants to apply automated refactoring across the codebase.

When I run ./gradlew rewriteRun locally, it completes successfully but introduces changes like notify() → notifyAll() (which you mentioned earlier are bugs in OpenRewrite that I should revert).

Should I:

Ignore the failing rewriteDryRun check for now since it's a project-wide issue unrelated to my changes?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue was fixed some months ago - see openrewrite/rewrite-static-analysis#580.

I now don't see any issue here. Not sure what caused it to be solved.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems the tool might still have this issue locally for me. I manually reverted the notifyAll change to fix the build. The PR is now clean and all checks are passing.

@github-actions github-actions Bot added status: changes-required Pull requests that are not yet complete and removed status: changes-required Pull requests that are not yet complete labels Dec 15, 2025
@TimeTriggerx TimeTriggerx requested a review from koppor December 17, 2025 12:28
koppor
koppor previously requested changes Dec 19, 2025
Comment thread CHANGELOG.md Outdated

### Added

- We added a right-click option to delete custom BST styles in the entry preview. [#14628](https://github.com/JabRef/jabref/pull/14628)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reference the issue.

@github-actions github-actions Bot added the status: changes-required Pull requests that are not yet complete label Dec 19, 2025
@calixtus calixtus added this pull request to the merge queue Dec 19, 2025
Merged via the queue into JabRef:main with commit 8860b47 Dec 19, 2025
49 checks passed
@TimeTriggerx TimeTriggerx deleted the feature/remove-custom-bst-v2 branch December 20, 2025 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: entry-preview component: preferences good first issue An issue intended for project-newcomers. Varies in difficulty.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add right click option to delete custom bst style for entry preview

4 participants