Skip to content

feat(stage-capacitor): add notification capability, and a devtool#855

Merged
nekomeowww merged 2 commits intomainfrom
lemonnekogh/devtools-notification
Dec 31, 2025
Merged

feat(stage-capacitor): add notification capability, and a devtool#855
nekomeowww merged 2 commits intomainfrom
lemonnekogh/devtools-notification

Conversation

@LemonNekoGH
Copy link
Member

No description provided.

@LemonNekoGH LemonNekoGH self-assigned this Dec 31, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @LemonNekoGH, 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 introduces the ability for the Capacitor application to utilize local notifications. It sets up the necessary plugin dependencies, provides a dedicated developer tool for testing notification functionality, and ensures that the application's build configurations are aligned with the new feature. This enhancement lays the groundwork for future features that might require user engagement through local alerts.

Highlights

  • Capacitor Local Notifications Integration: The @capacitor/local-notifications plugin has been integrated into the application, enabling the capability to send and manage local notifications on the device.
  • New Developer Tool for Notifications: A new developer page (/devtools/notifications) has been added, providing a user interface to test sending custom local notifications with user-defined titles and content.
  • Permission Handling: The new notification tool includes logic to check and request notification permissions from the user, providing feedback if permissions are denied.
  • Project Configuration Updates: The pnpm-workspace.yaml and Package.swift files have been updated to correctly include and link the new Capacitor Local Notifications plugin.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

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.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 31, 2025

⏳ Approval required for deploying to Cloudflare Workers (Preview) for stage-web.

Name Link
🔭 Waiting for approval For maintainers, approve here

Hey, @nekomeowww, @sumimakito, @luoling8192, @LemonNekoGH, kindly take some time to review and approve this deployment when you are available. Thank you! 🙏

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

This pull request adds notification capabilities to the Capacitor application, including the necessary dependencies for iOS and a new devtools page for testing. The changes are generally good, but I've identified a few areas for improvement regarding the robustness and maintainability of the implementation. My main concerns are a fragile dependency path in the iOS project configuration, a logic issue in handling notification permissions, and the method for generating notification IDs. Please see my detailed comments for suggestions.

Comment on lines +15 to +17
if (permission.display !== 'granted') {
await LocalNotifications.requestPermissions()
}
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The code requests notification permissions if not already granted, but it doesn't check the result of the requestPermissions() call. If the user denies the permission in the prompt, the code will still attempt to schedule a notification, which will fail. You should check the result of the permission request and only proceed if permission is granted.

  if (permission.display !== 'granted') {
    const permissionResult = await LocalNotifications.requestPermissions()
    if (permissionResult.display !== 'granted') {
      return toast.error('Notification permission was not granted.')
    }
  }

await LocalNotifications.schedule({
notifications: [
{
id: Math.floor(Math.random() * 1000000),
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Using Math.random() for notification IDs is not ideal as it doesn't guarantee uniqueness, which could lead to notifications overwriting each other if they happen to get the same ID. While collisions are unlikely in a development tool, it's a good practice to use a more reliable method for generating unique IDs. A simple and more robust alternative is to use a timestamp.

        id: Date.now(),

@LemonNekoGH LemonNekoGH changed the title feat(stage-capacitor): add notification capability feat(stage-capacitor): add notification capability, and a devtool Dec 31, 2025
@nekomeowww nekomeowww merged commit 3936c0e into main Dec 31, 2025
9 checks passed
@nekomeowww nekomeowww deleted the lemonnekogh/devtools-notification branch December 31, 2025 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants