Skip to content
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

Improve user friendliness of automatically linked files #7484

Merged
merged 12 commits into from
Mar 9, 2021

Conversation

osclind
Copy link
Contributor

@osclind osclind commented Mar 3, 2021

We have implemented a new textfield for files that are automatically detected by JabRef and listed as files in the general tab of the entry editor. We also changed the icon for automatically linked files from a BRIEFCASE_CHECK to LINK_PLUS, since we found it more intuitive. This fixes #3607.

  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked documentation: Is the information available and up to date? If not created an issue at https://github.com/JabRef/user-documentation/issues or, even better, submitted a pull request to the documentation repository.

We thought that creating an issue would be redundant if our changes weren't accepted, so we have not completed the documentation task. The documentation refers to the icon as a "suitcase", which would not be accurate, were these changes to be accepted. Instead it should be referred to as a link with a plus sign.

Screenshots

Before changes

File not linked

Before changes, file not added

File linked

Before changes, file added

After changes

File not linked

After changes, file not added

File linked

After changes, file added

LukasGutenberg and others added 4 commits March 3, 2021 09:56
- added (Auto) in front of the name of the pdf
- changed the icon for the linking action to LINK_PLUS
- Removed unused import statements introduced in 64a6005
- Removed extraneous newline introduced in 64a6005
- remove duplicates of empty rows missed in 50e98a7
@calixtus
Copy link
Member

calixtus commented Mar 4, 2021

Hi folks, thanks for your contribution. At very first sight, I like this idea.
About the icon: this seems ok, just a few days ago we switched our iconset to iconli, the previous iconset was very limited, so the briefcase icon was just a workaround. The new icon seem reasonable.
About the label: I'm not really sure, if we should display an icon or a label. Maybe the other @JabRef/developers have a preference. But if we use a label, it needs to be localized. (see https://devdocs.jabref.org/getting-into-the-code/code-howtos#using-localization-correctly ).

@LukasGutenberg
Copy link
Contributor

Hello @calixtus. @tobiasdiez recommended an implementation with a description that says '(Auto)' in issue #3607, we agreed that it would make the display clearer and chose to implement it as a separate text field in the HBox, as the description is currently bound to the linked file's description property. We estimated that too much refactoring would be required to initially set the description to '(Auto)' and then change it to be bound to the file's description property, if the user chooses to link the file. We also thought that it made more sense to display the text prior to the file name. We'll await feedback from another dev about the icon vs. text dilemma.

@calixtus
Copy link
Member

calixtus commented Mar 4, 2021

Thank you for your quick response. I did not see the discussion with tobias diez earlier, sorry, but if that's what you both agreed on, than its perfectly fine.

Copy link
Member

@tobiasdiez tobiasdiez left a comment

Choose a reason for hiding this comment

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

The code changes look good to me. Thanks!

I'm also not sure about the best way to make it clear that the file is automatically found. The current briefcase icon was more confusing than helpful. But maybe it's already enough to change the icon to the "link-add" symbol and move this symbol in front of the file name (i.e where "(Auto)" is written with this PR)? Another idea would be to set the transparency of automatically found files to something like 70%... @calixtus what do you think? @osclind & team, could you maybe experiment a bit with different solutions? It never hurts to have a fresh pair of eyes looking at this, and bringing in new ideas.

@martinfalke
Copy link
Contributor

We'll try out a few solutions and update the thread with screenshots of the different results, then you can give feedback and we'll go with whatever looks best to you guys.

@LukasGutenberg
Copy link
Contributor

After pressing button

Screenshot from 2021-03-05 10-48-46

Button to the left

Screenshot from 2021-03-05 10-49-15

Button where (Auto) was

Screenshot from 2021-03-05 10-55-34

With opacity

Screenshot from 2021-03-05 11-10-53

@calixtus @tobiasdiez
Here are some examples of the possible implementations that you suggested earlier.
Tell us what you think, we can of course make further changes if you want.

@tobiasdiez
Copy link
Member

Thanks a lot! I like the "Button to the left" solution the most, and would say it should be sufficiently clear that this is not a normally-linked file. So if there is a short description as a tooltip for the link button, I would say this is fine. @JabRef/developers what do you think?

