Skip to content

fix(spp_change_request_v2): remove global keyboard hotkeys#124

Merged
emjay0921 merged 2 commits into19.0from
fix/remove-cr-global-hotkeys
Mar 19, 2026
Merged

fix(spp_change_request_v2): remove global keyboard hotkeys#124
emjay0921 merged 2 commits into19.0from
fix/remove-cr-global-hotkeys

Conversation

@emjay0921
Copy link
Contributor

Why is this change needed?

Single-letter global hotkeys (A=Approve, R=Request Changes, D=Decline, N=Next, P=Previous) were interfering with normal typing anywhere in the Odoo interface.

How was the change implemented?

  • Removed global_shortcuts.js service entirely — it registered A, R, D as global hotkeys via Odoo's hotkey service
  • Removed onKeydown handler from review_panel.js — it registered the same keys plus N, P, Escape via document.addEventListener
  • Removed unused onWillUnmount import

New unit tests

Unit tests executed by the author

How to test manually

  1. Open any page in Odoo
  2. Type normally — letters A, R, D, N, P should not trigger any CR actions
  3. Change request approve/reject/revision still works via buttons

Related links

Single-letter hotkeys (A, R, D, N, P) were interfering with normal typing.
Removed global_shortcuts service and keydown handler from review panel.
@gemini-code-assist
Copy link

Summary of Changes

Hello, 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 resolves an issue where single-letter global hotkeys within the Odoo interface inadvertently triggered Change Request actions, disrupting normal text input. By completely removing these global and local keyboard shortcuts, the system now allows users to type without interference. All Change Request functionalities, such as approving, rejecting, or requesting changes, remain fully accessible through their respective on-screen buttons.

Highlights

  • Global Hotkey Removal: The global_shortcuts.js service, which registered single-letter global hotkeys (A, R, D) for Change Request actions, was entirely removed to prevent interference with normal typing.
  • Review Panel Hotkey Removal: The onKeydown handler and its associated document.addEventListener for hotkeys (A, R, D, N, P, Escape) were removed from review_panel.js, eliminating local keyboard shortcuts.
  • Code Cleanup: An unused onWillUnmount import was removed from review_panel.js as part of the cleanup following the hotkey removal.
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.

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.

@emjay0921 emjay0921 marked this pull request as ready for review March 19, 2026 10:19
Copy link

@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 correctly removes the global keyboard hotkeys that were causing interference. The approach of removing the global_shortcuts.js service and the onKeydown handler in the review_panel component is sound. I have added one comment pointing out that the UI hints for these shortcuts should also be removed from the corresponding template to avoid user confusion.

I am having trouble creating individual review comments. Click here to see my feedback.

spp_change_request_v2/static/src/components/review_panel/review_panel.js (166-205)

medium

While removing the keyboard handler logic is correct, the corresponding UI hints for these shortcuts still exist in the template file spp_change_request_v2/static/src/components/review_panel/review_panel.xml. These should also be removed to avoid confusing users. The hints are present on the action buttons (e.g., (A), (R)) and in a dedicated keyboard hints section at the bottom of the panel.

@codecov
Copy link

codecov bot commented Mar 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.97%. Comparing base (9cba283) to head (ea29f95).
⚠️ Report is 5 commits behind head on 19.0.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##             19.0     #124    +/-   ##
========================================
  Coverage   69.96%   69.97%            
========================================
  Files         832      835     +3     
  Lines       48813    49162   +349     
========================================
+ Hits        34154    34399   +245     
- Misses      14659    14763   +104     
Flag Coverage Δ
spp_api_v2_change_request 66.66% <ø> (ø)
spp_base_common 90.26% <ø> (ø)
spp_change_request_v2 73.86% <ø> (-0.02%) ⬇️
spp_cr_types_advanced 0.00% <ø> (ø)
spp_cr_types_base 0.00% <ø> (ø)
spp_dci_demo 69.23% <ø> (ø)
spp_farmer_registry_cr 61.15% <ø> (ø)
spp_farmer_registry_demo 54.01% <ø> (ø)
spp_mis_demo_v2 69.73% <ø> (-0.09%) ⬇️
spp_programs 45.51% <ø> (ø)
spp_security 66.66% <ø> (ø)
spp_starter_social_registry 0.00% <ø> (ø)
spp_starter_sp_mis 81.25% <ø> (ø)
spp_studio_change_requests 84.67% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 9 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@emjay0921 emjay0921 merged commit 3025428 into 19.0 Mar 19, 2026
29 checks passed
@emjay0921 emjay0921 deleted the fix/remove-cr-global-hotkeys branch March 19, 2026 11:17
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