Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Drag and drop layout management #252

Merged
merged 5 commits into from
May 20, 2016
Merged

Drag and drop layout management #252

merged 5 commits into from
May 20, 2016

Conversation

MikeInnes
Copy link
Contributor

layout

This kind of UI is really handy for those who are less keyboard-savvy, especially if you have a bunch of plots / workspace panes / consoles etc. open and don't want to remember the right sequence of commands needed to organise things :)

I'm still fairly new to CoffeeScript / Atom development so feedback is definitely appreciated. The global @lastSplit approach is a bit weird, but seems to be necessary as the dragend event gives different clientX and clientY coordinates which throws things off. I've aimed for an overlay styling that works well with both light and dark syntax / ui themes, but other suggestions are appreciated there as well.

@lee-dohm
Copy link
Contributor

Could you add specs for this so that we are sure that we don't break it in future changes?

@MikeInnes
Copy link
Contributor Author

Sure thing, I've added a couple of tests and will finish them off tomorrow – let me know if they look ok so far.

@lee-dohm
Copy link
Contributor

👍 Looks really good so far! Please @-mention me when you've got things fixed up so I can review it again. Thanks again for the hard work!

@MikeInnes
Copy link
Contributor Author

@lee-dohm Glad I can be helpful – and thank you for the review! I've finished off the last couple tests.

@MikeInnes
Copy link
Contributor Author

Just bumping this, would be great to get a review.

By the way, for the testing I've had to inject test values into the layout module in place of the usual clientWidth/clientHeight, but it looks like I might (?) be able to avoid that by attaching the workspace to the dom for the tests. I haven't played around with that, though, so I don't know if it will actually work; let me know if it's something I should do.

@benogle
Copy link
Contributor

benogle commented Feb 3, 2016

Thanks, it's in our review queue. Our review queue, however, is long, so it might take a bit to get to.

@MikeInnes
Copy link
Contributor Author

Ok great, well it's good to know it's in the pipeline, so thanks for the update!

@jerone
Copy link
Contributor

jerone commented Feb 8, 2016

I'm not a keyboard guy and applaud any UI improvements, but this is super awesome! 👍

I've played with it and it works great. Did notice that it only works when the tab is focused, but that could be an original tabs issue.

Was wondering about your cursor in the screengrab... I'm on Windows and there it shows just the drag cursor (cursor drag move).


Atom 1.5.0-beta3
Windows 7


innerBounds: ({left, top, width, height}, [x, y, w, h]) ->
left += x*width; top += y*height
width *= w; height *= h
Copy link
Contributor

Choose a reason for hiding this comment

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

Intentional use of semicolon?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, I just found that laying the statements out in a rectangle made it more intuitive for me. I'll be happy to defer to the maintainers if people don't like the style, of course.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, it would be great to get this all on separate lines 😄 Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@MikeInnes
Copy link
Contributor Author

@jerone thanks for the feedback, and glad you like it! I haven't (intentionally) changed the cursor or focus behaviour, but did also find it odd that it only works with a focused tab pane. Could look into changing that if it seems like a good fix.

@MikeInnes
Copy link
Contributor Author

There's something strange going on with the tests – they passed fine before but now fail despite no code changes (the empty commit foo demonstrates this). Seems to be related to pending-tab code. Let me know what, if anything, I should do about that.

@lee-dohm
Copy link
Contributor

The production version of Atom changed from v1.4.3 to v1.5.0 yesterday which included some pending tabs changes, I believe. This PR will need to be updated to work with that feature. (Fortunately, it is only one failing test 😀)

@MikeInnes
Copy link
Contributor Author

Looks like it's an issue with the master branch of this package, rather than being specific to this PR.

@MikeInnes
Copy link
Contributor Author

Have rebased over the now-working master and the green light is back on.

@SebastianSzturo
Copy link

This is really amazing! Great work @MikeInnes 🎉 ❤️

@alexandernst
Copy link

Can't wait to see this merged!! 👍

@infogulch
Copy link

@MikeInnes mentioned a problem, quoted below. Issue #190 is tracking this, I just wanted to link them.

changed the cursor or focus behaviour, but did also find it odd that it only works with a focused pane. Could look into changing that if it seems like a good fix.

@MikeInnes
Copy link
Contributor Author

Just bumping this again, I don't want to be impatient but it has been nearly four months since I opened the PR.

@simurai
Copy link
Contributor

simurai commented May 18, 2016

👍 on adding this. It feels pretty intuitive and quick without having to think what command to use.

@lee-dohm
Copy link
Contributor

@MikeInnes Would you mind fixing the merge conflicts? Once you do, I'll take a look at getting this merged.

activate: ->
@view = document.createElement 'div'
@view.classList.add 'layout-overlay'
document.body.appendChild @view
Copy link
Contributor

@simurai simurai May 19, 2016

Choose a reason for hiding this comment

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

Not too critical, but maybe something to consider. Move the layout-overlay element inside atom-pane-container.panes?

screen shot 2016-05-19 at 9 44 43 am

Just so the DOM root stays a bit more organized. Not sure if this would mess up the calculations.

And/or rename it to tabs-layout-overlay. Then it's more clear that this element is part of the tabs package and shouldn't be used for something else.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the tips, will go ahead and do both!

Copy link
Contributor Author

@MikeInnes MikeInnes May 19, 2016

Choose a reason for hiding this comment

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

Ok so I did the rename and played around with adding the overlay to atom-pane-container.panes. Doing that complicates the layout logic a little (which should be fixable) but unfortunately also seems to confuse Atom's pane logic, resulting in empty panes appearing and such.

Instead I added the overlay to atom-workspace, which which I think solves the issue of keeping the root node clean – hope that's ok.

@MikeInnes
Copy link
Contributor Author

@lee-dohm will do, thanks a lot for taking a look.

@lee-dohm
Copy link
Contributor

Thanks so much for all your hard work on this @MikeInnes!

@lee-dohm lee-dohm merged commit 2e3bcf2 into atom:master May 20, 2016
@anaisbetts
Copy link

This is Right and Good, 👏 👏 : clap:

@MikeInnes
Copy link
Contributor Author

Awesome, very happy to see this in – thank you @lee-dohm!

@morassman
Copy link

Amazing! I made my own plugin for this behavior, tabasco, but I'll rather use the official implementation once it's part of Atom. Very nice!

@Chrisedmo
Copy link

Damn. Nice. 👊🏼

@bronson
Copy link

bronson commented Apr 20, 2017

This is one of my favorite features of 2016. Love using it.

Any chance of making it work when dropping the tab in a new window? atom/atom#14273

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

Successfully merging this pull request may close these issues.