Skip to content

Merging Entry Creation Buttons Into a Single Tool#13020

Merged
koppor merged 31 commits into
JabRef:mainfrom
Marika-Academic:fix-for-issue-8808
May 2, 2025
Merged

Merging Entry Creation Buttons Into a Single Tool#13020
koppor merged 31 commits into
JabRef:mainfrom
Marika-Academic:fix-for-issue-8808

Conversation

@Marika-Academic

@Marika-Academic Marika-Academic commented Apr 28, 2025

Copy link
Copy Markdown
Contributor

Closes #8808.

This job merges several tools used to create new entries (NewEntry, EntryType, CreateEntryFromId, and PlainCitationParser) into a single tool.

The new tool has a separate tab for each of its component creation methods. The last-used tab, and the values of non-text-entry fields, are preserved between runs of the tool and sessions of JabRef.

The new tool reinstates the ComboBox option for which parser should be used to parse plaintext citations, and adds a new option to create entries from a block of Bib(La)TeX entry sources.

Additionally:

  • The Quick-Create New Empty Entry tool still remains, and is linked to create new empty entries of the most-recently used EntryType selected in the new tool (when creating an empty entry of a specific type with the new tool).
  • The keyboard shortcut Ctrl + Shift + N, which previously opened the PlainCitationParser tool, now opens the new tool with the 'parse plaintext citation' tab pre-opened.
  • The new keyboard shortcut Ctrl + Alt + Shift + N opens the new tool with the 'enter source identifier' tab pre-opened.
  • Previous code for the replaced tools has been removed.

Screenshots:
menu toolbar
dialog_1
dialog_2
dialog_3
dialog_4

Mandatory checks

This commit merges several tools used to create new entries (`NewEntry`, `EntryType`, `CreateEntryFromId`, and `PlainCitationParser`) into a single tool, `NewEntryUnified`.

`NewEntryUnified` has a separate tab for each of its component creation methods. The last-used tab, and the values of non-text-entry fields, are preserved between runs of the tool and sessions of JabRef.

The new tool reinstates the ComboBox option for which parser should be used to parse plaintext citations, and adds a new option to create entries from a block of Bib(La)TeX entry sources.

Additionally:
 * The Quick-Create New Empty Entry tool still remains, and is linked to create new empty entries of the most-recently used `EntryType` selected in the new tool (when creating an empty entry of a specific type with the new tool).
 * The keyboard shortcut `Ctrl + Shift + N`, which previously opened the `PlainCitationParser` tool, now opens the new tool with the 'parse plaintext citation' tab pre-opened.
Comment thread jabgui/src/main/java/org/jabref/gui/actions/StandardActions.java Outdated
Comment thread jabgui/src/main/java/org/jabref/gui/actions/StandardActions.java Outdated
Comment thread jabgui/src/main/java/org/jabref/gui/importer/NewEntryUnifiedAction.java Outdated
Comment thread jabgui/src/main/java/org/jabref/gui/keyboard/KeyBinding.java Outdated
Comment thread jabgui/src/main/java/org/jabref/gui/newentryunified/NewEntryUnifiedApproach.java Outdated
Comment thread jabgui/src/main/java/org/jabref/gui/keyboard/KeyBinding.java Outdated
Comment thread jabgui/src/main/java/org/jabref/gui/preferences/JabRefGuiPreferences.java Outdated
Comment thread jabgui/src/main/java/org/jabref/gui/preferences/JabRefGuiPreferences.java Outdated
Comment thread jabgui/src/main/java/org/jabref/gui/preferences/JabRefGuiPreferences.java Outdated
@koppor koppor moved this to High priority in Prioritization Apr 29, 2025
@calixtus

Copy link
Copy Markdown
Member

Hi, without looking into the code: can you do something about the optics of the first tab too?

@Marika-Academic

Marika-Academic commented May 1, 2025

Copy link
Copy Markdown
Contributor Author

Sorry for the run-around guys, new to Java/Javafx/FXML and I appreciate all the help.

#13020 (comment)

This was a great tip, with the larger window width as well it looks pretty good.
Updated screenshots on the root comment coming in a mo.

#13020 (comment)

The down-and-to-the-side-a-bit thing was because, with the smaller panel, the identifier type ComboBox would start overlapping with the radio button label. Less likely to be a problem now that the panel defaults to being wider though.

Comment on lines +138 to +139
NEW_ENTRY_IMMEDIATE(Localization.lang("Add entry"), IconTheme.JabRefIcons.ADD_ARTICLE),
NEW_ENTRY(Localization.lang("Create new entry..."), IconTheme.JabRefIcons.ADD_ENTRY, KeyBinding.NEW_ENTRY),

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.

