Skip to content

Make - key always add a subtract operator on the canvas - #1020

Merged
highperformancecoder merged 3 commits into
masterfrom
copilot/sf-1431-fix-zoom-operators
Oct 20, 2026
Merged

highperformancecoder merged 3 commits into
masterfrom
copilot/sf-1431-fix-zoom-operators

Conversation

Copilot AI commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

On the canvas, + creates an add operator, but - only created an operator away from the numeric keypad. The keypad - zoomed out instead. This is inconsistent with +, and it is the behaviour reported in the issue.

  • KeyBindingsManager.ts
    • Removed the location !== 3 branch for -. Every - now goes through handleMinusKey, as + does through handlePlusKey.
    • handleMinusKey now calls addOperation("subtract") and mouseUp at the cursor, instead of zooming.
    • Dropped the unused ZOOM_OUT_FACTOR import.
case '-':
  await this.handleMinusKey(payload); // addOperation("subtract") + mouseUp
  break;

Review notes

  • Behaviour change: keypad - no longer zooms the canvas. Mouse wheel and the menu zoom controls are unaffected.
  • - on the main keyboard row used to return executed = false and fall through to other handling. I haven't checked where it fell through to. Please check the - next to =, which the reporter said opens the text prompt, since it now takes the subtract path.
  • zoom/zoomAt in KeyBindingsManager.ts are now unused. I left them in place to keep the diff small.
  • No tests added, and the change hasn't been built or run.

This change is Reviewable

@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 48672ef8-0dc9-4e89-831e-fc44420a0a05

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Co-authored-by: highperformancecoder <3075825+highperformancecoder@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix zoom buttons not creating canvas operators Make - key always add a subtract operator on the canvas Oct 18, 2026
@highperformancecoder

Copy link
Copy Markdown
Owner
  • should still open the text dialog, so as to receive inputs like -0.1. Only if the user type -, and closes the ext dialog, should the - operator be inserted.

@highperformancecoder highperformancecoder left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

'-' key should be captured by the text box, so that things like -2 can be entered. The - operator is only inserted if only a '-' is typed in the text box.

Co-authored-by: highperformancecoder <3075825+highperformancecoder@users.noreply.github.com>
@highperformancecoder
highperformancecoder marked this pull request as ready for review October 20, 2026 00:16
Copilot AI balanced review requested due to automatic review settings October 20, 2026 00:16
@highperformancecoder
highperformancecoder merged commit 6915ae4 into master Oct 20, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The missing subtract branch leaves minus keys opening the text prompt instead of directly inserting an operator.

1 open issue
What changed in this PR

This PR aims to make canvas minus-key shortcuts consistent with operator insertion by removing keypad-minus zoom behavior.

Changes:

  • Removes the location-dependent minus-key branch and zoom handler.
  • Removes the unused ZOOM_OUT_FACTOR import.
File Description
gui-js/​apps/​minsky-electron/​src/​app/​managers/​KeyBindingsManager.ts Removes minus-key zoom handling, but omits replacement subtract insertion.

Review effort: Balanced

}
break;

case '*':
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.

[SF#1431] + and - zooming not creating canvas operators

3 participants