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

Colouring item count in groups panel does not work reliably #3112

Closed
AEgit opened this issue Aug 16, 2017 · 9 comments · Fixed by #5328
Closed

Colouring item count in groups panel does not work reliably #3112

AEgit opened this issue Aug 16, 2017 · 9 comments · Fixed by #5328
Labels
bug Confirmed bugs or reports that are very likely to be bugs groups ui

Comments

@AEgit
Copy link

AEgit commented Aug 16, 2017

JabRef 4.0-dev--snapshot--2017-08-16--maintable-update--69f717336
Windows 10 10.0 amd64
Java 1.8.0_141

When selecting an item in the main table, the associated group (or rather the number giving the number of associated items) should be coloured. This is not the case with newly assigned items. It does appear, however, that this feature is generally buggy - also items that have not been newly assigned to a group are not always coloured in the group panel (sometimes it works, sometimes it does not).
It's difficult for me to replicate this behaviour. As far as I can tell, one way of experiencing reliably this bug is by doing the following.

  1. Open a JabRef database
  2. Select an item - the associated item count in the groups panel should be coloured (although sometimes it won't)
  3. Assign this item to a new group - the item count of the new group will not be coloured

Note, that I've also noticed that colours can "persist" in the main table, although no or only one item is selected. Example:

  1. Open a JabRef database
  2. Select multiple items which are associated with different groups - the item counts of the different groups should be coloured
  3. Now deselect all items and select only one that is associated with a single group - only the item count of that group should be coloured. But actually all item counts of the previously selected items/groups are still coloured.
@lenhard lenhard added bug Confirmed bugs or reports that are very likely to be bugs groups ui labels Aug 16, 2017
@lenhard
Copy link
Member

lenhard commented Aug 28, 2017

@tobiasdiez In order to make addressing this bug a little easier, could you please point me to the code that does the coloring of the group tree? I have a hard time locating it at the moment.

@tobiasdiez
Copy link
Member

@lenhard The coloring is determined by pseudo classes that are bound to the anySelectedEntriesMatchedProperty/allSelectedEntriesMatchedProperty of the groups node view model.

@springzfx
Copy link

springzfx commented Oct 24, 2018

The bug still exists in recent master branch, I fixed this bug in this [commits] (springzfx@a907fb6)

The cause of this bug is that the local variable "pseudoClassState" is garbaged by java gc. There is no reference to this variable except an weak one from "bind" function.

@Siedlerchr
Copy link
Member

@springzfx thank you very much! Please create a PR for your changes, so we can integrate it.

@fix-me
Copy link

fix-me commented Oct 24, 2018

Does the same apply with toggle buttons like entry preview? I have disabled it and still the previews open on a single click. To reproduce it, the bottom details layer needs to be disabled.

@Siedlerchr
Copy link
Member

Thanks to @springzfx this issue is now resolved in the latest master version.

We would like to ask you to use a development build from https://builds.jabref.org/master and report back if it works for you. Please remember to make a backup of your library before trying-out this version.

@AEgit
Copy link
Author

AEgit commented Oct 29, 2018

JabRef 5.0-dev--snapshot--2018-10-28--master--05047f32a
Windows 10 10.0 amd64
Java 1.8.0_191

This bug has been partially solved. If you repeat the following steps you can still reliably reproduce the bug:

  1. Open a JabRef database
  2. Select an item - the associated item count in the groups panel should be coloured (this works now!)
  3. Assign this item to a new group - the item count of the new group will not be coloured (this does not work)

So, problem 2 has been solved, but problem 3 persists. There is a simple workaround for problem 3, though: If you select another group in the groups panel or another item in the main table and the select the newly assigned item, all (!) corresponding groups will be coloured.
So, basically, the only minor problem that persists is that an item that is newly assigned to a group will not lead to an immediate update of the colouring of that group. Instead, we have to manually trigger the update of the groups panel.

tobiasdiez added a commit that referenced this issue Sep 17, 2019
Fixes #5327. The problem was that `getTreeTableRow.getItem()` in `ViewModelTreeTableCellFactory` still returned the old item (and not the new one passed as method argument to `updateItem`).

 Since I was already looking at the code, this PR also fixes #3112 that improves the coloring after an entry was added to the group.
@Siedlerchr
Copy link
Member

Shoud be fixed now in latest master. I cannot longer reproduce it.

We would like to ask you to use a development build from https://builds.jabref.org/master and report back if it works for you. Please remember to make a backup of your library before trying-out this version.

@AEgit
Copy link
Author

AEgit commented Sep 18, 2019

JabRef 5.0-dev--snapshot--2019-09-18--master--1601770f4
Windows 10 10.0 amd64
Java 11.0.4-bellsoft

I can confirm that this issue is fixed in the latest dev version. Cheers!

@koppor koppor moved this to Done in Prioritization Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs groups ui
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants