Skip to content
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

Consider only default modifiers in toolbox shortcuts #2068

Merged
merged 1 commit into from
Feb 5, 2023

Conversation

marek-piirikivi
Copy link
Contributor

Masks incoming modifier state with default mask to ignore additional flags.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bug fix
  • Feature
  • Chore (refactoring, formatting, local variables, other cleanup)
  • Documentation content changes

What is the current behavior?

Issue Number: #2067

What is the new behavior?

Toolbox shortcuts now work as expected.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 5, 2023

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.06%.

Quality metrics Before After Change
Complexity 5.74 ⭐ 5.77 ⭐ 0.03 👎
Method Length 69.09 🙂 69.43 🙂 0.34 👎
Working memory 5.08 ⭐ 5.09 ⭐ 0.01 👎
Quality 67.96% 🙂 67.90% 🙂 -0.06% 👎
Other metrics Before After Change
Lines 289 290 1
Changed files Quality Before Quality After Quality Change
gaphor/ui/toolbox.py 67.96% 🙂 67.90% 🙂 -0.06% 👎

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
gaphor/ui/toolbox.py Toolbox.create_toolbox 12 🙂 334 ⛔ 36.51% 😞 Try splitting into smaller methods
gaphor/ui/toolbox.py create_toolbox_button 10 🙂 131 😞 10 😞 55.34% 🙂 Try splitting into smaller methods. Extract out complex expressions
gaphor/ui/toolbox.py Toolbox.expanded_sections 3 ⭐ 130 😞 10 😞 62.17% 🙂 Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@github-actions github-actions bot added the python Pull requests that update Python code label Feb 5, 2023
@marek-piirikivi
Copy link
Contributor Author

marek-piirikivi commented Feb 5, 2023

Should I also add test for this? I am open to the ideas on how to test this.

@amolenaar
Copy link
Member

Indeed, when I enable Caps-Lock, the shortcuts no longer work.

@amolenaar amolenaar merged commit 8497951 into gaphor:main Feb 5, 2023
@danyeaw danyeaw added the fix A fix for a bug label Feb 13, 2023
@marek-piirikivi marek-piirikivi deleted the toolbox_shortcuts_fix branch July 28, 2023 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix A fix for a bug python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants