-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added preset for new entry keybindings and reintroduced defaults #7705
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. Rage fixed!
NEW_PHDTHESIS("New phdthesis", Localization.lang("New phdthesis"), "", KeyBindingCategory.BIBTEX), | ||
NEW_PROCEEDINGS("New proceedings", Localization.lang("New proceedings"), "", KeyBindingCategory.BIBTEX), | ||
NEW_UNPUBLISHED("New unpublished", Localization.lang("New unpublished"), "", KeyBindingCategory.BIBTEX), | ||
NEW_INBOOK("New inbook", Localization.lang("New inbook"), "Ctrl+shift+I", KeyBindingCategory.BIBTEX), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think ctrl needs to be lowercase5, otherwise the Mac replacement with option might not work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea, I just did it like the other keybindings... Could you test this please? Maybe this is an issue with other keys.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I test it now, works fine. ctrl is mapped to cmd
Opening editor works on mac with cmd + e now, but closing not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some smaller comments, otherwise LGTM
NEW_PHDTHESIS("New phdthesis", Localization.lang("New phdthesis"), "", KeyBindingCategory.BIBTEX), | ||
NEW_PROCEEDINGS("New proceedings", Localization.lang("New proceedings"), "", KeyBindingCategory.BIBTEX), | ||
NEW_UNPUBLISHED("New unpublished", Localization.lang("New unpublished"), "", KeyBindingCategory.BIBTEX), | ||
NEW_INBOOK("New inbook", Localization.lang("New inbook"), "ctrl+shift+I", KeyBindingCategory.BIBTEX), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these defaults really necessary? They were removed in a recent PR on purpose (because they are not often used). Users can still set keybindings themselves, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Carl and me discussed this in length yesterday, too.
I like convention over configuration. If I start a tool, I want to have it behaving "well". It should require configuration only for certain special cases.
In the concrete case, the key bindings are NOT used for some other cases (except the pull from shared database). Thus, I have a strong vote to add the non-conflicting key bindings back as default.
The other option is that I write a lengthy manual on key bindings and explain each (power) user why they have to configure key bindings. - IMHO JabRef should not require much documentation. Only for the hard cases.
See also #7439 and #7346. Thus, there are multiple users used to the key bindings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are too many entry types, especially if you use biblatex, to have keybindings for all types. Thus you need to make a cutoff somewhere, and in my opinion it should be sufficient to have bindings for the 5 most commonly used types. This would also be consistent with the "new entry" dialog where the following types are treated specially:
jabref/src/main/java/org/jabref/model/entry/types/BiblatexEntryTypeDefinitions.java
Line 446 in d9964c6
public static final List<BibEntryType> RECOMMENDED = Arrays.asList(ARTICLE, BOOK, INPROCEEDINGS, REPORT, MISC); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "most commonly used types" are for me the ones where keybindings existed for more than a decade. IMHO there is no need to remove functionality in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From this perspective, we shouldn't have changed the new entry dialog as well...
|
||
@Override | ||
public String getName() { | ||
return "New Entries"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find "new entries" a bit confusing, maybe something longer that better explains the purpose? Should be localized as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make a suggestion. We did not come up with something better yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New Entry types ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like "Bindings for creating all entry types"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A long text would just repeat information the user already has and would be imho extremely annoying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I couldn't find a nice formulation that doesn't include "Bindings". But with "New entries" or "New entry types" it's really not clear what this is doing.
src/main/java/org/jabref/gui/preferences/keybindings/presets/NewEntryBindingPreset.java
Outdated
Show resolved
Hide resolved
KEY_BINDINGS.put(KeyBinding.COPY_PREVIEW, ""); | ||
|
||
// Add new entry presets | ||
KEY_BINDINGS.put(KeyBinding.NEW_ARTICLE, "Ctrl+shift+A"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be consistent with the other keybindings, please lowercase the Ctrl
Seem like someone was too fast with merging unit tests , I think Tobi fixed them a few minutes ago |
Merged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
form my point of view lgtm.
Maybe reword New entries simply to New Entry by type"?
Before merging we should get to a conclusion about which shortcuts to keep. |
Also i don't really understand why on macos we need two different shortcuts, one for opening the entry editor and one for closing it. This needs to be fixed. |
Should be lowercase jabref/src/main/java/org/jabref/gui/keyboard/KeyBindingRepository.java Lines 127 to 129 in bb011c9
Regarding the ctrl + E (which maps to cmd + e on mac) I think I found the issue and I remember it's a bug in javafx. Edit// Yep: https://bugs.openjdk.java.net/browse/JDK-8205915 |
* upstream/main: (71 commits) [Bot] Update CSL styles (#7735) Fix for issue 6966: open all files of multiple entries (#7709) Add simple unit tests (#7696) Add simple unit tests (#7543) Update check-outdated-dependencies.yml Added preset for new entry keybindings and reintroduced defaults (#7705) Select the entry which has smaller dictonary order when merge (#7708) Update CHANGELOG.md fix: make more fields, fomatters, ids and languages sorted by alphabetical order (#7717) Bump libreoffice from 7.1.2 to 7.1.3 (#7721) Bump unoloader from 7.1.2 to 7.1.3 (#7724) Bump org.beryx.jlink from 2.23.7 to 2.23.8 (#7723) Bump org.openjfx.javafxplugin from 0.0.9 to 0.0.10 (#7725) fix: make fields sorted by lexicographical order (#7711) Fix tests Refactoring existing unit tests (#7687) Refactoring and addition of unit tests (#7581) Refactor simple Unit Tests (#7571) Add simple unit tests (#7544) add and extend unit tests (#7685) ...
Added preset for new entry keybindings on public demand.
Fixes #7346
Fixes #7439
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)