@LukasGutenberg
Copy link
Contributor

The tooltip is unchanged since the earlier button as we thought it was well formulated and descriptive.

@calixtus
Copy link
Member

calixtus commented Mar 5, 2021

I'm really not sure, what would be the best solution. On one hand, it shows now symbols to the left and to the right and it's hard to guess, what means what. On the other hand, it really should stand out, if there is an autolinked file. Guess there is no right solution.
What if there are more than one linked files listed?

@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Mar 6, 2021
@LukasGutenberg
Copy link
Contributor

@calixtus Different entries are handled separately, we simply make use of the isAutomaticallyFound property to make changes.

Several automatically found

Screenshot from 2021-03-08 09-11-12

One added

Screenshot from 2021-03-08 09-11-28

@calixtus
Copy link
Member

calixtus commented Mar 8, 2021

@calixtus Different entries are handled separately

Of course, it's just about the look and feel if several different list entries are shown. Thanks for testing out, I personally like the variant "icon on the very left".

@LukasGutenberg
Copy link
Contributor

Do we use opacity and what percentage would you like? Currently we use 70% for automatically found files and 100% for files that have been added.

@calixtus
Copy link
Member

calixtus commented Mar 8, 2021

It's just fine, as it is. If you use opacity please also check out, if it shows up right in the dark theme.

@LukasGutenberg
Copy link
Contributor

It works for dark mode, I'll push the latest changes.

Screenshot from 2021-03-08 09-58-35

- auto removed
- link button moved to the left
- lowered opacity for automatically found files, unchanged for added
@osclind osclind requested a review from tobiasdiez March 8, 2021 09:04
Copy link
Member

@tobiasdiez tobiasdiez left a comment

Choose a reason for hiding this comment

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

Thanks a lot! I have a few more nitpickings, otherwise it looks good to me.

