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

Properly handle URL bar icon when searching and focus changes #6319

Merged
merged 1 commit into from
Jan 18, 2017
Merged

Properly handle URL bar icon when searching and focus changes #6319

merged 1 commit into from
Jan 18, 2017

Conversation

gyandeeps
Copy link
Contributor

@gyandeeps gyandeeps commented Dec 20, 2016

  • 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).

Fixes #6273

Test Plan:

  • enable "always show URL bar", to make testing easier
  • go to google.com and notice the lock in the omnibox
  • start typing a search into a the omnibox and notice icon changes to magnifying glass
  • click inside the webpage. icon should stay as magnifying glass and search terms should still be shown. This confirms the fix (the bug before was that it would revert to showing the lock icon next to the search terms)
  • click in the omnibox and press escape. This should reset icon back to lock and reset input back to google.com

@luixxiul luixxiul added this to the 0.13.1 milestone Dec 20, 2016
@bradleyrichter
Copy link
Contributor

@bsclifton Let's check and pull this one. Nice fix...thanks to @gyandeeps !

@bsclifton
Copy link
Member

awesome, thanks @gyandeeps 😄 I'll make sure we review this for our next release (we're a little backed up on PRs- hang in there with us 😄 )

@@ -11,6 +11,19 @@ const dndData = require('../../../js/dndData')
const {isSourceAboutUrl} = require('../../../js/lib/appUrlUtil')
const searchIconSize = 16

const getIconCssClass = (ctx) => {
if (ctx.isSearch) {
Copy link
Contributor

@luixxiul luixxiul Dec 21, 2016

Choose a reason for hiding this comment

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

I'd add !ctx.isAboutPage to stop returining fa-search fa-list.

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 am not able to understand the use case here. Can you please explain the issue u r seeing?

Copy link
Contributor

@luixxiul luixxiul Dec 21, 2016

Choose a reason for hiding this comment

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

ah sorry, I have pushed a PR to place the icon at the center of the input bar, and adding !ctx.isAboutPage avoids the CSS hack for fa-search to push 1px downward being applied to the url bar icon fa-list on about:preferences. https://github.com/brave/browser-laptop/pull/6292/files#diff-f5d8e85b88bbb4fdd8ebaf50901ebb3fR69 and https://github.com/brave/browser-laptop/pull/6292/files#diff-02c4b23ad267fe636760179e32fa29ceR830

Copy link
Contributor

Choose a reason for hiding this comment

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

still because it's not the issue which this PR tries to resolve, you might skip it. I'll take care of it then

Copy link
Contributor Author

Choose a reason for hiding this comment

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

k. But i dont think you need to make this change since now its if-else so only one class gets returned by this function. So you can never have a fa-search fa-list together.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not quite sure how it does work but do you mean ctx.isSearch && !ctx.isAboutPage is not necessary? I'm thinking the case where you try to search something on the URL bar on about:preferences.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes and when you try to search something on about:preference page then it will hit the search if condition on top and start showing the search icon. because that what you want when you are searching doenst matter on which page u r on. That how i am thinking about this.

Copy link
Contributor

Choose a reason for hiding this comment

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

CC @bradleyrichter for this change

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. The search icon should be displayed any time you are searching regardless of previous/current page because the URL bar mode changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

@gyandeeps I tested on the latest master and it looks good on about:prefenreces :-D

@bsclifton bsclifton changed the base branch from master to 0.13.1-branch January 14, 2017 06:45
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.

Great job! Sorry that it took me so long to review ☹️ I tested this out and it's working perfectly 😄 I rebased against our 0.13.1-branch and updated the test steps to be a little more clear

Thanks again! 😄

@bsclifton bsclifton changed the title Fix: Url bar icon for search mode (fixes #6273) Properly handle URL bar icon when searching and focus changes Jan 14, 2017
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.

While reviewing the tests, I did notice one of them is failing.

@gyandeeps can you fix this webdriver test?
npm run test -- --grep="navigationBar tests lockIcon Shows insecure URL icon"

If you haven't ran our webdriver tests before, you'd just have two terminal instances; one of them you'd run npm run watch-test and the other you'd run the above 😄

In this case, it's supposed to be showing the insecure icon... but it's showing NO icon (blank white space). NOTE: If you're on Windows, the webdriver tests won't work; let me know in that case

@bsclifton
Copy link
Member

Rebasing this one right now and then I'll check out the failing test 😄

@bsclifton
Copy link
Member

This likely still has a broken test... but couldn't confirm 100% because of a broken chromedriver dependency after doing fresh npm install. I'll investigate / fix tomorrow morning 😄

@gyandeeps gyandeeps deleted the issue6273 branch January 18, 2017 14:48
bsclifton added a commit that referenced this pull request Jan 19, 2017
I missed this with #6319
but our tests caught it :)

Auditors: @gyandeeps
bsclifton added a commit that referenced this pull request Jan 20, 2017
I missed this with #6319
but our tests caught it :)

Auditors: @gyandeeps
NejcZdovc pushed a commit to NejcZdovc/browser-laptop that referenced this pull request Jan 23, 2017
I missed this with brave#6319
but our tests caught it :)

Auditors: @gyandeeps
bsclifton added a commit that referenced this pull request Jan 23, 2017
I missed this with #6319
but our tests caught it :)

Auditors: @gyandeeps
bsclifton added a commit that referenced this pull request Jan 24, 2017
I missed this with #6319
but our tests caught it :)

Auditors: @gyandeeps
bsclifton added a commit that referenced this pull request Jan 25, 2017
I missed this with #6319
but our tests caught it :)

Auditors: @gyandeeps
bsclifton added a commit that referenced this pull request Jan 25, 2017
I missed this with #6319
but our tests caught it :)

Auditors: @gyandeeps
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.

5 participants