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

Fix interfering click handlers #9127

Merged
merged 11 commits into from
Feb 22, 2024
Merged

Fix interfering click handlers #9127

merged 11 commits into from
Feb 22, 2024

Conversation

farmaazon
Copy link
Contributor

@farmaazon farmaazon commented Feb 21, 2024

Pull Request Description

Fixes one failure in #8942 which caught a real issue: clicks at various panels were triggering many handlers at once, often unexpectedly - for example quick clicking at breadcrumbs (and automatic tests always click fast) we could also trigger getting out the current node.

Therefore, I added stopPropagation for all mouse events on "panel" level + where I think the event should be considered "handled" and no longer bother anyone. Also, to unify things, most actions are for click event.

Additionally I spotted and fixed some issues:

  • When "clicking-off" Component Browser, it creates new node only if anything was actually typed in (no more dangling operatorX. nodes)
  • Filtering now works for operators
  • When, after opening CB with source node, user starts typing operator, we replace dot with space
  • Fixed our shortcut handler, so it works properly with click event.
  • Fixed problems with defocusing input in CB when clicking at links.

Important Notes

I removed PointerMain binding for deselectAll, because it was triggered every time did the area selection.

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed, the GUI was tested when built using ./run ide build.

@@ -43,7 +43,7 @@ const props = defineProps<{

const emit = defineEmits<{
accepted: [searcherExpression: string, requiredImports: RequiredImport[]]
closed: [searcherExpression: string, requiredImports: RequiredImport[]]
closed: [searcherExpression: string, requiredImports: RequiredImport[], anyInputChange: boolean]
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need a closed event? I think the CB could just emit accepted or canceled.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"Closed" means that it lost focus (due to background click, for example). Since this PR, it does differ from direct accept.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes. I don't see the need to increase the complexity of the ComponentBrowser/GraphEditor interface by exposing this distinction to the GraphEditor. The CB could decide whether to emit accepted or canceled internally, and keep anyInputChange encapsulated.

@farmaazon farmaazon added the CI: Ready to merge This PR is eligible for automatic merge label Feb 22, 2024
@mergify mergify bot merged commit 7f5b2ed into develop Feb 22, 2024
24 of 26 checks passed
@mergify mergify bot deleted the wip/farmaazon/fix-clicks branch February 22, 2024 15:18
@kazcw kazcw mentioned this pull request Feb 22, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
--bug Type: bug -gui CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge x-new-feature Type: new feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants