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

Dark Theme : Search -> Import entries dialog text not readable #7927

Closed
Siedlerchr opened this issue Jul 19, 2021 · 28 comments · Fixed by #8929
Closed

Dark Theme : Search -> Import entries dialog text not readable #7927

Siedlerchr opened this issue Jul 19, 2021 · 28 comments · Fixed by #8929
Assignees
Labels
good first issue An issue intended for project-newcomers. Varies in difficulty. ui

Comments

@Siedlerchr
Copy link
Member

Latest JabRef version from main.

  1. Have Dark Theme enabled
  2. Search for an entry in the web search
  3. Import entries window opens
  4. See the color of the abstract text is black

Bildschirmfoto 2021-07-19 um 21 27 49

@Siedlerchr Siedlerchr added ui good first issue An issue intended for project-newcomers. Varies in difficulty. labels Jul 19, 2021
@k3KAW8Pnf7mkmdSMPHz27
Copy link
Member

Good starting points are,

  1. https://github.com/JabRef/jabref/blob/main/src/main/java/org/jabref/gui/Base.css, the default theme, where most of our .css are stored.
  2. https://github.com/JabRef/jabref/blob/main/src/main/java/org/jabref/gui/Dark.css, which is where changes most likely should be made.

@calvinmorett
Copy link

@k3KAW8Pnf7mkmdSMPHz27 is there process I can do to so that I can make a browser-inspectable mock up of this entry section? Specifically, looking to bring it into the browser so I can use the inspect tools, to see what variables are targeted/attached here from the dark.css.

@Siedlerchr
Copy link
Member Author

@calvinmorett Have a look at the sceniv view tool https://github.com/JonathanGiles/scenic-view
You bascially start JabRef, then scenic view and then you can inspect the gui

@calvinmorett
Copy link

calvinmorett commented Jul 21, 2021

@Siedlerchr Stuck on the dialog "Scanning for JavaFX application" in scenic view, JabRef never registers. Troubleshooting atm, any suggestions are certainly appreciated, thanks.

Platform running
Launching ScenicView v11.0.2
Startup done
Creating server
Server done
Number of running Java applications found: 2
Error while obtaining properties for JVM:sun.tools.attach.AttachProviderImpl@10c745f: 8280 org.jabref/org.jabref.gui.JabRefLauncher
java.io.IOException: Access is denied
        at jdk.attach/sun.tools.attach.VirtualMachineImpl.openProcess(Native Method)
        at jdk.attach/sun.tools.attach.VirtualMachineImpl.<init>(Unknown Source)
        at jdk.attach/sun.tools.attach.AttachProviderImpl.attachVirtualMachine(Unknown Source)
        at jdk.attach/com.sun.tools.attach.spi.AttachProvider.attachVirtualMachine(Unknown Source)
        at jdk.attach/com.sun.tools.attach.VirtualMachine.attach(Unknown Source)
        at org.scenicview.scenicview/org.fxconnector.remote.RemoteConnectorImpl.getRunningJavaFXApplications(Unknown Source)
        at org.scenicview.scenicview/org.fxconnector.remote.RemoteConnectorImpl.connect(Unknown Source)
        at org.scenicview.scenicview/org.scenicview.model.update.RemoteVMsUpdateStrategy.getActiveApps(Unknown Source)
        at org.scenicview.scenicview/org.scenicview.model.update.RemoteVMsUpdateStrategy.work(Unknown Source)
        at org.scenicview.scenicview/org.fxconnector.helper.WorkerThread.run(Unknown Source)
0 JavaFX applications found

Edit:
Resolved issues above, needed to fix environment variables for Java lib to bin
and install JDK.

Platform running
Launching ScenicView v11.0.2
Startup done
Creating server
Server done
Number of running Java applications found: 0
0 JavaFX applications found
Loading agent from: C:\Users\ideas\Documents\sv\scenicview\lib\scenicview.jar

But now, it's not showing any applications. Will keep troubleshooting.

@k3KAW8Pnf7mkmdSMPHz27
Copy link
Member

You might have to check if there is a workaround for Java 16

Scenic View will detect JavaFX applications running on Java 9, 10 or 11.

There is also JonathanGiles/scenic-view#56

@k3KAW8Pnf7mkmdSMPHz27
Copy link
Member

@Siedlerchr do you have any experience with loading .css into the scene-builder? (I.e., do you know if it is possible/a good idea)

@Siedlerchr
Copy link
Member Author

I got it to work when I start jabref from eclipse, guess because the release version is stripped out of some debug modules or whatever
grafik

@k3KAW8Pnf7mkmdSMPHz27
Copy link
Member

Yup. I have cloned both Scenic View and JabRef and are building them from the Gradle projects in IntelliJ, which also seem to work. Might be overkill.

