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

Highlight groups that match any/all of the entries selected in the main table. #2515

Merged
merged 4 commits into from
Feb 6, 2017

Conversation

tobiasdiez
Copy link
Member

@tobiasdiez tobiasdiez commented Feb 3, 2017

If a group contains all selected entries, then the "hit counter" turns green (and if only a few of the selected entries are contained in the group, then yellowish).

untitled

This replaces the "highlight groups" feature under the "Groups" menu.
(Best part: removes code from BasePanel and JabRefFrame)

I'm sorry that this PR contains a lot of modifications that are essentially only code rearrangements.

  • Change in CHANGELOG.md described
  • Tests created for changes
  • Screenshots added (for bigger UI changes)
  • Manually tested changed features in running JabRef
  • Check documentation status (Issue created for outdated help page at help.jabref.org?)
  • If you changed the localization: Did you run gradle localizationUpdate?

@tobiasdiez tobiasdiez added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Feb 3, 2017
@@ -2179,6 +1886,10 @@ public boolean isUpdatedExternally() {
return updatedExternally;
}

public void setUpdatedExternally(boolean b) {
updatedExternally = b;
Copy link
Member

Choose a reason for hiding this comment

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

Please use a more speaking variable name instead of b, maybe the same name as for the variable

*
* Guarded by "task"
*/
private TimerTask timerTask = new TimerTask() {
Copy link
Member

Choose a reason for hiding this comment

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

@@ -2374,60 +2116,261 @@ public SearchAndOpenFile(final BibEntry entry, final BasePanel basePanel) {
}
}

private class GroupTreeListener {

private final Runnable task = new Runnable() {
Copy link
Member

Choose a reason for hiding this comment

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

You could use a lamdba here, too

Copy link
Member

@Siedlerchr Siedlerchr left a comment

Choose a reason for hiding this comment

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

Just some minor things.

@lenhard
Copy link
Member

lenhard commented Feb 5, 2017

I know that it is hard to build a group-related PR with fewer LOC changes, but I still don't like reviewing a PR of this size ;-) On a very superficial scroll-over level, the code looks ok.

Instead, I played around a little with the UI. It took me a while to understand how the highlighting features was meant to work, but once I did, I could not find bugs. And I tried hard. Just one thought:

  • All entries seems to be always green, even if no entries are selected. Should it not be gray in this case? This is a sematics question, so just implement it in the same way as it has been before.

From my user's perspective, the PR is ready to be merged.

@tobiasdiez
Copy link
Member Author

tobiasdiez commented Feb 6, 2017

I will merge this right now as it is.
@Siedlerchr your comments concerned code that was just moved and not really modified (and I don't really want to touch the code in BasePanel and MainFrame since these components glue everything together but there are absolutely no tests in place...). But, of course, thank you for the review!

@lenhard The all entries hits number is no longer highlighted. Thanks for the suggestion. Do you have any ideas how to make the feature more self-explanatory?

@tobiasdiez tobiasdiez merged commit 2e9e7c8 into master Feb 6, 2017
@tobiasdiez tobiasdiez deleted the groupsEdit branch February 6, 2017 15:51
@lenhard
Copy link
Member

lenhard commented Feb 6, 2017

@tobiasdiez Not really. Once you start thinking about it, you end up with a more or less similar solution. One minor thing maybe: When clicking a group I was expecting that all entries in the group become selected (that is: blue). It took me a while to understand that they were sorted to the top and the unselected entries were greyed out. But if it has been that way and nobody really complains about it, it is propably best to leave it that way (in the abscense of a better idea). Also, I did the testing with our gigantic testing database from Aegit. Propably the highlighting is more intuitive if you use it with a database where you built the grouping yourself.

@tobiasdiez
Copy link
Member Author

There are two modes for groups:

  • Gray-out entries that are not matched
  • Filter, i.e. hide non-matched entries
    I didn't changed anything at this behaviour.
    One of the next PRs will move the option to switch between these modes to the preferences.

@matthiasgeiger
Copy link
Member

One of the next PRs will move the option to switch between these modes to the preferences.

To the Options -> Preferences preferences? Or do you want to recreate the "old" groups settings menu?

@tobiasdiez
Copy link
Member Author

I prefer to collect all the options in the preferences dialog. I think it is also not a setting that a user changes very often. What do you think?

@matthiasgeiger
Copy link
Member

In general I don't agree: Aspects as "Union vs. Intersect" and "Inverted" are more things that should be directly changeable in the groups UI.
Switching between "hide" and "float" is more an edge case - as I cannot come up with an use case which requires switching the style - this is just a personal preference.

@tobiasdiez
Copy link
Member Author

Of course you are right that the other settings (union, intersect, inverted, etc) would make sense as a popup-menu (as they are currently implemented) or as a toggle button. But these other options are not very high on my priority list as I don't really understand why one needs them (maybe they are better implemented as search commands like not in mygroup and in groupa and groupb)

@matthiasgeiger
Copy link
Member

Yeah you need them to accomplish "searches" like the ones you proposed (Find all papers, a) which are in both selected groups, b) which are in one or both of the selected groups, c) which are not in the selected group.
Of course these are mere "shortcuts" for normal searches, but I'm not sure whether an ordinary JabRef user without some basic knowledge of formal logic can formulate this that easy.

Maybe we could implement this a bit different as it is now using toggle buttons as for the normal search: Toggle button for "invert" + toggle button for "union", which can only be selected if multiple groups are selected (Side note: This is currently not possible in the FX version 😉). And, as this is basically just a search that is performed, we could consider that the "search term" will be automatically appended at the search field of the search bar. This could either educate the user how to formulate such searches manually - or confuse him 😉 This also might have been some side effects we should think about (e.g., if a "global search" is already active.

Siedlerchr added a commit that referenced this pull request Feb 8, 2017
* upstream/master:
  Fix error when path is no valid directory (#2527)
  French localization: translation of a string
  French menu: localization
  Highlight groups that match any/all of the entries selected in the main table. (#2515)
  Fix % sign cleanup (#2521)
  Revert "Fix repeated escaping of % sign" (#2520)
  Fix repeated escaping of % sign (#2519)
  fix for #2482 deadlock on PDF import (#2517)
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.

4 participants