Skip to content

Conversation

robfrank
Copy link
Collaborator

@robfrank robfrank commented Jul 2, 2025

Related issues

#2323

Checklist

  • I have run the build using mvn clean package command
  • My unit tests cover both failure and success scenarios

@robfrank robfrank requested a review from gramian July 2, 2025 11:39
@robfrank robfrank added the javascript Pull requests that update Javascript code label Jul 2, 2025
@robfrank robfrank added this to the 25.6.1 milestone Jul 2, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @robfrank, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily focuses on fixing and improving the application's notification system by migrating it to the Notyf library. The changes include refactoring the notification logic for better reliability and introducing a new end-to-end test to ensure the system functions as expected, addressing a previously reported issue with notifications not appearing correctly.

Highlights

  • Notification System Migration: The existing notification system has been refactored to utilize the Notyf library, replacing the previous implementation (likely Bootstrap Notify) to address reliability issues.
  • Robust Notyf Initialization: Notyf initialization has been moved to occur within a DOMContentLoaded event listener in index.html to prevent race conditions and ensure the notyf instance is available when needed. This resolves potential 'not initialized' JavaScript errors.
  • Deferred Notification Handling: The globalNotify function now includes a check to ensure the Notyf instance is initialized before attempting to display a notification. If Notyf is not yet ready, the notification call is deferred using a setTimeout to prevent messages from being lost.
  • New End-to-End Test: A new Playwright end-to-end test (notification-test.spec.ts) has been added to validate the functionality of the updated notification system. This test specifically checks for the display of error notifications and logs any related JavaScript errors.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request refactors the notification system to use Notyf, addressing an initialization issue. The review focuses on enhancing the robustness of the fix and the associated test. It suggests a more reliable queuing mechanism for handling notifications and points out issues with the test's selectors and assertions.

await page.getByRole('button', { name: '' }).first().click();

// Wait a moment for the query to execute and error to appear
await page.waitForTimeout(2000);
Copy link
Contributor

Choose a reason for hiding this comment

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

high

Using waitForTimeout can lead to flaky tests as the wait time is fixed. It's a better practice to wait for a specific condition or element state. Since this PR fixes notifications, you should wait for the notification to appear. This would also serve as a good assertion that the fix is working.

Suggested change
await page.waitForTimeout(2000);
// Wait for the error notification to be visible
await expect(page.locator('.notyf__toast--error')).toBeVisible();

Copy link

codacy-production bot commented Jul 2, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+1.15%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (06792a7) 70558 44543 63.13%
Head commit (775ff3b) 70558 (+0) 45354 (+811) 64.28% (+1.15%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#2327) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@gramian
Copy link
Collaborator

gramian commented Jul 2, 2025

  • Notification work again
  • New notification look beautiful
  • No notification related errors in console

Superb!

Minor or unrelated remarks:

  • Notification modals cannot be closed (via the x-button), but that was the case before too.
  • There is still a tooltip error in the console.

@robfrank robfrank merged commit 6a4ddad into main Jul 2, 2025
18 of 24 checks passed
robfrank added a commit that referenced this pull request Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants