Skip to content

Add hide button for user comments#10610

Merged
Siedlerchr merged 18 commits into
mainfrom
fix-10424
Dec 4, 2023
Merged

Add hide button for user comments#10610
Siedlerchr merged 18 commits into
mainfrom
fix-10424

Conversation

@koppor

@koppor koppor commented Oct 31, 2023

Copy link
Copy Markdown
Member

Fixes #10424 by adding a button.

By default the user comments will be shown. However, there is now a button to make it possible to hide the field.
It can be re-activated in the preferences.

This PR also refs https://github.com/JabRef/jabref-issue-melting-pot/issues/268 and makes use of the new JDK21 data structures. (See https://openjdk.org/jeps/431).

grafik

After pressing the button:
grafik

New preference option to re-enable:

grafik


I am not sure about the label "Add". Maybe "Add JabRef-featured user-specific comment"? Exact, but too long.


Alternatives considered:

  • Global preference to show the user-specific field --> too hidden for me - users won't find it
  • Library-specific setting to enable --> requires pro-users to setup the .bib file accordingly (and much more coding effort)

Mandatory checks

  • 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 developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

- Place all user comments togehter (and BibTeX standard comment first)
- Switch from Set to StructuredSet
@JabRef JabRef deleted a comment from github-actions Bot Oct 31, 2023
@JabRef JabRef deleted a comment from github-actions Bot Oct 31, 2023
@tobiasdiez

Copy link
Copy Markdown
Member

I think this "add" functionality should go to the settings (probably in the form of a checkbox).

@calixtus

Copy link
Copy Markdown
Member

I like the button. Makes the feature easier to find instead of looking in the prefs and activating, going back etc etc. Dynamically added, just missing a remove button now.

Label maybe "Add user comment"?

@koppor

koppor commented Oct 31, 2023

Copy link
Copy Markdown
Member Author

BTW nice that GitHub renders the arrow properly

Screenshot_2023-10-31-09-30-10-91_320a9a695de7cdce83ed5281148d6f19.jpg

@tobiasdiez

Copy link
Copy Markdown
Member

Well, it would be as hidden (or as visible) as any other entry editor customization. Personally, I don't see why user comments should have a higher visibility than say adding/removing any other field. Feels rather inconsistent.

But anyway, it's also not that important. Could you please remove/decrease the whitespace below the button.

@koppor

koppor commented Oct 31, 2023

Copy link
Copy Markdown
Member Author

Whitespace: This is the best I could come up with. -- Without massive EntryEditor refactoring. Maybe you have an idea how to stack the button below the gridpane?

Priority: Debatable how to make features prominent and accessible in JabRef. Our welcome screen (for new users) is still a TODO. And this would be one item for it...

@koppor

koppor commented Oct 31, 2023

Copy link
Copy Markdown
Member Author

When working in group, someone might not want to add comments while others do

I'll add a preference to disable the feature

@tobiasdiez

Copy link
Copy Markdown
Member

Whitespace: This is the best I could come up with. -- Without massive EntryEditor refactoring. Maybe you have an idea how to stack the button below the gridpane?

Negative bottom margin/padding?

Priority: Debatable how to make features prominent and accessible in JabRef. Our welcome screen (for new users) is still a TODO. And this would be one item for it...

My philosophy would be to present actual functionality to the users, and less so configuration options. Config options in the main view are only a good idea if you often need to switch between different options depending on context (e.g. union vs intersection select for groups, different toggles for search). For the user comments: If you don't use the feature, the button doesn't give you any value. If you do use the feature, then you are annoyed that you have to click the button every time.

I think it would make more sense for visibility if you write a nice documentation page with "consider these options if you work in a team".

@calixtus

Copy link
Copy Markdown
Member

Negativ padding is the highway to ui hell.
Honestly, I think the whitespace gap is ok.

@Siedlerchr

Copy link
Copy Markdown
Member

After thinking about I think it makes sense to show the user specific comment by default and then add a button: Hide comment with a notification that this can be re-activated in the prefs.
After the user clicked hide the button is no longer shown

* upstream/main:
  Update journal abbreviation lists (#10645)
  Use clparse (instead of heylogs) (#10641)
  Update CSL styles (#10642)
  Added parent field to Hayagriva YAML export (#10633)
  Bump org.fxmisc.richtext:richtextfx from 0.11.1 to 0.11.2 (#10637)
  Bump io.github.classgraph:classgraph from 4.8.163 to 4.8.164 (#10634)
  Bump org.junit.platform:junit-platform-launcher from 1.10.0 to 1.10.1 (#10635)
  Bump org.mockito:mockito-core from 5.6.0 to 5.7.0 (#10638)
  Bump com.tngtech.archunit:archunit-junit5-engine from 1.1.0 to 1.2.0 (#10636)
* upstream/main:
  App semantic scholar api key to properties (#10656)
  Replace cache: gradle with "odern" gradle-build-action (#10657)
  Clean up test code (#10658)
  Bump org.openrewrite.rewrite from 6.4.0 to 6.5.4 (#10650)
  Bump com.puppycrawl.tools:checkstyle from 10.12.4 to 10.12.5 (#10654)
  Bump com.fasterxml.jackson.dataformat:jackson-dataformat-yaml (#10653)
  Bump com.github.Dansoftowner:jSystemThemeDetector from 3.6 to 3.8
  Remove comments - don't work on forks
remove from grid

todo move to prefs
Comment thread src/main/java/org/jabref/gui/entryeditor/CommentsTab.java
Comment thread src/main/java/org/jabref/preferences/EntryEditorPreferences.java
@Siedlerchr Siedlerchr changed the title Do not show user-specific comment as default Add hide button for user comments Nov 27, 2023
Comment thread src/main/java/org/jabref/gui/entryeditor/CommentsTab.java Outdated
@Siedlerchr

Copy link
Copy Markdown
Member

Github currently has issues...

@Siedlerchr

Copy link
Copy Markdown
Member

entry editor preferences needs to be mocked for gui test

@koppor

koppor commented Dec 4, 2023

Copy link
Copy Markdown
Member Author

Looks OK. However, user-specific comments not sorted well. The idea was to put the general comment field fiirst and then the user-specific comments. Currently, it is a mix:

  • first own-comments
  • then general comments
  • then comments from other users

grafik

It should be

  • first: general comments
  • then comments from other users and own - sorted by username.

@Siedlerchr

Copy link
Copy Markdown
Member

Okay, I see what I can do

@koppor

koppor commented Dec 4, 2023

Copy link
Copy Markdown
Member Author

I see that a sorting of the comment field of the current user is hard.

Therefore, I implemented

  • first: general comments
  • second: user-specific comment (if enabled in the preferences - or non-empty)
  • third: all other non-empty user-specific comment fields

Note: We need to show non-empty user-specific comment fields - otherwise, they will be displayed in the bibtex source tab only.

With disabled show field:

grafik

With disabled show field - but with a comment

grafik


With enabled preferences

grafik

@github-actions

github-actions Bot commented Dec 4, 2023

Copy link
Copy Markdown
Contributor

The build for this PR is no longer available. Please visit https://builds.jabref.org/main/ for the latest build.

@Siedlerchr Siedlerchr added this pull request to the merge queue Dec 4, 2023
Merged via the queue into main with commit 67e25a0 Dec 4, 2023
@Siedlerchr Siedlerchr deleted the fix-10424 branch December 4, 2023 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Not possible to disable user-specific comments

5 participants