-
Notifications
You must be signed in to change notification settings - Fork 975
Close tab page option #6570
Close tab page option #6570
Conversation
5098230
to
187fa9a
Compare
65c7753
to
238cfd3
Compare
67b2326
to
5eb09be
Compare
js/actions/windowActions.js
Outdated
* @param {Object} framesList - List of frames | ||
* @param {Object} framePropsList - List of frame properties to consider | ||
*/ | ||
closeTabPage: function (framesList, framePropsList) { |
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.
Could you name this tabPageClosed?
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.
Done
b4277d1
to
9d79860
Compare
@@ -13,6 +13,7 @@ openLocation=Open Location… | |||
openSearch=Search for "{{selectedVariable}}" | |||
importFrom=Import from… | |||
closeWindow=Close Window | |||
closeTabPage=Close tab page |
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.
how about renaming this into tabPageClosed
as well?
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.
I was thinking about it, but I am not sure.
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.
I think it's OK as-is; it matches the English and also consistent format with closeWindow
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.
I agree!
4be5b03
to
555eb87
Compare
js/actions/windowActions.js
Outdated
* @param {Object[]} framePropsList - The properties of all frames to close | ||
*/ | ||
closeFrames: function (framePropsList) { | ||
const activeFrameKey = windowStore.getState().get('activeFrameKey') |
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.
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.
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.
+1 on that
@NejcZdovc is this ready for review? if so, let's rebase 😄 |
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 |
yes sorry, we can't accept new PRs with logic in the window action. |
@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
555eb87
to
54cf311
Compare
@bbondy refactored, ready for a review |
@@ -283,4 +283,75 @@ describe('frameStateUtil', function () { | |||
}) | |||
}) | |||
}) | |||
|
|||
describe('removeFrames', function () { |
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.
❤️ the tests
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.
Looks great 😄 I had reviewed this with you earlier and definitely approve of the changes. ++!
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.
Awesome work here. Feature works, tests pass and super cool the split of logic to a frameReducer. LGTM
return state | ||
} | ||
|
||
module.exports = frameReducer |
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.
awesome++++
git rebase -i
to squash commits (if needed).Description
Resolves #5489
Auditors
@bbondy @bsclifton
Test Plan