-
Notifications
You must be signed in to change notification settings - Fork 975
Reduce redundant siteSort to sort once and used everywhere #8075
Conversation
++ please rebase and merge |
rebased. please review again. |
e595fa3
to
302a543
Compare
js/stores/appStore.js
Outdated
const d = diff(lastEmittedState, appState) | ||
// diff and patch will make map out of order so toList() is to maintain | ||
// sites map order | ||
const diffAppState = appState.set('sites', appState.get('sites').toList()) |
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.
We need a better way to deal with the out of order.
This will cause significant slowness
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.
@darkdh is this still a WIP? Sorry for not reviewing earlier |
sorry, this is waiting for shared app state change landed |
299a076
to
4900648
Compare
let's wait for tests, but on a first glance it looks good to me |
There are two failed test I need to look into
|
fix |
@@ -149,8 +149,8 @@ describe('sitesReducerTest', function () { | |||
moveAction.prepend = true | |||
newState = sitesReducer(Immutable.fromJS(newState), moveAction).toJS() | |||
assert.equal(Object.keys(newState.sites).length, 3) | |||
assert.equal(Object.values(newState.sites)[2].location, url) | |||
assert.equal(Object.values(newState.sites)[2].order, 1) | |||
assert.equal(Object.values(newState.sites)[1].location, url) |
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.
Is this correct change, because the comment at the top states that site should be at the third position (2), but you changed this value to 1
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.
Yes, we will sort sites after ADD, REMOVE, MOVE in this PR
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.
If this is correct then I would add some description about it beside this comment, otherwise it could be confusing
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.
comment added
Please rebase again @darkdh |
@bbondy, rebased! |
fix #7240 Auditors: @bbondy, @bsclifton Test Plan: 1. Import bunch of bookmarks 2. Open bookmarks of menu shouldn't affect performance 3. Open about:bookmarks shouldn't affect performance
Reduce redundant siteSort to sort once and used everywhere
Reduce redundant siteSort to sort once and used everywhere
fix #7240
Auditors: @bbondy, @bsclifton
Test Plan:
git rebase -i
to squash commits (if needed).