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

Open
wants to merge 57 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.

@@ -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
@Yubo-Cao Yubo-Cao requested a review from calixtus June 20, 2025 21:43
@subhramit
Copy link
Member

@Yubo-Cao can you fix the failing tests - should be simple, both are related to localization.

Copy link
Member

@calixtus calixtus left a comment

Choose a reason for hiding this comment

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

First half of first iteration through review. More to come on the weekend.

int currentIndex = walkthrough.currentStepProperty().get();

for (int i = currentIndex - 1; i >= 0; i--) {
WalkthroughStep previousStep = walkthrough.getStepAtIndex(i);
Copy link
Member

Choose a reason for hiding this comment

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

Why would dealing with an optional here force you to do something incorrect?

private final Stage stage;
private final WalkthroughHighlighter walkthroughHighlighter;
private final Walkthrough walkthrough;
private @Nullable Timeline nodePollingTimeline;
Copy link
Member

Choose a reason for hiding this comment

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

Im not yet convinced that we have to do polling and that this is not solvable by an event being fired by javafx. Polling takes unnecessary resources.

*/
public class WalkthroughUpdater {
private final List<Runnable> cleanupTasks = new ArrayList<>(); // has to be mutable
private final Timeline updateTimeline = new Timeline();
Copy link
Member

Choose a reason for hiding this comment

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

About polling...

overlay.displayStep(step);
}

public WalkthroughStep getStepAtIndex(int index) {
Copy link
Member

Choose a reason for hiding this comment

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

What If I call it with -1?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Array index out of bounds.

Co-authored-by: Subhramit Basu <subhramit.bb@live.in>
Copy link

trag-bot bot commented Jun 28, 2025

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

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.

5 participants