@calvinmorett how do you run JabRef? (or have you gotten it working through some other means?)

Skärmavbild 2021-07-21 kl  16 33 55

@calvinmorett
Copy link

Still troubleshooting,

@k3KAW8Pnf7mkmdSMPHz27 @calvinmorett how do you run JabRef? (or have you gotten it working through some other means?)

I just run the application, JabRef.exe. Could this be the reason why scenic-view isn't picking up on it?

@k3KAW8Pnf7mkmdSMPHz27
Copy link
Member

It doesn't pick it up when I run JabRef.app, I guess .exe is the same

@calvinmorett
Copy link

Installed eclipse, will try that next.

@Siedlerchr
Copy link
Member Author

./gradlew run should also work. See the devoloper docs how to setup your development environment

@calvinmorett
Copy link

calvinmorett commented Jul 22, 2021

@Siedlerchr any references for good eclipse documentation so I can get that started?

Went back to trying the exe again after installing JDK, at version 10.

Currently, SV is registering 2 java applications, but no JavaFX applications when running scenicview.bat after starting JabRef.exe.

Platform running
Launching ScenicView v11.0.2
Startup done
Creating server
Server done
Number of running Java applications found: 2
Error while obtaining properties for JVM:sun.tools.attach.AttachProviderImpl@186067bb: 12076 org.jabref/org.jabref.gui.JabRefLauncher
java.io.IOException: Access is denied
        at jdk.attach/sun.tools.attach.VirtualMachineImpl.openProcess(Native Method)
        at jdk.attach/sun.tools.attach.VirtualMachineImpl.<init>(Unknown Source)
        at jdk.attach/sun.tools.attach.AttachProviderImpl.attachVirtualMachine(Unknown Source)
        at jdk.attach/com.sun.tools.attach.spi.AttachProvider.attachVirtualMachine(Unknown Source)
        at jdk.attach/com.sun.tools.attach.VirtualMachine.attach(Unknown Source)
        at org.scenicview.scenicview/org.fxconnector.remote.RemoteConnectorImpl.getRunningJavaFXApplications(Unknown Source)
        at org.scenicview.scenicview/org.fxconnector.remote.RemoteConnectorImpl.connect(Unknown Source)
        at org.scenicview.scenicview/org.scenicview.model.update.RemoteVMsUpdateStrategy.getActiveApps(Unknown Source)
        at org.scenicview.scenicview/org.scenicview.model.update.RemoteVMsUpdateStrategy.work(Unknown Source)
        at org.scenicview.scenicview/org.fxconnector.helper.WorkerThread.run(Unknown Source)
0 JavaFX applications found

@Siedlerchr
Copy link
Member Author

@calvinmorett https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace
I recommend Intellij as the Eclipse formatter has some problems.

You start scenic view from the folder bin\scenivew.bat it already ships with a jdk.
You probably need to modify the line to:

pushd %DIR% & %JAVA_EXEC% -m org.scenicview.scenicview/org.scenicview.ScenicView --add-opens java.base/java.instrument=ALL-UNNAMED %* & popd

@calvinmorett
Copy link

calvinmorett commented Jul 22, 2021

Okay, I haven't installed Intellij yet, but did make the .bat file change that you suggested. That change did seem to register JabRef as a JavaFX application in the log, but still kept showing scanning in the UI in SV.

image

Platform running
Launching ScenicView v11.0.2
Startup done
Creating server
Server done
Number of running Java applications found: 2
Obtaining properties for Java application with PID:2780
1 JavaFX applications found
Loading agent from: C:\Users\ideas\Documents\sv\scenicview\lib\scenicview.jar
Loading agent for:sun.tools.attach.AttachProviderImpl@3b8611da: 2780 ID:2780 on port:7559 took:107ms using agent defined in C:\Users\ideas\Documents\sv\scenicview\lib\scenicview.jar
com.sun.tools.attach.AgentLoadException: Failed to load agent library: java.lang.module.FindException: Module java.instrument not found
        at jdk.attach/sun.tools.attach.VirtualMachineImpl.execute(Unknown Source)
        at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.loadAgentLibrary(Unknown Source)
        at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.loadAgentLibrary(Unknown Source)
        at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.loadAgent(Unknown Source)
        at org.scenicview.scenicview/org.fxconnector.remote.RemoteConnectorImpl.loadAgent(Unknown Source)
        at org.scenicview.scenicview/org.fxconnector.remote.RemoteConnectorImpl.access$200(Unknown Source)
        at org.scenicview.scenicview/org.fxconnector.remote.RemoteConnectorImpl$3.run(Unknown Source)
