-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add Alt + Wheel Zoom Shortcut & Fix Localization for Panning & Update zh-CN locale #1067
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's GuideThis PR enhances zoom functionality by introducing an Alt + Mouse Wheel shortcut, corrects and extends localization support (especially for the panning extension and Simplified Chinese), and adds/refines locale entries for new extensions. Sequence diagram for Alt + Mouse Wheel zoom event handlingsequenceDiagram
actor User
participant Workarea
participant EditorStartup
participant SvgCanvas
participant UI
User->>Workarea: wheel event (Alt key pressed)
Workarea->>EditorStartup: wheel event handler
EditorStartup->>SvgCanvas: setZoom(newZoom, true)
EditorStartup->>UI: updateCanvas(true)
EditorStartup->>UI: update zoom input value
Class diagram for EditorStartup zoom shortcut additionclassDiagram
class EditorStartup {
+workarea
+svgCanvas
+updateCanvas(force)
+constructor()
+wheel event handler (Alt + wheel)
}
EditorStartup --> SvgCanvas: uses
EditorStartup --> UI: updates
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `src/editor/panels/LeftPanel.html:3` </location>
<code_context>
<div id="tools_left">
<se-button id="tool_select" title="tools.mode_select" src="select.svg"></se-button>
- <se-button id="tool_zoom" title="tools.mode_zoom" src="zoom.svg" shortcut="Z"></se-button>
+ <se-button id="tool_zoom" title="tools.mode_zoom" src="zoom.svg" shortcut="Z / Alt + wheels"></se-button>
<se-button id="tool_fhpath" title="tools.mode_fhpath" src="pencil.svg" shortcut="Q"></se-button>
<se-button id="tool_line" title="tools.mode_line" src="pen.svg" shortcut="L"></se-button>
</code_context>
<issue_to_address>
Consider clarifying shortcut syntax for better user understanding.
Use a clearer shortcut label, such as 'Z or Alt + Mouse Wheel', to avoid confusion.
</issue_to_address>
<suggested_fix>
<<<<<<< SEARCH
<se-button id="tool_zoom" title="tools.mode_zoom" src="zoom.svg" shortcut="Z / Alt + wheels"></se-button>
=======
<se-button id="tool_zoom" title="tools.mode_zoom" src="zoom.svg" shortcut="Z or Alt + Mouse Wheel"></se-button>
>>>>>>> REPLACE
</suggested_fix>
Help me be more useful! Please click π or π on each comment and I'll use the feedback to improve your reviews.
@@ -1,6 +1,6 @@ | |||
<div id="tools_left"> | |||
<se-button id="tool_select" title="tools.mode_select" src="select.svg"></se-button> | |||
<se-button id="tool_zoom" title="tools.mode_zoom" src="zoom.svg" shortcut="Z"></se-button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Consider clarifying shortcut syntax for better user understanding.
Use a clearer shortcut label, such as 'Z or Alt + Mouse Wheel', to avoid confusion.
<se-button id="tool_zoom" title="tools.mode_zoom" src="zoom.svg" shortcut="Z"></se-button> | |
<se-button id="tool_zoom" title="tools.mode_zoom" src="zoom.svg" shortcut="Z or Alt + Mouse Wheel"></se-button> |
Please make sure your code pass the linter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plz make sure the linter passes
Style issues fixed and linter passed β thanks for pointing them out. |
Great addition - thanks |
β Pull Request: Add Alt + Wheel Zoom Shortcut & Fix Localization for Panning & Update zh-CN locale
π Summary
This PR introduces a new user-friendly zoom shortcut β
Alt + Mouse Wheel
β for zooming in/out on the canvas. Additionally, it:zh-CN
(Simplified Chinese) locale strings.β¨ Features & Fixes
β New Feature:
Added support for
Alt + Mouse Wheel
to zoom in/out β improves UX for users familiar with design tools like Photoshop or Figma.π Localization Update:
Updated
zh-CN
locale strings to ensure accurate and natural translations.π Bug Fix:
Resolved an issue in the
ext-panning
module where locale strings failed to load correctly, causing display or functionality issues in non-English environments.π§ͺ Testing
Alt + Wheel
zoom on Windows/macOS β smooth and responsive.zh-CN
translations display correctly.β Ready for review & merge.
Summary by Sourcery
Add an Alt+Mouse Wheel shortcut for canvas zooming and overhaul localization support across the editor, including panning extension fixes, zh-CN translation updates, and new layer view locale.
New Features:
Bug Fixes:
Enhancements: