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

Pan to CB #9273

Merged
merged 8 commits into from
Mar 6, 2024
Merged

Pan to CB #9273

merged 8 commits into from
Mar 6, 2024

Conversation

kazcw
Copy link
Contributor

@kazcw kazcw commented Mar 4, 2024

Pull Request Description

When the CB is opened, pan to show it.

Large screen:

Screen.Recording.2024-03-04.at.14.30.54.mov

Small screen:

Screen.Recording.2024-03-04.at.14.24.23.1.mov

Important Notes

A prioritized-coordinates approach is used to adjust panning goals based on screen space:

  • Fitting the input area is highest-priority.
  • If possible, the whole component panel area will be fit.
  • If possible, the visualization preview will be fit.
  • If there's extra room, margins will be included; the top and left are prioritized because those margins prevent overlap with fixed UI elements.

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 the CI: No changelog needed Do not require a changelog entry for this PR. label Mar 4, 2024
@kazcw kazcw self-assigned this Mar 4, 2024
Copy link
Contributor

@farmaazon farmaazon left a comment

Choose a reason for hiding this comment

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

If possible, please add an e2e test (or extend existing "different ways of opening CB") to check if we pan when opening CB near corner. Or a case where we select a node, pan scene so the node is not visible, and press enter, and see if we eventually see CB (we'd probably need to suppress "autoscrolling page" in the check).

app/gui2/src/util/data/rect.ts Outdated Show resolved Hide resolved
app/gui2/src/components/ComponentBrowser.vue Outdated Show resolved Hide resolved
@kazcw kazcw added the CI: Ready to merge This PR is eligible for automatic merge label Mar 6, 2024
@mergify mergify bot merged commit 79a6a6a into develop Mar 6, 2024
32 of 34 checks passed
@mergify mergify bot deleted the wip/kw/pan-to-cb branch March 6, 2024 20:09
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.

When adding a Component with the enter key, editor should scroll to where it is added.
2 participants