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

Resize pane #16428

Merged
merged 7 commits into from Mar 9, 2018

Conversation

Projects
None yet
3 participants
@ernesto28
Contributor

ernesto28 commented Dec 22, 2017

Requirements

Atom : 1.23.1
Electron: 1.6.15
Chrome : 56.0.2924.87
Node : 7.4.0

Description of the Change

Atom gets into a perplexing state for some people (for example) whether by some combination of keys or package actions where there is only one pane, but it does not take up the full width of the editor window. This changes in this Pull request prevent atom to get into this state.

Alternate Designs

NA

Why Should This Be In Core?

Fixes a bad behavior in atom UI

Benefits

Added test for the new code
Better experience in atom UI

Possible Drawbacks

None that I can think of.

Applicable Issues

It's applicable to #11673

@50Wliu

Thanks for taking this on! I've left some minor review comments below.

singlePane = container.getActivePane()
describe "when pane:increase-size is triggered", ->
it "increases the size of the pane", ->

This comment has been minimized.

@50Wliu

50Wliu Dec 22, 2017

Member

These spec descriptions are incorrect - can you change them?

src/pane.js Outdated
@@ -155,9 +155,17 @@ class Pane {
getFlexScale () { return this.flexScale }
increaseSize () { this.setFlexScale(this.getFlexScale() * 1.1) }
increaseSize () {
if (this.getContainer().getPanes().length > 1){

This comment has been minimized.

@50Wliu

50Wliu Dec 22, 2017

Member

Style: space before opening bracket

src/pane.js Outdated
decreaseSize () { this.setFlexScale(this.getFlexScale() / 1.1) }
decreaseSize () {
if (this.getContainer().getPanes().length > 1){

This comment has been minimized.

@50Wliu

50Wliu Dec 22, 2017

Member

Style: space before opening bracket

expect(singlePane.getFlexScale()).toBe 1
describe "when pane:decrease-size is triggered", ->
it "decreases the size of the pane", ->

This comment has been minimized.

@50Wliu

50Wliu Dec 22, 2017

Member

Same here

expect(singlePane.getFlexScale()).toBe 1
atom.commands.dispatch(singlePane.getElement(), 'pane:decrease-size')
expect(singlePane.getFlexScale()).toBe 1

This comment has been minimized.

@50Wliu

50Wliu Dec 22, 2017

Member

Newline should be added at the end of the file

@@ -237,3 +237,30 @@ describe "PaneContainerElement", ->
atom.commands.dispatch(rightPane.getElement(), 'pane:decrease-size')
expect(leftPane.getFlexScale()).toBe 1/1.1
expect(rightPane.getFlexScale()).toBe 1/1.1
describe "one pane resizing", ->

This comment has been minimized.

@50Wliu

50Wliu Dec 22, 2017

Member

How about when only a single pane is present

@ernesto28

This comment has been minimized.

Contributor

ernesto28 commented Dec 22, 2017

@50Wliu Thanks, I'll change them

ernesto28 added some commits Dec 22, 2017

@50Wliu

This comment has been minimized.

Member

50Wliu commented Dec 22, 2017

Thanks! You'll also need to remove the package-lock.json files you checked in as Atom won't build if they're present.

@ernesto28

This comment has been minimized.

Contributor

ernesto28 commented Dec 22, 2017

Got it, I'll delete them

@50Wliu

50Wliu approved these changes Dec 22, 2017

@as-cii as-cii self-assigned this Mar 9, 2018

@as-cii as-cii merged commit e2c89b2 into atom:master Mar 9, 2018

3 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@as-cii

This comment has been minimized.

Member

as-cii commented Mar 9, 2018

Looks great, nice work! ⚡️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment