Repository navigation
Make - key always add a subtract operator on the canvas - #1020
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
Co-authored-by: highperformancecoder <3075825+highperformancecoder@users.noreply.github.com>
- key always add a subtract operator on the canvas
|
highperformancecoder
left a comment
There was a problem hiding this comment.
'-' 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>
There was a problem hiding this comment.
🟡 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_FACTORimport.
| 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 '*': |

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.tslocation !== 3branch for-. Every-now goes throughhandleMinusKey, as+does throughhandlePlusKey.handleMinusKeynow callsaddOperation("subtract")andmouseUpat the cursor, instead of zooming.ZOOM_OUT_FACTORimport.Review notes
-no longer zooms the canvas. Mouse wheel and the menu zoom controls are unaffected.-on the main keyboard row used to returnexecuted = falseand 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/zoomAtinKeyBindingsManager.tsare now unused. I left them in place to keep the diff small.This change is