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

Proper dropdown active area and arrow placement #7561

Merged
merged 6 commits into from
Aug 14, 2023

Conversation

Frizi
Copy link
Contributor

@Frizi Frizi commented Aug 10, 2023

Pull Request Description

Fixes #7423

Refactored widget matching algorithm to allow creating wrapper widgets even in cases where the widget config override is present. That allowed the widgets to be reordered, such that the argument name ends up being inside the dropdown widget. That way clicking it opens the dropdown.

Added explicit manual layout for the dropdown arrow position. Now it is positioned on the center of a selected appropriate child widget. For prefix chains, the leftmost part of the prefix application (the method or constructor) is selected.

dropdown-placement.mp4

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.

@Frizi Frizi added the CI: No changelog needed Do not require a changelog entry for this PR. label Aug 10, 2023
Copy link
Contributor

@vitvakatu vitvakatu left a comment

Choose a reason for hiding this comment

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

I'm not much familiar with the code, but after reading it and the docs carefully I even understood most of the things there! Nice job with it. A few minor nitpicks.

Comment on lines 169 to 173
/// Declare whether this widget should be considered for creation despite a config override
/// being present. Widgets that declare `true` here should always create a child widget on
/// the same span-tree node, so that the override can eventually be applied to it. Only widgets
/// declared before the widget selected by override will take priority over it.
const QUERY_ON_OVERRIDE: bool = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand the last sentence. They will take priority over what? What are the consequences of taking priority?
Also, the working of the second sentence is also confusing. I suggest to slightly rewrite it as follows:

Widgets that declare `true` here must create a child widget on the same span-tree node, so that the override can be applied to this child instead.

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've added more docs explaining the implicit ordering and where it is defined.

Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we also modify the Widget Configuration section in the module documentation, to mention this QUERY_ON_OVERRIDE const?

Copy link
Contributor Author

@Frizi Frizi Aug 11, 2023

Choose a reason for hiding this comment

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

Indeed, I've added a section there. Also changed the const name to PRIORITY_OVER_OVERRIDE, since the old one didn't really make any sense. The query word in never otherwise used in this context.

@MichaelMauderer
Copy link
Contributor

QA: 🟢

@vitvakatu vitvakatu added the CI: Ready to merge This PR is eligible for automatic merge label Aug 14, 2023
@mergify mergify bot merged commit 4a09cde into develop Aug 14, 2023
27 checks passed
@mergify mergify bot deleted the wip/frizi/dropdown-placement branch August 14, 2023 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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
Development

Successfully merging this pull request may close these issues.

Wrong placement of drop-downs
3 participants