Add right-click trigger for reactions/context menu on desktop & web#4
Add right-click trigger for reactions/context menu on desktop & web#4shkvoretz wants to merge 5 commits intoDexterfury:mainfrom
Conversation
Summary of ChangesHello @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 Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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.
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>
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.