Still "Add" and "Create" for a similar thing. Did I overlook an reply on that? - Only "Add" should be used, no "Create"

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.

"New" (variable name), "Add" (Icon name), "Create" label --> use one... I propose to use "Add"

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've gone with "CREATE_ENTRY*" for variable names, but I think having the distinction between "adding" an entry (without a dialog or any options) and "creating" an entry (with a dialog where you have to make choices).

Plus I feel like it would be a bit confusing for users to see the menu options Add entry (ctrl + N) and Add entry... right next to each other in the menu.

How set are you on using "add"?

NEW_ENTRY(Localization.lang("New entry"), IconTheme.JabRefIcons.ADD_ENTRY, KeyBinding.NEW_ENTRY),
NEW_ARTICLE(Localization.lang("New article"), IconTheme.JabRefIcons.ADD_ARTICLE),
NEW_ENTRY_FROM_PLAIN_TEXT(Localization.lang("New entry from plain text"), IconTheme.JabRefIcons.NEW_ENTRY_FROM_PLAIN_TEXT),
NEW_ENTRY_IMMEDIATE(Localization.lang("Add entry"), IconTheme.JabRefIcons.ADD_ARTICLE),

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.

I think, the last chosen type is used - then the icon should be renamed from ADD_ARTICLE to ADD_ENTRY_IMMEDIATE (to be conistent with action name)

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've made some changes, see #13020 (comment). Are you happy with this?

…nd enum values (all related to the 'NewEntry' tool).
Comment thread jabgui/src/main/java/org/jabref/gui/importer/NewEntryAction.java
Comment thread jabgui/src/main/java/org/jabref/gui/keyboard/KeyBinding.java
@subhramit subhramit changed the title Merging Entry Creation Buttons Into a Single Tool. Merging Entry Creation Buttons Into a Single Tool May 2, 2025

@koppor koppor left a comment

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.

jabgui/src/main/java/org/jabref/gui/actions/StandardActions.java

still contains "Add" - Add entry - not sure why this was not changed. -- If you liked "Add" more than "Crreate", then, please, *everywhere only one term for the same thing!

Comment on lines +138 to +139
CREATE_ENTRY_IMMEDIATE(Localization.lang("Add entry"), IconTheme.JabRefIcons.CREATE_ENTRY_IMMEDIATE),
CREATE_ENTRY(Localization.lang("Create new entry..."), IconTheme.JabRefIcons.CREATE_ENTRY, KeyBinding.CREATE_ENTRY),

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.

"Create" and "Add" both used. Please use only "Create" (with the hope that native speakers are fine with this)

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.

#13020 (comment)
"Create entry" and "Create new entry..." being right next to each other in the same menu seems like it's going to be confusing to users, are you sure I can't convince you to let them be named differently?
The menu items seem different enough ('immediately creates an entry with an automatic type' vs 'opens a dialog for you to specify entry information') that more unique names seems preferable.

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.

We had an internal developer discussion:

  • "Add entry"
  • "Add entry using..."

And rename variables accordingly - should be easy with IntelliJ refactoring feature.

For the first one, we neglected "Add default entry" and "Add entry using defaults" (too long)

We think, we don't need an architectural decision record.

Sorry for the extra effort -- but naming is hard in computer science: https://martinfowler.com/bliki/TwoHardThings.html

@koppor koppor left a comment

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.

Update from the developers: We go ahead as is - and might change strings and variable names in a follow-up. Thank you for your efforts for this PR! This brings JabRef forward.

@koppor koppor added this pull request to the merge queue May 2, 2025
Merged via the queue into JabRef:main with commit de56006 May 2, 2025
1 check was pending
@github-project-automation github-project-automation Bot moved this from High priority to Done in Prioritization May 2, 2025
@Marika-Academic

Copy link
Copy Markdown
Contributor Author

Oh cool, no worries. Thanks for all of your time.

Siedlerchr added a commit that referenced this pull request May 2, 2025
* upstream/main:
  Fix directory path validation checks (#13029)
  Keep merge=union for JabRef_en.properties
  Merging Entry Creation Buttons Into a Single Tool (#13020)
  refine-jabsrv (#13044)
  Switch if branches for readbility (#13042)
  Updating the gradle wrapper does not need any JDK (#13037)
  Fix path - and fix typo (#13038)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Merge some (or all) of the "new entry" related buttons

4 participants