-
-
Notifications
You must be signed in to change notification settings - Fork 127
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
Splits with merge option for dock panels #582
Conversation
Thanks for submitting your first pull request! You are awesome! 🤗 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, I agree that this is a nice improvement.
- To fix the failing test, you can run
yarn run api
from top level directory and commit the changes. - Would you be able to add some minimal tests for the newly added modes in
docklayout.spec.ts
?
lumino/packages/widgets/tests/src/docklayout.spec.ts
Lines 246 to 248 in 7e25156
describe('#addWidget()', () => { | |
it.skip('should have some tests'); | |
}); |
sure @krassowski maybe give me a few days, but I'm happy to address the fit & finish |
@krassowski all the checks have passed now except macos/firefox which I guess is a known issue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @tavin!
@krassowski You're welcome. I presume someone will merge this (I don't have merge access)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @tavin
* dock insert modes allowing reuse of existing splits * splits and merges in dockpanel example * revise description of merge modes * yarn ran api * rudimentary tests for addWidget() * ¯\_(ツ)_/¯
The point of this new feature is to avoid the following situation:
I think it's a widely accepted convention to work in a layout of 3 panels: file tree, text editor, and preview. But if launching the preview always splits the editor widget, you keep winding up with 2 preview splits and you repeatedly have to drag one of the preview tabs over to the adjacent split.
To solve this I have introduced 4 new insert modes (
merge-left, merge-right, merge-top, merge-bottom
) which function like (split-left, split-right, split-top, split-bottom
) but any existing splits will be reused. The behavior effectively changes totab-after
on the tab layout found to the left/right/top/bottom.See the dockpanel example which now has a context menu for split and merge operations on the content widgets.