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

Improve resizing feel #1061

Open
Skaiir opened this issue Feb 21, 2024 · 0 comments
Open

Improve resizing feel #1061

Skaiir opened this issue Feb 21, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request experiment in progress Currently worked on

Comments

@Skaiir
Copy link
Contributor

Skaiir commented Feb 21, 2024

Is your feature request related to a problem? Please describe.

Currently the resizing algo is a little wonky and difficult to use. I'd like to experiment with making some changes to how it works in the hopes of improving the overall feel.

Describe the solution you'd like

We should have more flexibility of resizing. One of the ways this could be improved would be to make for some space when there isn't enough left. This means squashing other components to make space if needed.

We also need to rethink how resizing from the left and right cursors work, or if we need these cursors at all. Perhaps we can just get away with a single cursor between elements instead.

Update 1:

Working idea
  • Stop using auto to render, it breaks the carbon grid and also leads to some strange stacking behavior. Instead, we should compute all the auto fields to fill in whatever grid size is left.
  • Allow resizing even when another element is blocking the way, squishing the associated elements.
  • Don't squish elements when there's space left.

Update 2 (WIP):

Figured out some in depth target behavior with some experimentation:

emcount: number of elements in the row after operation
empty: size
interpolationRatio(): some ratio function we decide on based on the value of empty empty

Action Behavior Detail
Adding into an empty row Fill the empty row
Adding into a full row Split the space evenly New field will be sized ciel(1/emcount), whatever space is needed to make that happen will be taken from the other elements while preserving their relative sizes
Adding into a row with plenty of empty space Fill the empty space New field will be sized empty
Adding into a row with not enough empty space Do something in between using a mathematical gradient New field will be sized interpolate(interpolationRatio(empty), empty, ciel(1/emcount)), space needed to make that happen will be distributed
Removing from a full column Give all space to leftover elements todo
Removing from a column with a ton of space left No space is given, just delete
Removing from a column with a bit of space left Do something in between using a mathematical gradient todo
Removing as the last element of a row Delete the row
Resizing from left cursor todo todo
Resizing from right cursor with a full row todo todo
Resizing from right cursor with a row that has a lot of space todo todo
Resizing from right cursor with a row that has medium amount of space todo todo
Resizing via properties panel todo todo

Additionally, the following changes should be made:

  • remove the left dragging cursor from the first item of a row
  • for backwards compatibility, compute auto to actual values during import
  • change the properties panel to only show possible resizing operations

Another idea we could play with would be having a concept of 'idealWidth' that certain elements could have. So that we take more space from smaller elements. But that's maybe taking the concept too far.

Describe alternatives you've considered

Leave as-is

Additional context

None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request experiment in progress Currently worked on
Development

No branches or pull requests

1 participant