com.sun.tools.attach.AgentLoadException: Failed to load agent library: java.lang.module.FindException: Module java.instrument not found
        at jdk.attach/sun.tools.attach.VirtualMachineImpl.execute(Unknown Source)
        at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.loadAgentLibrary(Unknown Source)
        at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.loadAgentLibrary(Unknown Source)
        at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.loadAgent(Unknown Source)
        at org.scenicview.scenicview/org.fxconnector.remote.RemoteConnectorImpl.loadAgent(Unknown Source)
        at org.scenicview.scenicview/org.fxconnector.remote.RemoteConnectorImpl.access$200(Unknown Source)
        at org.scenicview.scenicview/org.fxconnector.remote.RemoteConnectorImpl$3.run(Unknown Source)
com.sun.tools.attach.AgentLoadException: Failed to load agent library: java.lang.module.FindException: Module java.instrument not found
        at jdk.attach/sun.tools.attach.VirtualMachineImpl.execute(Unknown Source)
        at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.loadAgentLibrary(Unknown Source)
        at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.loadAgentLibrary(Unknown Source)
        at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.loadAgent(Unknown Source)
        at org.scenicview.scenicview/org.fxconnector.remote.RemoteConnectorImpl.loadAgent(Unknown Source)
        at org.scenicview.scenicview/org.fxconnector.remote.RemoteConnectorImpl.access$200(Unknown Source)
        at org.scenicview.scenicview/org.fxconnector.remote.RemoteConnectorImpl$3.run(Unknown Source)
....

Attempted to run JabRef.bat which does display a warning message related to JavaFX, Unsupported JavaFX configuration:

ERROR StatusLogger Unrecognized format specifier [d]
ERROR StatusLogger Unrecognized conversion specifier [d] starting at position 16 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [thread]
ERROR StatusLogger Unrecognized conversion specifier [thread] starting at position 25 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [level]
ERROR StatusLogger Unrecognized conversion specifier [level] starting at position 35 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [logger]
ERROR StatusLogger Unrecognized conversion specifier [logger] starting at position 47 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [msg]
ERROR StatusLogger Unrecognized conversion specifier [msg] starting at position 54 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [n]
ERROR StatusLogger Unrecognized conversion specifier [n] starting at position 56 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [d]
ERROR StatusLogger Unrecognized conversion specifier [d] starting at position 16 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [thread]
ERROR StatusLogger Unrecognized conversion specifier [thread] starting at position 25 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [level]
ERROR StatusLogger Unrecognized conversion specifier [level] starting at position 35 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [logger]
ERROR StatusLogger Unrecognized conversion specifier [logger] starting at position 47 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [msg]
ERROR StatusLogger Unrecognized conversion specifier [msg] starting at position 54 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [n]
ERROR StatusLogger Unrecognized conversion specifier [n] starting at position 56 in conversion pattern.
Jul 22, 2021 1:52:15 PM com.sun.javafx.application.PlatformImpl startup
WARNING: Unsupported JavaFX configuration: classes were loaded from 'module org.jabref.merged.module', isAutomatic: false, isOpen: true

@Siedlerchr
Copy link
Member Author

Try running JabRef with ./gradlew run in the source folder where you cloned the project source code repo.
You need to have jdk16 installed (as noted in the docs)

@calvinmorett
Copy link

calvinmorett commented Jul 22, 2021

Did ./gradlew run
it finished, and opened jabref at 92%

18:37:12.370 [pool-4-thread-1] WARN  org.jabref.logic.net.URLDownload - Fix SSL exceptions by accepting ALL ce18:37:41.659 [JavaFX Application Thread] INFO  org.jabref.gui.util.Theme - Enabling live reloading of css file C:\Users\ideas\git\jabref\build\resources\main\org\jabref\gui\Base.css
18:38:04.869 [JavaFX Application Thread] INFO  org.jabref.gui.util.Theme - Enabling live reloading of css file C:\Users\ideas\git\jabref\build\resources\main\org\jabref\gui\Base.css
18:38:14.447 [JavaFX Application Thread] INFO  org.jabref.gui.util.Theme - Enabling live reloading of css file C:\Users\ideas\git\jabref\build\resources\main\org\jabref\gui\Base.css
18:38:14.448 [JavaFX Application Thread] INFO  org.jabref.gui.util.Theme - Enabling live reloading of css file C:\Users\ideas\git\jabref\build\resources\main\org\jabref\gui\Dark.css
18:38:17.033 [JavaFX Application Thread] INFO  org.jabref.gui.JabRefDialogService - Preferences recorded.
<============-> 92% EXECUTING [5m `19s]

I then tried running scenic view and got 0 applications.

Platform running
Launching ScenicView v11.0.2
Startup done
Creating server
Server done
Number of running Java applications found: 0
0 JavaFX applications found
Loading agent from: C:\Users\ideas\Documents\sv\scenicview\lib\scenicview.jar

I'm able to edit the dark.css and then run the build to see the changes, but I have to do it every time to see changes. This seems very tedious for changing a couple color values.

@calvinmorett
Copy link

calvinmorett commented Jul 23, 2021

While not the fastest approach, but certainly faster than rebuilding every time; I've decided to add a new CSS style sheet to pull into JabRef, and go individually through each variable. I can then identify ambiguously named variables and to see where variables are being assigned in the UI.

image

I've found the prime cause of why dark mode search items are difficult to read in the variable -fx-light-text-color. It causes a problem because in the search results, it is being used for both non-selected/non-active items, while also being used for selected & active items.

image

As you can see, the orange text color of the search result titles, for both active and non-active items, as detailed above.

A solution -- where the text remains the same color in both instances -- could be, to set the background of selected and non-selected items, close in color value. Something where we can still maintains a suitable contrast with a font color that remains static.

@Siedlerchr Please assign me this issue.

@Siedlerchr
Copy link
Member Author

Siedlerchr commented Jul 23, 2021

I guess we need to have a different color for active/inactive that should be possible with the pseudo classes active/inactive

@calvinmorett
Copy link

calvinmorett commented Jul 25, 2021

Issue: Currently, the body text of the search results are being set through some other variable not currently set in the CSS.

@Siedlerchr Are you going to set specific classes for the queries results or should we target the current with pseudo classes?

Either way, would it be possible for you to provide the classes?

@Siedlerchr
Copy link
Member Author

Maybe @calixtus has an idea

@k3KAW8Pnf7mkmdSMPHz27
Copy link
Member

Isn't it set by one of the “base” colors? (see the base.css file)

I am not sure what you have tried/not but it is likely easier to explore the CSS in that file as it is more complete. (unless you have already tried that)

@calvinmorett
Copy link

@k3KAW8Pnf7mkmdSMPHz27 current approach was to add a custom stylesheet. The way that worked was I was able to edit most things and see the change in real time to then add comments to what was being affected by the CSS classes I was sort of editing.

I haven't considered until now pulling in all the base.css styles into the custom stylesheet, thanks for the excellent suggestion though it will not help me targeting this specific element without going through each element it contains.

Even after doing just that, I haven't found the CSS style that controls result summary text.

image

@k3KAW8Pnf7mkmdSMPHz27 k3KAW8Pnf7mkmdSMPHz27 removed the good first issue An issue intended for project-newcomers. Varies in difficulty. label Aug 8, 2021
@k3KAW8Pnf7mkmdSMPHz27
Copy link
Member

@calvinmorett not sure if you are still looking at this issue but perhaps these two links are relevant,

  1. https://stackoverflow.com/questions/47562036/javafx-textflow-set-default-text-color , in this case, perhaps TextFlowLimited > Text is a usable selector (based on Scenic-View and the above link). It can at least set the text to a static color using -fx-fill.
  2. Based on https://stackoverflow.com/questions/60488426/change-font-color-in-javafx-via-css-file , could it be that the background color doesn't exist/isn't properly propagated? I'd guess that ladder (from the JFX CSS) should deal with the different background colors correctly?

Otherwise, perhaps the :entry-selected pseudo-class can be "re-used"?

@koppor koppor added the good first issue An issue intended for project-newcomers. Varies in difficulty. label Sep 22, 2021
@victordmp
Copy link
Contributor

Hi, we are a group of students studying Computer Science at Universidade Tecnologica Federal do Paraná (UTFPR) and we wanted to check if this issue is available for us to work on in our free software discipline task. And if it's available, we'd like to get some valuable input based on previous contributions to this edition.

@calixtus
Copy link
Member

I believe it's free to work on. Last edit on this this issue is almost a year old.

@ThiloteE
Copy link
Member

Hello @victordmp :-) Thanks for your interest and your groups intention to work on JabRef.

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.

euEmica added a commit to victordmp/jabref that referenced this issue Jun 22, 2022
victordmp added a commit to victordmp/jabref that referenced this issue Jun 26, 2022
victordmp added a commit to victordmp/jabref that referenced this issue Jun 26, 2022
@sorattorafa
Copy link

@Siedlerchr Please, can u assign this issue to @victordmp ?

@ThiloteE ThiloteE assigned victordmp and unassigned calvinmorett Jun 27, 2022
Siedlerchr pushed a commit that referenced this issue Jun 27, 2022
* changed background color entry-selected (#7927)

* chaged color summary text select active/inactive (#7927)

* resolved threads (#7927)

* update CHANGELOG

Co-authored-by: euEmica <emica.costa1749@gmail.com>
Co-authored-by: Victor Daniel <victor.pires@appmoove.com.br>
@ThiloteE ThiloteE moved this from Free to take to Done in Candidates for University Projects Jun 30, 2022
@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
good first issue An issue intended for project-newcomers. Varies in difficulty. ui
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

8 participants