Skip to content

Add more walkthroughs, donation prompt, and responsive layout for welcome tab #13679

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 17 commits into
base: main
Choose a base branch
from

Conversation

Yubo-Cao
Copy link
Collaborator

@Yubo-Cao Yubo-Cao commented Aug 10, 2025

Closes #12664

This PR introduces walkthroughs for add group and search in the library, responsive layout for welcome tab (to make sure the community links footer is always visible), and a donation popup to be shown 7 days after first launch, every 365 days.

Steps to test

  1. Open JabRef
  2. The updated welcome tab should be present.
    1. Resize the window to show responsive layout

    2. Click on the walkthroughs buttons to try them out

    3. Try out donation popup is rather challenging. Modify the code to add a button in the WelcomeTab is one possible way to perform this, as shown below:

      public WelcomeTab(Stage stage,
                        LibraryTabContainer tabContainer,
                        GuiPreferences preferences,
                        AiService aiService,
                        DialogService dialogService,
                        StateManager stateManager,
                        FileUpdateMonitor fileUpdateMonitor,
                        BibEntryTypesManager entryTypesManager,
                        CountingUndoManager undoManager,
                        ClipBoardManager clipBoardManager,
                        TaskExecutor taskExecutor,
                        FileHistoryMenu fileHistoryMenu,
                        BuildInfo buildInfo,
                        WorkspacePreferences workspacePreferences,
                        ThemeManager themeManager) {
          super(Localization.lang("Welcome"));
          setClosable(true);
          this.tabContainer = tabContainer;
          this.preferences = preferences;
          this.aiService = aiService;
          this.dialogService = dialogService;
          this.stateManager = stateManager;
          this.fileUpdateMonitor = fileUpdateMonitor;
          this.entryTypesManager = entryTypesManager;
          this.undoManager = undoManager;
          this.clipBoardManager = clipBoardManager;
          this.taskExecutor = taskExecutor;
          this.fileHistoryMenu = fileHistoryMenu;
          this.buildInfo = buildInfo;
          this.stage = stage;
          this.workspacePreferences = workspacePreferences;
          this.themeManager = themeManager;
          this.recentLibrariesBox = new VBox();
          recentLibrariesBox.getStyleClass().add("welcome-recent-libraries");
      
          Node titles = createTopTitles();
          Node communityBox = createCommunityBox();
          ScrollPane columnsScroll = createColumnsContainerScrollable();
      
          VBox mainStack = new VBox(titles, columnsScroll, communityBox);
          mainStack.getStyleClass().add("welcome-main-container");
          VBox.setVgrow(columnsScroll, Priority.ALWAYS);
      
          VBox container = new VBox(mainStack);
          container.setAlignment(Pos.CENTER);
      
          StackPane rootPane = new StackPane(container);
          setContent(rootPane);
      
          DonationProvider donationProvider = new DonationProvider(rootPane, preferences, dialogService);
          donationProvider.showIfNeeded();
      
          Button button = new Button("Test");
          button.setOnAction(_ -> donationProvider.showToast());
          rootPane.getChildren().add(button);
      }

      Or alternatively, if you are using Windows, Win+R and type in regedit to open the registry editor. Change the value of HKEY_CURRENT_USER\Software\JavaSoft\Prefs\org\jabref\donation/Last/Shown/Epoch/Day to 0 will trigger donation prompt to be shown upon launch.

You can find those feature demos here:

  1. Donation Prompt
  2. Responsive layout and additional walkthrough

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.

if (preferences.getDonationPreferences().isNeverShowAgain()) {
return;
}
int lastShown = preferences.getDonationPreferences().getLastShownEpochDay();
Copy link
Member

Choose a reason for hiding this comment

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

I would move the calculation to its own method with passing the preferences values as parameter, this allows you to create a simple test for it to verify the calculation

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added the calculateDaysUntilNextPopup

Copy link
Member

Choose a reason for hiding this comment

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

I think you forgot to push @Yubo-Cao

Copy link
Member

@Siedlerchr Siedlerchr left a comment

Choose a reason for hiding this comment

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

just a quick review, need to look more in detail

@subhramit
Copy link
Member

@Yubo-Cao Once you address comments, before marking them as resolved, a good way to check if you have forgotten to push changes is to see if the review window is marked "Outdated".

@Yubo-Cao
Copy link
Collaborator Author

Yubo-Cao commented Aug 13, 2025

@Yubo-Cao Once you address comments, before marking them as resolved, a good way to check if you have forgotten to push changes is to see if the review window is marked "Outdated".

Hi Subhramit! I'm sorry for the confusion. I was applying all the changes locally, but then I realized IntelliJ automatically closes the changes when I use the suggested changes.

@jabref-machine
Copy link
Collaborator

Note that your PR will not be reviewed/accepted until you have gone through the mandatory checks in the description and marked each of them them exactly in the format of [x] (done), [ ] (not done yet) or [/] (not applicable).

scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
scrollPane.getStyleClass().add("welcome-columns-scroll");
scrollPane.setStyle("-fx-background-color: transparent;"); // Using class selector is insufficient to prevent background from turning white on click.
Copy link

Choose a reason for hiding this comment

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

The comment restates what is obvious from the code and doesn't provide additional value or reasoning behind the implementation decision.

@jabref-machine
Copy link
Collaborator

Your code currently does not meet JabRef's code guidelines. We use Checkstyle to identify issues. 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 "Source Code Tests / Checkstyle (pull_request)" and click on it.

In case of issues with the import order, double check that you activated Auto Import. You can trigger fixing imports by pressing Ctrl+Alt+O to trigger Optimize Imports.

Please carefully follow the setup guide for the codestyle. Afterwards, please run checkstyle locally and fix the issues, commit, and push.

@subhramit
Copy link
Member

subhramit commented Aug 13, 2025

Hi Subhramit! I'm sorry for the confusion. I was applying all the changes locally, but then I realized IntelliJ automatically closes the changes when I use the suggested changes.

Hey, no issues.
Also, note that #13679 (comment) is not covered by any commit (so far) but marked resolved. If it is not feasible, you can respond to the comment.

Update: Check #13679 (comment) as well.

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.

Improve welcome page
4 participants