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

Make editor sidebar panel expand when clicked #31082

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

HenintsoaSky
Copy link
Contributor

@HenintsoaSky HenintsoaSky commented Dec 11, 2024

Before:

2024-12-11.16-24-22.mp4

After:

2024-12-11.16-23-59.mp4

@HenintsoaSky HenintsoaSky changed the title Expanding toolbar click Make editor sidebar panel expand when clicked Dec 11, 2024
@bdach
Copy link
Collaborator

bdach commented Dec 12, 2024

On a 15 second check, the following should not be happening:

2024-12-12.13-30-50.mp4

Ending a drag by releasing mouse expands the sidebar, it shouldn't do that. Maybe the behaviour should be implemented in OnClick() instead which I believe is blocked by drag.

Also incidentally once I somehow got into a state wherein the panel would just not collapse back down again. Probably something or other about the timing of the mouse up coinciding with the timing of the delayed expand.

Copy link
Collaborator

@bdach bdach left a comment

Choose a reason for hiding this comment

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

as above

Use OnClick instead of OnMouseUp
@HenintsoaSky
Copy link
Contributor Author

Ending a drag by releasing mouse expands the sidebar, it shouldn't do that. Maybe the behaviour should be implemented in OnClick() instead which I believe is blocked by drag.

I changed the behavior, it now uses OnClick instead of MouseUp.

Also incidentally once I somehow got into a state wherein the panel would just not collapse back down again. Probably something or other about the timing of the mouse up coinciding with the timing of the delayed expand.

I think the bug should fixed, I am not sure. At least I couldn't reproduce it.

@HenintsoaSky HenintsoaSky requested a review from bdach December 12, 2024 09:11
Adjusted OnClick logic in ExpandingToolboxContainer to ensure the container does not collapse when clicked after being expanded.
HenintsoaSky and others added 3 commits December 17, 2024 18:12
- Removed redundant conditional check:
  `if (!ReceivePositionalInputAt(e.ScreenSpaceMousePosition)) return false;`

- Unnested `AddAssert("sidebar expands after click", () => toolbox.Expanded.Value)`
Think it makes more sense there.
@bdach
Copy link
Collaborator

bdach commented Dec 26, 2024

Have essentially rewritten this to get to a state I'd consider passable. Going to wait and see what CI says to my changes before pinging people for a second review.

@kongehund
Copy link
Contributor

kongehund commented Dec 26, 2024

I'm concerned that having ExpandingContainer accept the OnClick means we can't scroll to the clicked SettingsToolboxGroup when clicked, as suggested in my original issue.

@kongehund
Copy link
Contributor

kongehund commented Dec 26, 2024

Not sure how patches work, but see https://github.com/kongehund/osu/tree/refs/heads/expanding-toolbar-click

The changes will scroll the toolbar to the clicked toolbox, also when the toolbar is expanded. My current implementation keeps the click-to-expand functionality of ExpandingContainer, but makes SettingsToolboxGroup consume OnClick, and invokes an event to expand the container in this special case.

If this is to be implemented, #31063 should be fixed also, since scrolling on click can easily collapse the sidebar because of this linked issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Editor sidebar panel should expand when clicked
3 participants