-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Implementation of walkthrough infrastructure #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
Conversation
jabgui/src/main/java/org/jabref/gui/util/component/PulseAnimateIndicator.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/walkthrough/WalkthroughManager.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/walkthrough/WalkthroughManager.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/walkthrough/declarative/InfoBlockContentBlock.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/walkthrough/declarative/StepType.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/walkthrough/declarative/WalkthroughContentBlock.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/walkthrough/declarative/WalkthroughStep.java
Outdated
Show resolved
Hide resolved
So far I like the idea.
|
This refs #12664 somehow :) |
jabgui/src/main/java/org/jabref/gui/walkthrough/WalkthroughManager.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/walkthrough/WalkthroughUIFactory.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/walkthrough/declarative/NodeResolverFactory.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/walkthrough/WalkthroughOverlay.java
Outdated
Show resolved
Hide resolved
jablib/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/walkthrough/WalkthroughOverlay.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/walkthrough/Walkthrough.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/walkthrough/WalkthroughOverlay.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/walkthrough/WalkthroughOverlay.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/walkthrough/declarative/NodeResolverFactory.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/walkthrough/declarative/TextContentBlock.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/walkthrough/Walkthrough.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/walkthrough/Walkthrough.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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.
jabgui/src/main/java/org/jabref/gui/walkthrough/SingleWindowWalkthroughOverlay.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/walkthrough/SingleWindowWalkthroughOverlay.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/walkthrough/Walkthrough.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/walkthrough/WalkthroughAction.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/walkthrough/Walkthrough.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Subhramit Basu <subhramit.bb@live.in>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some small nits when reading otherwise lgtm
CompletableFuture<Void> timeoutFuture = CompletableFuture.runAsync(() -> { | ||
try { | ||
Thread.sleep(HANDLER_TIMEOUT_MS); | ||
} catch (InterruptedException e) { | ||
Thread.currentThread().interrupt(); | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this entire class could make use of some more javadoc - I sense high cognitive load on if someone wants to work on this in future. Things like, why we are using a completable future, etc.
But these refinements can be done in future, we can get this in and start focusing on the next steps.
.filter(menuItem -> Optional.ofNullable(menuItem.getGraphic()) | ||
.map(graphic -> graphic.equals(node) | ||
|| Stream.iterate(graphic, Objects::nonNull, Node::getParent) | ||
.anyMatch(cm -> cm.equals(node))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I am not wrong on the expansion:
.filter(menuItem -> Optional.ofNullable(menuItem.getGraphic()) | |
.map(graphic -> graphic.equals(node) | |
|| Stream.iterate(graphic, Objects::nonNull, Node::getParent) | |
.anyMatch(cm -> cm.equals(node))) | |
.filter(menuItem -> Optional.ofNullable(menuItem.getGraphic()) | |
.map(graphic -> graphic.equals(node) | |
|| Stream.iterate(graphic, Objects::nonNull, Node::getParent) | |
.anyMatch(contextMenu -> contextMenu.equals(node))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch
@Yubo-Cao please apply suggestions from @subhramit , then we merge. |
@trag-bot didn't find any issues in the code! ✅✨ |
event.consume(); | ||
beforeNavigate.run(); | ||
|
||
CompletableFuture<Void> handlerFuture = new CompletableFuture<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable is never read? -> always handlerFtuure.complete(null) passed. What is the intention?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The intention is that we run onNavigate after the original handler has completed, or a timeout has occurred, or a new window has been created, whichever comes first. To allow for such checking, the handler's future is used more as a signal to indicate that the original handler has finished.
/// @param event the event to navigate | ||
static <T extends Event> void navigate( | ||
Runnable beforeNavigate, | ||
EventHandler<? super T> originalHandler, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Annotate with @Nullable
(the other ones are non-null, aren't they?)
/// - The handler has timed out after HANDLER_TIMEOUT_MS milliseconds. | ||
/// - A new window has been opened, or an existing window has been closed. | ||
/// | ||
/// Those conditions ensure that we will still navigate if original handler is blocking (e.g., showing a dialog, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"These" conditions
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
CHANGELOG.md
described in a way that is understandable for the average user (if change is visible to the user)