Automatic field editor: Add Clear content tab + viewmodel#13824
Automatic field editor: Add Clear content tab + viewmodel#13824calixtus merged 11 commits intoJabRef:mainfrom
Conversation
| Field chosen = fieldCombo.getValue(); // keep ComboBox<Field> | ||
| if (chosen != null) { | ||
| viewModel.clearField(chosen); // VM builds/publishes the undo compound | ||
| System.out.println("Cleared field: " + chosen.getName()); |
There was a problem hiding this comment.
No System.out and remove the comments
|
|
||
| List<BibEntry> selected = stateManager.getSelectedEntries(); | ||
| for (BibEntry entry : selected) { | ||
| // clearField returns Optional<FieldChange> |
| List<BibEntry> selected = stateManager.getSelectedEntries(); | ||
| Set<Field> setFields = new LinkedHashSet<>(); | ||
|
|
||
| for (BibEntry entry : selected) { |
There was a problem hiding this comment.
can be refactored into a stream
| private final ClearContentViewModel viewModel; | ||
|
|
||
| public ClearContentTabView(StateManager stateManager) { | ||
| super(); |
There was a problem hiding this comment.
Is there a reasony why you did not creae an fxml? I guess you used AI..
There was a problem hiding this comment.
Yes, I initially used AI to generate the layout in Java so I could focus on getting the logic working first but forgot to move it into a proper FXML file. I've made the changes now.
|
Sorry, misunderstood PR. Nevermind. |
| import org.jabref.model.entry.field.FieldFactory; | ||
|
|
||
| public class ClearContentViewModel { | ||
| public static final int TAB_INDEX = 2; |
There was a problem hiding this comment.
TAB_INDEX constant is horrible, but is actually consistent with the current design of the dialog. Neccessary for the fancy infotext about affected files after applying the change. Should be refactored in the future, but for now, it can just stay.
|
You did not assign yourself to the issue. Thus, it looks like you skipped reading our CONTRIBUTING.md, which explains exactly how to participate. No worries, it happens to the best of us. Give it a read, and you’ll discover the ancient wisdom of assigning issues to yourself. Trust me, it’s worth it. 🚀 |
* upstream/main: (85 commits) Fix typo in PR template (add missing 'to') (JabRef#14050) New Crowdin updates (JabRef#14049) Switch to new macos intel runner and update arm runner as well (JabRef#14048) Automatic field editor: Add Clear content tab + viewmodel (JabRef#13824) Update dependency org.eclipse.jgit:org.eclipse.jgit.pgm to v7.4.0.202509020913-r (JabRef#14046) Rephrase JabRef-Machine's "Determine issue number" (JabRef#14044) Chore(deps): Bump com.vanniktech.maven.publish from 0.32.0 to 0.34.0 in /jablib (JabRef#14039) Chore(deps): Bump org.mockito:mockito-core in /jablib (JabRef#14038) Chore(deps): Bump jablib/src/main/resources/csl-styles (JabRef#14037) Chore(deps): Bump com.dlsc.pdfviewfx:pdfviewfx in /versions (JabRef#14040) Chore(deps): Bump lucene from 10.3.0 to 10.3.1 in /versions (JabRef#14042) Fix eadr missing (JabRef#14043) Enable update in versions of jablib (JabRef#14036) Update Gradle Wrapper from 9.3.0-jabref-1 to 9.1.0 (JabRef#14033) Implemented OpenAlex (JabRef#14020) Chore(deps): Bump peter-evans/create-or-update-comment from 4 to 5 (JabRef#14023) Chore(deps): Bump org.cyclonedx.bom from 3.0.0-alpha-1 to 3.0.0 (JabRef#14026) Chore(deps): Bump org.junit.jupiter:junit-jupiter in /versions (JabRef#14030) Chore(deps): Bump com.github.andygoossens:gradle-modernizer-plugin (JabRef#14027) Chore(deps): Bump org.mockito:mockito-core in /versions (JabRef#14028) ...
* Automatic field editor: Add Clear content tab + viewmodel * Removing comments * PR comment changes * Bot suggested changes * Bot suggested changes * reformat * fix fxml * Added tests, reformats and visual modifications. Fixed number of affected files * Fixed tab number * CHANGELOG.md --------- Co-authored-by: Siedlerchr <siedlerkiller@gmail.com> Co-authored-by: Carl Christian Snethlage <calixtus@users.noreply.github.com>
* Automatic field editor: Add Clear content tab + viewmodel * Removing comments * PR comment changes * Bot suggested changes * Bot suggested changes * reformat * fix fxml * Added tests, reformats and visual modifications. Fixed number of affected files * Fixed tab number * CHANGELOG.md --------- Co-authored-by: Siedlerchr <siedlerkiller@gmail.com> Co-authored-by: Carl Christian Snethlage <calixtus@users.noreply.github.com>
Closes #13780
This PR introduces a dedicated "Clear content" tab in the Automatic Field Editor:
Steps to test
author,journal).author) and click Clear field content: the field value should be removed from all selected entries.Mandatory checks
CHANGELOG.mdin a way that is understandable for the average user (if change is visible to the user)