-
Notifications
You must be signed in to change notification settings - Fork 975
Converts urlBarSuggestions into redux #9051
Conversation
582da77
to
02d5877
Compare
02d5877
to
69064fe
Compare
69064fe
to
aa06e4a
Compare
aa06e4a
to
24cb857
Compare
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.
lgtm
mergeProps (state, dispatchProps, ownProps) { | ||
const currentWindow = state.get('currentWindow') | ||
const activeFrame = frameStateUtil.getActiveFrame(currentWindow) || Immutable.Map() | ||
const urlBar = activeFrame.getIn(['navbar', 'urlbar']) || Immutable.Map() |
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.
just fyi - you can use activeFrame.getIn(['navbar', 'urlbar'], Immutable.Map())
which is a little safer because it properly handles falsy values when applicable
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.
nice, fixed
const activeFrame = frameStateUtil.getActiveFrame(currentWindow) || Immutable.Map() | ||
const urlBar = activeFrame.getIn(['navbar', 'urlbar']) || Immutable.Map() | ||
const documentHeight = Number.parseInt( | ||
window.getComputedStyle(document.querySelector(':root')).getPropertyValue('--navbar-height'), 10 |
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 should add a TODO to take a look at this because I suspect getting the computed styles for the entire document is very slow
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 will fix all computed styles in #9176, so I think there is no need for TODO
* @param {number} windowId - the window ID | ||
* @param {number} selectedIndex - The index for the selected item (users can select items with down arrow on their keyboard) | ||
*/ | ||
urlBarSelectedIndexChanged: function (windowId, selectedIndex) { |
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 like this change to pass the index instead of calculating the selections in the component
Resolves brave#9052 Auditors: @bsclifton @bridiver @bbondy Test Plan: - test if suggestion list is displayed - test if hover and click is working on suggestion list
24cb857
to
97015ef
Compare
Submitter Checklist:
git rebase -i
to squash commits (if needed).Auditors: @bsclifton @bridiver @bbondy
Test Plan:
Reviewer Checklist:
Tests