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

Thought-in-progress: better and finer-granularity layout assistance #338

Open
forrestbao opened this issue Jun 20, 2023 · 4 comments
Open

Comments

@forrestbao
Copy link
Collaborator

forrestbao commented Jun 20, 2023

Auto-layout covers two kinds of problems:

  1. Shape of scopes/pods: Auto-shrink and auto-expand a scope when a pod is moved out and into the scope.
  2. Placement of scopes/pods: Auto-shovel to push away pods/scopes when overlaps happen.

A bit history:

  1. Auto-shrink and auto-expand were added for Scopes should be like bubbles, automatically expanding as members are added  #151
  2. Auto-shovel (without auto-retract) was added for auto-shovel pods/scopes that will overlap due to width/height expansion #176

While 1 always makes life easier, 2 is not always as it sometimes breaks the manual placement of pods/scopes.

Idea 1: allowing users to enable and disable individual options under auto-layout. I feel life will very good with 1 enabled and 2 disabled and snapping enabled.

Idea 2: keeping the snapping relationship. For example, if two pods are snapped with their tops aligned, then the top of them should remained aligned in the future. If auto-shovel pushes one up, then both of them should be pushed up to remain top-aligned.

Idea 3: optional and needing additional thinking, is how to shovel pods/scopes to make space for a pod newly created or dragged that overlaps with existing pods. The force-based auto-layout is far from ideal. It could push aligned pods/scopes out of alignment. Alternatively, CodePod can ask the user what to do from 4 options: pushing the pods above/below/left/right away. This is like inserting cells into a spreadsheet.

Idea 4: allowing pods/scopes to be pinned at where they are. So the location of a pod/scope with respect to its scope is fixed. Auto-shovel shall not change the location of a fixed scope/pod. But this may make designing the auto-shovel algorithm difficult.

Idea 5: Tile or semi-tile based layout in a scope.

@forrestbao
Copy link
Collaborator Author

forrestbao commented Jul 20, 2023

In terms of auto-shrink and auto-expand (when moving a member out and into a scope), @senwang86's feedback is "Auto-layout resets my preferred scope size multiple times, which is annoying" Hence, I think we shall have an option to allow users to toggle auto-shrink per-scope. Auto-expand should always be on.

@forrestbao
Copy link
Collaborator Author

Regarding auto-shovel, this is @senwang86's comments "Inserting a pod between 2 pods makes overall layout messy"
Hence, @senwang86 please see my ideas 2 to 5 in post 1

@senwang86
Copy link
Collaborator

Supplement some context regarding Dr. Bao's comments above.

I gave more tests upon importing a Jupyter notebook, and the recording here shows some improvement are needed regarding auto-layout,

  • Auto-layout resets my preferred scope size multiple times, which is annoying

  • Inserting a pod between 2 pods makes overall layout messy (04:58)

@forrestbao
Copy link
Collaborator Author

  • Auto-layout resets my preferred scope size multiple times, which is annoying

I have seen the video. I feel part of the reason is how you use CodePod. Why do you wanna create a big empty scope? A scope is designed to tightly wrap pods. The way I use it to create pods inside of a scope and the scope will grow automatically. Similarly, it will grow as you move pods/scopes into a scope.

  • Inserting a pod between 2 pods makes overall layout messy (04:58)

I agree with this.

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

No branches or pull requests

2 participants