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

Close dropdowns #9206

Merged
merged 5 commits into from
Mar 1, 2024
Merged

Close dropdowns #9206

merged 5 commits into from
Mar 1, 2024

Conversation

kazcw
Copy link
Contributor

@kazcw kazcw commented Feb 28, 2024

Pull Request Description

Fixes #7562. Close a dropdown when:

  • A click outside the dropdown occurs
  • Esc is pressed
  • Any other Interaction is started (i.e. using a shortcut)

Important Notes

  • Simplifies Interaction API and uses it for closing/canceling CB as well as dropdowns.
  • Adjusted some event handlers so that handled clicks don't also register as GraphEditor background clicks.
  • Introduces a CSS approach to prevent unwanted text-selections; we were doing it with JS until my previous PR, and the JS solution was breaking things.

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.

@kazcw kazcw added CI: No changelog needed Do not require a changelog entry for this PR. -gui labels Feb 28, 2024
@kazcw kazcw self-assigned this Feb 28, 2024
app/gui2/src/components/GraphEditor.vue Outdated Show resolved Hide resolved
@@ -634,7 +582,7 @@ function handleEdgeDrop(source: AstId, position: Vec2) {
:style="groupColors"
v-on.="graphNavigator.events"
v-on..="nodeSelection.events"
@click="handleClick"
@pointerdown="handleClick"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this change? I deliberately changed it to click once.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was preventing some user actions triggering multiple handlers, but we can do that some other way. Fixing it isn't needed for this PR and it doesn't currently cause any observed problems.

@kazcw kazcw added the CI: Ready to merge This PR is eligible for automatic merge label Mar 1, 2024
@mergify mergify bot merged commit ac4bbd8 into develop Mar 1, 2024
27 of 29 checks passed
@mergify mergify bot deleted the wip/kw/close-dropdowns branch March 1, 2024 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-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
Projects
None yet
2 participants