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

Close tab page option #6570

Merged
merged 3 commits into from
Apr 5, 2017

Conversation

NejcZdovc
Copy link
Contributor

@NejcZdovc NejcZdovc commented Jan 7, 2017

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).

Description

Resolves #5489

Auditors

@bbondy @bsclifton

Test Plan

  • open two tab pages
  • right click on one and click close tab page
  • all tabs in tab pages should be closed

@NejcZdovc NejcZdovc self-assigned this Jan 9, 2017
@luixxiul luixxiul added this to the 0.13.1 milestone Jan 12, 2017
@luixxiul luixxiul changed the base branch from master to 0.13.1-branch January 14, 2017 14:56
@bsclifton bsclifton force-pushed the 0.13.1-branch branch 5 times, most recently from 5098230 to 187fa9a Compare January 20, 2017 00:12
@NejcZdovc NejcZdovc changed the title Added close tab page Close tab page option Jan 22, 2017
@bsclifton bsclifton force-pushed the 0.13.1-branch branch 4 times, most recently from 65c7753 to 238cfd3 Compare January 25, 2017 19:19
@bsclifton bsclifton modified the milestones: 0.13.2, 0.13.1 Jan 26, 2017
@bsclifton bsclifton closed this Jan 26, 2017
@bsclifton bsclifton changed the base branch from 0.13.1-branch to master January 26, 2017 21:18
@bsclifton bsclifton reopened this Jan 26, 2017
* @param {Object} framesList - List of frames
* @param {Object} framePropsList - List of frame properties to consider
*/
closeTabPage: function (framesList, framePropsList) {
Copy link
Member

Choose a reason for hiding this comment

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

Could you name this tabPageClosed?

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

@NejcZdovc NejcZdovc force-pushed the feature/#5489-close-tab-page branch 3 times, most recently from b4277d1 to 9d79860 Compare February 7, 2017 21:30
@@ -13,6 +13,7 @@ openLocation=Open Location…
openSearch=Search for "{{selectedVariable}}"
importFrom=Import from…
closeWindow=Close Window
closeTabPage=Close tab page
Copy link
Contributor

Choose a reason for hiding this comment

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

how about renaming this into tabPageClosed as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking about it, but I am not sure.

Copy link
Member

Choose a reason for hiding this comment

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

I think it's OK as-is; it matches the English and also consistent format with closeWindow

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree!

* @param {Object[]} framePropsList - The properties of all frames to close
*/
closeFrames: function (framePropsList) {
const activeFrameKey = windowStore.getState().get('activeFrameKey')
Copy link
Member

Choose a reason for hiding this comment

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

ideally there should be no logic inside the window action, I think you should just make it an easy api and have it declarative, so like windowAction.tabPageClosed(i) for the index to close. The store then does the work to figure out which frames it needs to close and closes them all in one swoop.

Copy link
Member

Choose a reason for hiding this comment

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

+1 on that

@bsclifton bsclifton modified the milestones: 0.13.7, 0.13.6 Mar 10, 2017
@bsclifton
Copy link
Member

bsclifton commented Apr 3, 2017

@NejcZdovc is this ready for review? if so, let's rebase 😄

@NejcZdovc
Copy link
Contributor Author

This PR is done, tested and it's working correctly. The only thing is that there is some logic in window action, so it should be refactored according to @bbondy comment

@bbondy
Copy link
Member

bbondy commented Apr 3, 2017

yes sorry, we can't accept new PRs with logic in the window action.

@NejcZdovc
Copy link
Contributor Author

@bbondy totally understandable, will refactor it, not a problem

Resolves brave#5489

Auditors: @bbondy @bsclifton

Test Plan:
- open two tab pages
- right click on one and click close tab page
- all tabs in tab pages should be closed
@NejcZdovc
Copy link
Contributor Author

@bbondy refactored, ready for a review

@@ -283,4 +283,75 @@ describe('frameStateUtil', function () {
})
})
})

describe('removeFrames', function () {
Copy link
Member

@bsclifton bsclifton Apr 5, 2017

Choose a reason for hiding this comment

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

❤️ the tests

Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

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

Looks great 😄 I had reviewed this with you earlier and definitely approve of the changes. ++!

Copy link
Contributor

@cezaraugusto cezaraugusto left a comment

Choose a reason for hiding this comment

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

Awesome work here. Feature works, tests pass and super cool the split of logic to a frameReducer. LGTM

return state
}

module.exports = frameReducer
Copy link
Contributor

Choose a reason for hiding this comment

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

awesome++++

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.

Added context-menu option to close tabs in tab page
6 participants