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

Groups only show 4 digit number of entries #8797

Closed
2 tasks done
ilippert opened this issue May 15, 2022 · 16 comments · Fixed by #9686
Closed
2 tasks done

Groups only show 4 digit number of entries #8797

ilippert opened this issue May 15, 2022 · 16 comments · Fixed by #9686
Assignees
Labels
bug Confirmed bugs or reports that are very likely to be bugs good first issue An issue intended for project-newcomers. Varies in difficulty. groups os: linux ui
Projects

Comments

@ilippert
Copy link

JabRef version

Other (please describe below)

Operating system

GNU / Linux

Details on version and operating system

JabRef 5.7--2022-05-15--a90ee23 Linux 5.17.6-300.fc36.x86_64 amd64 Java 18.0.1 JavaFX 18+12

Checked with the latest development build

  • I made a backup of my libraries before testing the latest development version.
  • I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

open a library with more than 9999 entries; the first digit is not shown on my system.

Appendix

Screenshot from 2022-05-15 15-56-15

@ThiloteE ThiloteE added bug Confirmed bugs or reports that are very likely to be bugs groups labels May 15, 2022
@ThiloteE ThiloteE added this to Normal priority in Bugs via automation May 15, 2022
@ThiloteE ThiloteE changed the title Group fiew only shows 4 digit numer of entries Groups only shows 4 digit numer of entries May 15, 2022
@ThiloteE ThiloteE changed the title Groups only shows 4 digit numer of entries Groups only show 4 digit numer of entries May 15, 2022
@Siedlerchr Siedlerchr added the ui label May 15, 2022
@ThiloteE ThiloteE changed the title Groups only show 4 digit numer of entries Groups only show 4 digit number of entries May 15, 2022
@LIM0000
Copy link
Contributor

LIM0000 commented May 16, 2022

JabRef version

Latest main development branch c38d18b

Operating system

Windows

Details on version and operating system

Windows 10

ss

It looks good with JabRef in Window 10.

@ilippert
Copy link
Author

On

JabRef 5.7--2022-06-12--e3b2ab2
Linux 5.17.13-300.fc36.x86_64 amd64
Java 18.0.1
JavaFX unknown

Fedora 36 it is still a problem

@ThiloteE
Copy link
Member

@LIM0000 would you mind sharing your database with 16 760 entries? :D

@Siedlerchr
Copy link
Member

Siedlerchr commented Jun 16, 2022

@ThiloteE
Copy link
Member

How can I run the script?

@LIM0000
Copy link
Contributor

LIM0000 commented Jun 16, 2022

Hi @ThiloteE , you can

  1. download python 3 from here https://www.python.org/downloads/.
  2. install latest version of python 3 to your system
  3. create a file name bib-file-generator.py using notepad and copy all the lines from https://github.com/JabRef/jabref/blob/main/scripts/bib-file-generator.py into your file
  4. Open terminal and command python3 bib-file-generator.py

Additional note:
Please navigate to bib-file-generator.py directory using cd command, otherwise absolute path might be needed.

Hope this helps.

@ThiloteE
Copy link
Member

ThiloteE commented Jun 17, 2022

Thanks for the help! :-)

Can confirm: The problem can be observed on Linux Mint (Cinnamon) 20.3 as well using the portable version of JabRef.
@Siedlerchr what about mac?

@Siedlerchr
Copy link
Member

Siedlerchr commented Jun 17, 2022

Can confirm: Might be also related to the screen resolution
grafik

Probably the size calculation needs to be adjusted:

numberColumn = new TreeTableColumn<>();
numberColumn.getStyleClass().add("numberColumn");
numberColumn.setMinWidth(40d);
numberColumn.setMaxWidth(40d);
numberColumn.setPrefWidth(40d);
numberColumn.setResizable(false);

@ThiloteE ThiloteE added the good first issue An issue intended for project-newcomers. Varies in difficulty. label Jul 13, 2022
@theshashankpal
Copy link

Hi @ThiloteE ,
I am a student who needs to contribute to an OpenSource project in my coursework, so I was wondering if you can assign this to me.
This issue seems to be a good initiation of my journey towards contribution to FOSS projects.
Can you please assign this to me?

@ThiloteE
Copy link
Member

Yes you can :-)

As a general advice: Check out https://github.com/JabRef/jabref/blob/main/CONTRIBUTING.md for a start. Also, https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace is worth having a look at. Feel free to ask if you have any questions here on GitHub or also at JabRef's Gitter chat.

Try to open a (draft) pull request early on, so that people can see you are working on the issue and so that they can see the direction the pull request is heading towards. This way, you will likely receive valuable feedback.

@Siedlerchr
Copy link
Member

In yesterday's mob programming session, we could reproduce the behavior by changing the font size in the preferences (Appearance → Override default font size)

Very likely this method needs to be adjusted

// Number of hits (only if user wants to see them)
PseudoClass anySelected = PseudoClass.getPseudoClass("any-selected");
PseudoClass allSelected = PseudoClass.getPseudoClass("all-selected");
new ViewModelTreeTableCellFactory<GroupNodeViewModel>()
.withGraphic(group -> {
final StackPane node = new StackPane();
node.getStyleClass().setAll("hits");
if (!group.isRoot()) {
BindingsHelper.includePseudoClassWhen(node, anySelected,
group.anySelectedEntriesMatchedProperty());
BindingsHelper.includePseudoClassWhen(node, allSelected,
group.allSelectedEntriesMatchedProperty());
}
Text text = new Text();
EasyBind.subscribe(preferencesService.getGroupsPreferences().displayGroupCountProperty(),
(newValue) -> {
if (text.textProperty().isBound()) {
text.textProperty().unbind();
text.setText("");
}
if (newValue) {
text.textProperty().bind(group.getHits().asString());
}
});
text.getStyleClass().setAll("text");
node.getChildren().add(text);
node.setMaxWidth(Control.USE_PREF_SIZE);
return node;
})
.install(numberColumn);

@alescrocaro
Copy link

Hey @Siedlerchr, we solved this here, for a university project. Could you take a look?

@Siedlerchr
Copy link
Member

Note. The issue is not solved. I tried to check some options and the font size is set correctly for the text, I tried the following but did not succeed:

   if(group.isRoot()) {
                                        EasyBind.subscribe(group.getHits(), (val)-> {
                                            double width = text.getBoundsInLocal().getWidth();
                                            node.setMaxWidth(width);
                                            node.setPrefWidth(width);
                                        });
                                    }

@sambhav97
Copy link

Hi, can I work on this issue if it's still open?

@Siedlerchr
Copy link
Member

@sambhav97 Yes, make sure to read through the thread. Easiest way to reproduce: Change the font size in the preferences -> Appearance -> Override default font size. Change to e.g. 12

@calixtus
Copy link
Member

Hint: Controls should be sized in relation to the base font size of the main application window. See the documentation on jfx css measure units: https://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html#typelength

vigneshdurairaj added a commit to vigneshdurairaj/jabref that referenced this issue Mar 22, 2023
calixtus pushed a commit that referenced this issue Mar 22, 2023
* Adding text formatting for hits

* Bug fix on issue 8797, by decreasing the font-size at the breakpoints

* Adding entry for issue #8797 in changelog

* Shortened the changelog
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 good first issue An issue intended for project-newcomers. Varies in difficulty. groups os: linux ui
Projects
Archived in project
Archived in project
Bugs
  
Normal priority
8 participants