Skip to content

fixed nav shorcuts (added compat map)#143

Merged
igorkorsukov merged 1 commit into
musescore:mainfrom
igorkorsukov:w/rcmd/fix_nav
Jul 10, 2026
Merged

fixed nav shorcuts (added compat map)#143
igorkorsukov merged 1 commit into
musescore:mainfrom
igorkorsukov:w/rcmd/fix_nav

Conversation

@igorkorsukov

@igorkorsukov igorkorsukov commented Jul 10, 2026

Copy link
Copy Markdown
Member

Resolves: audacity/audacity#11393

Build configuration

audacity: audacity/audacity/master
audacity platforms: linux_x64
musescore: musescore/MuseScore/main
musescore platforms: linux_x64

@igorkorsukov

Copy link
Copy Markdown
Member Author

/build

@github-actions

Copy link
Copy Markdown

@igorkorsukov

Copy link
Copy Markdown
Member Author

/build

@github-actions

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

NavigationApi now uses ICommandDispatcher and shared navigation command constants for movement, escape, and trigger operations. Command URI handling uses the command scheme prefix. Shortcut loading converts legacy navigation action identifiers to canonical command strings before validation. The diagnostic actions panel updates the print button label from “Print” to “Print this”.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The QML text change from "Print" to "Print this" appears unrelated to the navigation shortcut fix. Move the button-label tweak to a separate PR, or remove it if it is not required for the navigation fix.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main fix: navigation shortcuts compatibility work.
Description check ✅ Passed The description references the linked issue and the build configuration, so it is related to the change.
Linked Issues check ✅ Passed The changes address broken keyboard navigation by normalizing shortcut commands and command-scheme handling.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Tools execution failed with the following error:

Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@framework/shortcuts/internal/shortcutscontroller.cpp`:
- Line 43: Mark the file-scope compatActionToCommand lookup table as const,
preserving its existing initialization and type while preventing later mutation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1991debd-a668-49e4-8278-01b899516161

📥 Commits

Reviewing files that changed from the base of the PR and between a599a97 and 8984f9e.

📒 Files selected for processing (3)
  • framework/shortcuts/internal/shortcutscontroller.cpp
  • framework/ui/api/navigationapi.cpp
  • framework/ui/api/navigationapi.h

Comment thread framework/shortcuts/internal/shortcutscontroller.cpp Outdated
@igorkorsukov

Copy link
Copy Markdown
Member Author

/build

@github-actions

Copy link
Copy Markdown

@igorkorsukov

Copy link
Copy Markdown
Member Author

/build

@github-actions

Copy link
Copy Markdown

@igorkorsukov igorkorsukov force-pushed the w/rcmd/fix_nav branch 2 times, most recently from 3854b0f to 4b86d99 Compare July 10, 2026 11:18

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@framework/diagnostics/qml/Muse/Diagnostics/DiagnosticActionsPanel.qml`:
- Around line 72-73: Update the button label associated with
actionsModel.print() from “Print this” to “Print” or “Print all” so it
accurately reflects that all current actions are printed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: a0d012d1-e40c-41ea-b024-8146943413da

📥 Commits

Reviewing files that changed from the base of the PR and between 8984f9e and 3854b0f.

📒 Files selected for processing (5)
  • framework/diagnostics/qml/Muse/Diagnostics/DiagnosticActionsPanel.qml
  • framework/shortcuts/internal/shortcutscontroller.cpp
  • framework/shortcuts/internal/shortcutsregister.cpp
  • framework/ui/api/navigationapi.cpp
  • framework/ui/api/navigationapi.h

Comment on lines +72 to 73
text: "Print this"
onClicked: actionsModel.print()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Align the label with the print scope.

actionsModel.print() prints all current actions, so “Print this” misleadingly suggests that only the selected item is printed. Use “Print” or “Print all” instead.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@framework/diagnostics/qml/Muse/Diagnostics/DiagnosticActionsPanel.qml` around
lines 72 - 73, Update the button label associated with actionsModel.print() from
“Print this” to “Print” or “Print all” so it accurately reflects that all
current actions are printed.

@igorkorsukov igorkorsukov force-pushed the w/rcmd/fix_nav branch 2 times, most recently from 56856be to 7e013a5 Compare July 10, 2026 11:58

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@framework/actions/internal/actionsdispatcher.cpp`:
- Line 81: Replace the startsWith check in the action dispatch logic with an
exact equality comparison between actionQuery.uri().scheme() and
rcommand::COMMAND_SCHEME, ensuring only the intended command scheme is routed to
the command dispatcher.

In `@framework/rcommand/commandtypes.h`:
- Line 36: Prevent command dispatch from matching unrelated action codes
beginning with “command”. In ActionsDispatcher::dispatch(const ActionCode&), use
a delimited URI prefix for the raw startsWith check, such as a new
COMMAND_URI_PREFIX constant set to “command://”, while retaining COMMAND_SCHEME
as “command” for parsed scheme comparisons; update the relevant references in
commandtypes.h and actionsdispatcher.cpp consistently.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 039dbd6b-1f09-458d-8b13-2990acc137a7

📥 Commits

Reviewing files that changed from the base of the PR and between 3854b0f and 16fdb3c.

📒 Files selected for processing (7)
  • framework/actions/internal/actionsdispatcher.cpp
  • framework/diagnostics/qml/Muse/Diagnostics/DiagnosticActionsPanel.qml
  • framework/rcommand/commandtypes.h
  • framework/shortcuts/internal/shortcutscontroller.cpp
  • framework/shortcuts/internal/shortcutsregister.cpp
  • framework/ui/api/navigationapi.cpp
  • framework/ui/api/navigationapi.h

void ActionsDispatcher::dispatch(const ActionQuery& actionQuery)
{
if (actionQuery.uri().scheme() == rcommand::COMMAND_SCHEME) {
if (muse::strings::startsWith(actionQuery.uri().scheme(), rcommand::COMMAND_SCHEME)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Prefer == over startsWith for exact scheme comparison.

actionQuery.uri().scheme() returns the parsed scheme component (e.g., "command"). Using startsWith instead of equality means URIs with schemes like "commander" or "commands" would also match and be routed to the command dispatcher. An exact equality check is more precise and prevents unintended scheme matches.

🔧 Proposed fix
-    if (muse::strings::startsWith(actionQuery.uri().scheme(), rcommand::COMMAND_SCHEME)) {
+    if (actionQuery.uri().scheme() == rcommand::COMMAND_SCHEME) {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (muse::strings::startsWith(actionQuery.uri().scheme(), rcommand::COMMAND_SCHEME)) {
if (actionQuery.uri().scheme() == rcommand::COMMAND_SCHEME) {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@framework/actions/internal/actionsdispatcher.cpp` at line 81, Replace the
startsWith check in the action dispatch logic with an exact equality comparison
between actionQuery.uri().scheme() and rcommand::COMMAND_SCHEME, ensuring only
the intended command scheme is routed to the command dispatcher.


namespace muse::rcommand {
constexpr std::string_view COMMAND_SCHEME = "command://";
constexpr std::string_view COMMAND_SCHEME = "command";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

COMMAND_SCHEME change from "command://" to "command" broadens startsWith matching in ActionsDispatcher::dispatch(const ActionCode&).

In actionsdispatcher.cpp line 64, startsWith(actionCode, rcommand::COMMAND_SCHEME) is applied to the raw action code. With the old value "command://", only action codes beginning with "command://" matched. With the new value "command", any action code starting with the substring "command" (e.g., "commando-action", "command-edit") will be incorrectly routed to commandDispatcher() instead of being looked up among registered action clients.

This is a cross-file contract break: the constant value change in commandtypes.h silently broadens the dispatch routing in actionsdispatcher.cpp line 64, potentially hijacking action codes that were previously handled by registered clients.

Consider either:

  1. Using == on line 81 (scheme comparison) and restoring a delimited prefix (e.g., "command://" or "command:") for the startsWith check on line 64.
  2. Or introducing a separate constant (e.g., COMMAND_URI_PREFIX = "command://") for the raw-string startsWith check on line 64, keeping COMMAND_SCHEME = "command" for scheme comparisons.
🔧 Proposed fix: separate scheme and URI prefix constants
 constexpr std::string_view COMMAND_SCHEME = "command";
+constexpr std::string_view COMMAND_URI_PREFIX = "command://";
 using Command = Uri;

Then in actionsdispatcher.cpp line 64:

-    if (muse::strings::startsWith(actionCode, rcommand::COMMAND_SCHEME)) {
+    if (muse::strings::startsWith(actionCode, rcommand::COMMAND_URI_PREFIX)) {

And line 81:

-    if (muse::strings::startsWith(actionQuery.uri().scheme(), rcommand::COMMAND_SCHEME)) {
+    if (actionQuery.uri().scheme() == rcommand::COMMAND_SCHEME) {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@framework/rcommand/commandtypes.h` at line 36, Prevent command dispatch from
matching unrelated action codes beginning with “command”. In
ActionsDispatcher::dispatch(const ActionCode&), use a delimited URI prefix for
the raw startsWith check, such as a new COMMAND_URI_PREFIX constant set to
“command://”, while retaining COMMAND_SCHEME as “command” for parsed scheme
comparisons; update the relevant references in commandtypes.h and
actionsdispatcher.cpp consistently.

@igorkorsukov igorkorsukov merged commit 3e6bfd6 into musescore:main Jul 10, 2026
3 checks passed
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.

Accessibility Navigation is Broken

2 participants