CHANGELOG.md Outdated
@@ -29,6 +29,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- The export to MS Office XML now uses the month name for the field `MonthAcessed` instead of the two digit number [#7354](https://github.com/JabRef/jabref/issues/7354)
- We included some standalone dialogs from the options menu in the main preference dialog and fixed some visual issues in the preferences dialog. [#7384](https://github.com/JabRef/jabref/pull/7384)
- We improved the linking of the `python3` interpreter via the shebang to dynamically use the systems default Python. Related to [JabRef-Browser-Extension #177](https://github.com/JabRef/JabRef-Browser-Extension/issues/177)
- Automatically found pdf files now have the linking button to the far left and uses the icon LINK_PLUS instead of BRIEFCASE_CHECK. The file name also has lowered opacity(70%) until added. [#3607](https://github.com/JabRef/JabRef-Browser-Extension/issues/3607)
Copy link
Member

Choose a reason for hiding this comment

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

The link to the issue is not correct. Moreover, the changelog is for users, so please don't use technical terms such as LINK_PLUS.

acceptAutoLinkedFile.managedProperty().bind(linkedFile.isAutomaticallyFoundProperty());
acceptAutoLinkedFile.setOnAction(event -> {
linkedFile.acceptAsLinked();
linkedFile.setOpacityProperty(1.0);
Copy link
Member

Choose a reason for hiding this comment

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

Move linkedFile.setOpacityProperty(1.0); into acceptAsLinked. The viewmodel should contain all the logic.

@@ -1732,6 +1732,7 @@ Don't\ share=Don't share
Share\ anonymous\ statistics=Share anonymous statistics
Telemetry\:\ Help\ make\ JabRef\ better=Telemetry: Help make JabRef better
To\ improve\ the\ user\ experience,\ we\ would\ like\ to\ collect\ anonymous\ statistics\ on\ the\ features\ you\ use.\ We\ will\ only\ record\ what\ features\ you\ access\ and\ how\ often\ you\ do\ it.\ We\ will\ neither\ collect\ any\ personal\ data\ nor\ the\ content\ of\ bibliographic\ items.\ If\ you\ choose\ to\ allow\ data\ collection,\ you\ can\ later\ disable\ it\ via\ Options\ ->\ Preferences\ ->\ General.=To improve the user experience, we would like to collect anonymous statistics on the features you use. We will only record what features you access and how often you do it. We will neither collect any personal data nor the content of bibliographic items. If you choose to allow data collection, you can later disable it via Options -> Preferences -> General.
(Auto)=(Auto)
Copy link
Member

Choose a reason for hiding this comment

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

This is no longer needed, I guess.

@@ -196,6 +196,7 @@ public void bindToEntry(BibEntry entry) {
preferences.getFilePreferences(),
externalFileTypes);
newLinkedFile.markAsAutomaticallyFound();
Copy link
Member

Choose a reason for hiding this comment

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

Move newLinkedFile.setOpacityProperty(0.3); to markAsAutomaticallyFound so that it is consistent, even if some other code marks a file as automatically found.

- made changelog easier to read
- moved opacity operations to correct locations
- readjusted opacity to correct value
- removed unused localization
@LukasGutenberg
Copy link
Contributor

LukasGutenberg commented Mar 8, 2021

i realized that opacity was set way too low and that the correct images should be:

Screenshot from 2021-03-08 10-43-58

Screenshot from 2021-03-08 10-44-14

this is how it looked in the first set of images with opacity

@LukasGutenberg
Copy link
Contributor

we will write some tests for this as well

@calixtus
Copy link
Member

calixtus commented Mar 8, 2021

If you like one more more idea on this: The "Königsweg" would be to assign a css PseudoState, so the opacity would be addressable in the stylesheet and be customizable.

@calixtus
Copy link
Member

calixtus commented Mar 8, 2021

See for example ImportEntriesDialog::initialize() (lines 105 and 145)
This way you could subscribe in the view (EasyBind) changes of isAutomaticallyFoundProperty() to the pseudo class and remove the opacityProperty, which is some kind of a rule breaker of the MVVM design pattern.

@tobiasdiez
Copy link
Member

King's Trail has a different meaning in Sweden: https://en.wikipedia.org/wiki/Kungsleden (highly recommended hike!). 😃 Otherwise I agree!

@calixtus
Copy link
Member

calixtus commented Mar 8, 2021

Wouldn't say so, both the Kungsleden and using psuedo classes for opacity are distinguished by special beauty. 🙈 😆

LukasGutenberg and others added 2 commits March 8, 2021 17:31
- opacity is now set through a css pseudoclass instead of a property
@LukasGutenberg
Copy link
Contributor

We did not manage to figure out how to use EasyBind but the program now makes use of css to change the opacity when the text is generated and when the button is pressed.

Comment on lines 167 to 170
acceptAutoLinkedFile.setOnAction(event -> {
linkedFile.acceptAsLinked();
link.pseudoClassStateChanged(opacity, linkedFile.isAutomaticallyFound());
});
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
acceptAutoLinkedFile.setOnAction(event -> {
linkedFile.acceptAsLinked();
link.pseudoClassStateChanged(opacity, linkedFile.isAutomaticallyFound());
});
acceptAutoLinkedFile.setOnAction(event -> linkedFile.acceptAsLinked());
EasyBind.subscribe(linkedFile.isAutomaticallyFoundProperty(), found -> link.pseudoClassStateChanged(opacity, found));

This should do it.

Copy link
Member

Choose a reason for hiding this comment

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

public static Subscription includePseudoClassWhen(Node node, PseudoClass pseudoClass, ObservableValue<? extends Boolean> condition) {

@LukasGutenberg
Copy link
Contributor

@calixtus @tobiasdiez
Thank you for your time and engagement. We appreciate all the help and advice you have given us.

@osclind osclind requested a review from tobiasdiez March 9, 2021 09:50
Copy link
Member

@tobiasdiez tobiasdiez left a comment

Choose a reason for hiding this comment

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

We have to thank you guys!

And sorry that the process was a bit back and forth. Sometimes the hardest part is not in the actual coding but figuring out what would be the best user experience. We hope you enjoyed the project nonetheless and hope to see further contributions ;-)

@calixtus calixtus merged commit 5855bcf into JabRef:master Mar 9, 2021
@mlep
Copy link
Contributor

mlep commented Mar 11, 2021

I have just tested it: Nice!
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve display of automatically found file links in editor
7 participants