Skip to content

Add right-click trigger for reactions/context menu on desktop & web#4

Open
shkvoretz wants to merge 5 commits intoDexterfury:mainfrom
shkvoretz:main
Open

Add right-click trigger for reactions/context menu on desktop & web#4
shkvoretz wants to merge 5 commits intoDexterfury:mainfrom
shkvoretz:main

Conversation

@shkvoretz
Copy link
Copy Markdown

Summary

This PR introduces right-click support (secondary mouse button) for opening the chat reactions and/or context menu when running on desktop and web platforms. The package previously only supported long-press (and optionally double-tap) as trigger mechanisms.

With this update, apps using a mouse can now invoke the reactions popup using the expected interaction model for desktop chat applications (e.g., Slack, Discord, Telegram Desktop).

Motivation

The original gesture model was optimized primarily for mobile usage. However, when integrating this package in a cross-platform chat app, right-click interaction is essential for desktop/web UX consistency.

This change enables developers to maintain the same reactions menu behavior across input devices without needing to fork or wrap the library externally.

What Was Changed
• Wrapped the message child with a Listener to detect pointer events.
• When enableRightClick is enabled and the event is:
• PointerDeviceKind.mouse
• kSecondaryMouseButton (right click)
→ the reactions/context menu is shown.
• Added enableRightClick field to ChatReactionsConfig with default false so behavior remains backward-compatible.

ChatReactionsConfig(
  enableLongPress: true,
  enableRightClick: true, //  this is new
)

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @shkvoretz, 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 significantly enhances the chat_reactions package by integrating right-click functionality for triggering reaction menus on desktop and web environments. This change addresses the need for a more intuitive and consistent user experience across different platforms, particularly for mouse-driven interfaces, by adopting a widely recognized interaction pattern. It provides developers with a flexible configuration option to enable this behavior, ensuring seamless integration into cross-platform chat applications.

Highlights

  • Desktop/Web Right-Click Support: Introduces the ability to open the chat reactions/context menu using a right-click (secondary mouse button) on desktop and web platforms.
  • Enhanced Cross-Platform UX: Improves user experience consistency by providing a standard interaction model for mouse-based chat applications, aligning with common desktop patterns like those found in Slack or Discord.
  • Configurable Behavior: Adds a new onSecondaryTapDown boolean property to ChatReactionsConfig, allowing developers to enable or disable this feature, with a default value of false for backward compatibility.
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.

Copy link
Copy Markdown

@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 introduces a useful feature for desktop and web users by adding right-click support to trigger the reactions menu. The implementation is straightforward and correctly uses onSecondaryTapDown. My main feedback is to improve the naming of the new configuration property for better clarity and consistency with existing properties. I've suggested changing onSecondaryTapDown to enableRightClick as used in the PR description. This will make the API more intuitive for developers using the package.

Comment thread example/lib/main.dart Outdated
Comment thread lib/src/models/chat_reactions_config.dart Outdated
Comment thread lib/src/models/chat_reactions_config.dart Outdated
Comment thread lib/src/widgets/chat_message_wrapper.dart Outdated
shkvoretz and others added 4 commits November 18, 2025 16:20
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
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.

1 participant