Fix #15397 invisible delete area for internal CSL styles#15399
Fix #15397 invisible delete area for internal CSL styles#15399Francis-Lee-210 wants to merge 6 commits intoJabRef:mainfrom
Conversation
|
Hey @Francis-Lee-210! 👋 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. We also use Qodo for review assistance. It will update your pull request description with a review help and offer suggestions to improve the pull request. 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. You can read about the whole pull request process in our contribution guide. Please ensure that your pull request is in line with our AI Usage Policy and make necessary disclosures. |
Review Summary by QodoFix invisible delete area for internal CSL styles
WalkthroughsDescription• Fix invisible delete button area for internal CSL styles • Replace ValueTableCellFactory with custom TableCell implementation • Explicitly clear cell content for internal and empty rows • Preserve delete functionality for external CSL styles Diagramflowchart LR
A["CSL Styles Table"] -->|"Custom TableCell"| B["Check if Internal Style"]
B -->|"Internal or Empty"| C["Clear Cell Content"]
B -->|"External Style"| D["Show Delete Button"]
D --> E["User Can Delete"]
C --> F["No Delete Area"]
File Changes1. jabgui/src/main/java/org/jabref/gui/openoffice/StyleSelectDialogView.java
|
Code Review by Qodo
1. Right-click triggers delete
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| cslDeleteColumn.setCellFactory(_ -> new TableCell<>() { | ||
| @Override | ||
| protected void updateItem(Boolean internalStyle, boolean empty) { | ||
| super.updateItem(internalStyle, empty); | ||
|
|
||
| setText(null); | ||
| setGraphic(null); | ||
| setTooltip(null); | ||
| setOnMouseClicked(null); | ||
|
|
||
| if (empty || (internalStyle == null) || (getTableRow() == null) || (getTableRow().getItem() == null) || internalStyle) { | ||
| return; | ||
| } | ||
|
|
||
| new ValueTableCellFactory<CSLStyleSelectViewModel, Boolean>() | ||
| .withGraphic(internalStyle -> internalStyle ? null : IconTheme.JabRefIcons.DELETE_ENTRY.getGraphicNode()) | ||
| .withOnMouseClickedEvent(_ -> _ -> { | ||
| CSLStyleSelectViewModel selectedStyle = cslStylesTable.getSelectionModel().getSelectedItem(); | ||
| if (selectedStyle != null) { | ||
| viewModel.deleteCslStyle(selectedStyle.getLayout().citationStyle()); | ||
| } | ||
| }) | ||
| .withTooltip(_ -> Localization.lang("Remove style")) | ||
| .install(cslDeleteColumn); | ||
| CSLStyleSelectViewModel style = getTableRow().getItem(); | ||
| setGraphic(IconTheme.JabRefIcons.DELETE_ENTRY.getGraphicNode()); | ||
| setTooltip(new Tooltip(Localization.lang("Remove style"))); | ||
| setOnMouseClicked(_ -> viewModel.deleteCslStyle(style.getLayout().citationStyle())); | ||
| } | ||
| }); |
There was a problem hiding this comment.
Please use our ValueTableCellFactory.
There was a problem hiding this comment.
I updated the implementation to use ValueTableCellFactory, re-tested it locally, and pushed the change.
I also noticed that the Validate requirement coverage check keeps getting cancelled/timing out. Do I need to do anything on my side for that, or is it a CI/workflow issue?
This comment has been minimized.
This comment has been minimized.
|
Your pull request conflicts with the target branch. Please merge with your code. For a step-by-step guide to resolve merge conflicts, see https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line. |
This comment has been minimized.
This comment has been minimized.
✅ All tests passed ✅🏷️ Commit: e5b1a59 Learn more about TestLens at testlens.app. |
Review Summary by QodoFix invisible delete area for internal CSL styles
WalkthroughsDescription• Fix invisible delete button area for internal CSL styles • Prevent delete action execution on internal styles • Maintain delete functionality for external CSL styles • Update ValueTableCellFactory usage with correct parameter handling Diagramflowchart LR
A["CSL Style Delete Cell"] --> B{"Is Internal Style?"}
B -->|Yes| C["Hide Delete Button"]
B -->|Yes| D["Disable Delete Action"]
B -->|No| E["Show Delete Button"]
B -->|No| F["Enable Delete Action"]
C --> G["No Delete Area Visible"]
D --> G
E --> H["Delete Button Visible"]
F --> H
File Changes1. jabgui/src/main/java/org/jabref/gui/openoffice/StyleSelectDialogView.java
|
Code Review by Qodo
1. Stale tooltip not cleared
|
|
@Francis-Lee-210 please update the screenshots after your most recent change |
|
Just tried out this PR, found one problem:
PR.test.mp4 |
But the problem seems not related to this change. |
Is the problem there on the |
Good finding - create an issue |

Related issues and pull requests
Closes #15397
PR Description
This fixes the invisible delete area shown for internal CSL styles in the OpenOffice/LibreOffice style selection dialog.
The delete cell is now explicitly cleared for empty rows and internal styles, so internal CSL styles no longer show a visible or invisible delete area. External CSL styles still show the delete button and remain deletable.
Steps to test
.cslstyle.Comparison screenshots
Library screenshot:
Checklist
CHANGELOG.mdin a way that can be understood by the average user (if change is visible to the user)