-
Notifications
You must be signed in to change notification settings - Fork 356
Add configurable pane direction. #368
base: master
Are you sure you want to change the base?
Conversation
Addresses atom#99 and part of atom#328. Does _not_ address any kind of "opposite" setting. Migrates existing true/false (pane to the right or not) config settings into "right"/"none" equivalent value. Note: In order to migrate an exiting setting, we have to run code very early when the module loads, _before_ it activates. This is unfortunate from a performance standpoint. If we're willing to simply lose any previous configuration setting (falling back to the default, "right"), we can avoid the perf impact of doing work during module load. I'm completely open to the wisdom of the Atom community here; I just wanted to start with an already-backward-compatible option.
Not sure why travis timed out. I do get two errors from |
Yes, master is currently failing due to language-javascript changes. Unfortunately I can't keep both Atom core and markdown-preview green (until the JS changes land in a released Atom version)...it's either one or the other 😦. |
An alternative would be to keep the flag and add the enumeration, so that And just to be clear, I'm not saying it would be best, just wanted bring an alternative to discussion. On the other hand, there's one more thing I wanted to bring to the table. This functionality currently relies on the |
@acontreras89 : Does that mean that the documented behavior is incorrect? Regardless, the 95+% case (and the one I personally want) is simply to add 'bottom' as an option; dropping the functionality down to just none/right/bottom is totally acceptable to me, and doesn't prevent left/top from being added in the future. Also, leaving the flag in place and only checking the string/enum when |
The documented behaviour doesn't give any details as to what happens when no pane is available in the given direction. @lee-dohm, maybe it should state that for It also says
although the values to obtain a vertical splits are With regard to the config. options, I can see your point @JaredReisinger. I personally prefer to take the approach that better fits my mental model, in which (1) deciding whether to use the current pane or a new one is a I thought it was worth proposing this alternative as it would also avoid migrating the configuration. Despite this, if I could have a dropdown with all five options and two underlying setting values a boolean and a direction,) I'd go with that. It seems like a better user experience to just have one config option. |
I made the doc changes that @acontreras89 pointed out. They're on |
@acontreras89 : All good points, and I really hate the config migration code. I'll put this back to flag+enum, and reduce the available enum options to "right" and "down", so it actually works. ;-) |
I'm glad we agree 😄 but keep in mind I'm a regular contributor, just like you. Wouldn't mind asking for a second opinion on this before making any changes. For now, we could add some specs, as updating them later on shouldn't be a problem. |
Because Atom doesn't have a mechanism for one setting disabling another, such as the checkbox for on/off and dropdown for direction, this tends to be confusing for people. Because of that, the dropdown with all five options is much preferred 😀 |
I see your point @lee-dohm. Off topic, do you think that kind of behaviour would be nice to have? |
Hah! I pushed my change before seeing @lee-dohm's comment. I'll revert the commit, but then still drop the list from 5 values to 3 ( |
…for direction" This reverts commit a275d9c.
Conflicts: lib/main.coffee
Check to see that split direction `right` causes a `horizontal` PaneAxis orientation, and a `down` direction causes a `vertical` orientation.
Okay... we're back to a single Finally, the unit tests were modified to check the PaneAxis orientation, with new tests to explicitly check that |
Thanks for the very clear update @JaredReisinger. Apologies that nobody from the core team has looked at this for the last couple of weeks. I am ok with the decision not to migrate the old setting. I also think that since we aren't trying to remain backwards-compatibility in that respect, we should rename the setting. The name |
@maxbrunsfeld : Sounds good. (And apparently I'm not much better at following up on this PR either! Having a local build—love the link to local package feature!—means I've been running with "preview below" on my vertical monitor, so I'm a happy camper even if this take a while to get in.) Same deal as before for the two failing tests: it's a known issue, and unrelated to the change/PR. |
Conflicts: README.md
@maxbrunsfeld: After much delay (sadly), I happened to check back and merge in all of the changes that have happened in the interim. The great news is that the (unrelated) previously failing tests have been fixed, and this PR now looks better than it did before, check-wise. If there's anything I can do to help get this reviewed, please don't hesitate to ask. Thanks! |
@JaredReisinger, is the merge conflict in |
…tion Conflicts: README.md
@walles: Possibly. I simply hadn't checked back on this PR for ages, and didn't see it now had a merge conflict. It was an easy fix, though, so it should no longer be a blocker. |
Is it just me, or does the recent AppVeyor failure have absolutely nothing to do with this change? It's failing to retrieve the build package from GitHub for the beta x64 build. (It doesn't even get to the tests.) The other AppVeyor builds complete successfully. |
Don't worry about CI failures. They don't block the merge and if there's a legitimate failure we'll tell you. |
Good to know! Thanks, @50Wliu! |
@rafeca : This PR has been languishing for over three years since I first offered it, but I still find the idea useful since I tend to run my Atom windows "tall and narrow", so an up/down split for Markdown previews is desirable. Would you consider merging this (once the merge conflicts are resolved, or perhaps if I close this and create an all-new PR)? If you don't think the feature is useful, I'll just close this and live with moving the panes by hand. Thanks! |
Really sorry for the delay here @JaredReisinger:
I'll bring this up for you with the other maintainers and we'll followup as soon as we can. |
Just wanted to let you know that we chatted about your PR @JaredReisinger and are 👍 on reviewing it if you can go ahead and resolve the merge conflicts. Thanks very much for checking in with us about this and sorry again for the delay. |
Addresses #99 and part of #328. Does not address any kind of "opposite" setting.
Migrates existing true/false (pane to the right or not) config settings into "right"/"none" equivalent value.
Note: In order to migrate an exiting setting, we have to run code very early when the module loads, before it activates. This is unfortunate from a performance standpoint. If we're willing to simply lose any previous configuration setting (falling back to the default, "right"), we can avoid the perf impact of doing work during module load. I'm completely open to the wisdom of the Atom community here; I just wanted to start with an already-backward-compatible option.