Clean up DocumentMessageHandler by breaking out several lengthy handlers into helper functions#3568
Conversation
|
Why the new workflow? That seems unrelated. Converted to draft because this not ready for review. |
50bf1ad to
dd65498
Compare
Hi @timon-schelling, thanks for the review! You're absolutely right - both the workflow file and pnpm-lock were accidentally included. They were from a different branch I was working on and got mixed in when I created this PR. I've fixed this now: Rebased onto master |
124235a to
a42cad8
Compare
dd65498 to
e318a1f
Compare
Part of GraphiteEditor#2740 - Code quality refactors. This commit addresses the 'Match statements' section of the tracking issue by extracting three large match arms from process_message() into dedicated helper methods: - handle_group_selected_layers: Handles layer grouping in both artboard and non-artboard workflows (~50 lines extracted) - handle_move_selected_layers_to: Handles layer movement with proper transform preservation (~85 lines extracted) - handle_nudge_selected_layers: Handles keyboard nudging with optional resize mode (~75 lines extracted) The main match statement in DocumentMessageHandler is now ~210 lines shorter and more readable. Logic and behavior remain unchanged.
e318a1f to
2963689
Compare
|
Hi @theaniketgiri, thanks again for this code contribution to the project! We're still hoping you will respond to the request to relicense this code. Please see #4208 ASAP, thank you! |
|
Hi @theaniketgiri, we're grateful of your past code contribution to Graphite, but unless we hear from you by the end of this weekend with agreement about relicensing your code to include the MIT license, we will begin steps to remove your code contributions so that you will no longer be a Graphite code contributor. We'd much rather avoid this outcome, so please respond now. To agree, simply log into your GitHub account, visit #4208, and copy-paste this into a comment: "I license my past and future contributions to Graphite under the dual MIT/Apache-2.0 license, allowing licensees to choose either at their option." If you're hesitant because you disagree or have questions, feel free to respond with another message; we'll do our best to answer your questions or concerns. More explanation is at the top of the linked thread if you're confused. So far, 164 contributors have agreed and you are among the 11% remaining whom we are still hoping to hear from before we begin removing your code from the project starting this Monday. (If you only see this later than Monday, your future belated response will still be appreciated.) Thank you for your cooperation and support of open source, and we hope you'll help us keep your valued contributions in-tact. |
Partly closes #2740
This PR addresses the "Match statements" section of the tracking issue by extracting three large match arms from
process_message()into dedicated helper methods.Changes
Extracted the following helper methods in
DocumentMessageHandler:handle_group_selected_layershandle_move_selected_layers_tohandle_nudge_selected_layersBenefits
Before/After
Before:
After:
Testing
cargo check