Skip to content

Add initial implementation of walkthrough #13182

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

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

Yubo-Cao
Copy link
Contributor

@Yubo-Cao Yubo-Cao commented May 29, 2025

Closes N/A

Initial implementation of the walkthrough feature. See this Google Drive video for demonstration: https://drive.google.com/file/d/19sUz1XoSjP0UkuhUvKQE-MZjmVASy2ot/view?usp=sharing

The completion of the walkthrough is also tracked through modifying the preferences class.

This refs #12664

Mandatory checks

  • I own the copyright of the code submitted and I license it under the MIT license
  • Change in CHANGELOG.md described in a way that is understandable for the average user (if change is visible to the user)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (if change is visible to the user)
  • 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.

private final Pane rootPane;
private Node attachedNode;

private final List<Runnable> cleanupTasks = new ArrayList<>();
Copy link

Choose a reason for hiding this comment

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

Using ArrayList for cleanupTasks is not optimal. Consider using List.of() for creating an empty list, which is more efficient and aligns with JabRef's conventions.

Copy link
Member

@calixtus calixtus Jun 2, 2025

Choose a reason for hiding this comment

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

Should be at least commented.

Suggested change
private final List<Runnable> cleanupTasks = new ArrayList<>();
private final List<Runnable> cleanupTasks = new ArrayList<>(); // needs a mutable list

@@ -113,5 +113,7 @@ public interface CliPreferences {

LastFilesOpenedPreferences getLastFilesOpenedPreferences();

WalkthroughPreferences getWalkthroughPreferences();
Copy link

Choose a reason for hiding this comment

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

The new method 'getWalkthroughPreferences' should not return 'null'. It should use 'java.util.Optional' to handle the absence of a value, ensuring better null safety and avoiding potential null pointer exceptions.

@Siedlerchr
Copy link
Member

So far I like the idea.
Discussion points for Friday would be:

  • How many steps we want
  • Going back one step?
  • content of the steps
  • Additional steps like adding stuff to groups or creating a new entry or library

@koppor
Copy link
Member

koppor commented May 30, 2025

This refs #12664 somehow :)

@JabRef JabRef deleted a comment from jabref-machine May 30, 2025
import org.slf4j.LoggerFactory;

/**
* Chooses the main directory for storing and searching PDF files in JabRef.
Copy link
Member

Choose a reason for hiding this comment

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

What does this have to do with the walkthrough? Stay focused on your project. Don't do any side issues that are not related with your project.

Copy link
Member

@subhramit subhramit Jun 6, 2025

Choose a reason for hiding this comment

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

@calixtus I think configuration of a paper directory was the first point in the description of the project statement in the wiki page, and also mentioned in the issue.

That being said, whether or not that should be a part of "this" PR is worth discussing.

Copy link
Member

Choose a reason for hiding this comment

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

Please separate the prs. One thing is welcome walkthrough, the other is enhancements to welcome tab. And finish one first.

Comment on lines +300 to +302
if (!preferences.getWalkthroughPreferences().isCompleted()) {
mainFrame.showWalkthrough();
}
Copy link

Choose a reason for hiding this comment

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

The code directly accesses preferences to check walkthrough completion. This logic should be moved to org.jabref.logic to maintain a clean separation between GUI and logic layers.

private static final Color OVERLAY_COLOR = Color.rgb(0, 0, 0, 0.55);

private final Pane pane;
private Node targetNode;
Copy link

Choose a reason for hiding this comment

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

The targetNode field is set to null in the detach method, which can lead to null pointer exceptions if accessed without checks. Consider using Optional to handle absence of a node.

Copy link

trag-bot bot commented Jun 6, 2025

@trag-bot didn't find any issues in the code! ✅✨

1 similar comment
Copy link

trag-bot bot commented Jun 6, 2025

@trag-bot didn't find any issues in the code! ✅✨

@jabref-machine
Copy link
Collaborator

JUnit tests of jablib are failing. You can see which checks are failing by locating the box "Some checks were not successful" on the pull request page. To see the test output, locate "Tests / Unit tests (pull_request)" and click on it.

You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide.

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.

6 participants