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

Search Settings Panel: Search Suggestions (Part 1) #2726

Merged
merged 9 commits into from
Aug 2, 2016

Conversation

darkdh
Copy link
Member

@darkdh darkdh commented Jul 26, 2016

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Ran git rebase -i to squash commits if needed.

fix #2694

@bbondy bbondy added this to the 0.11.3dev milestone Jul 26, 2016
@darkdh
Copy link
Member Author

darkdh commented Jul 27, 2016

ibwiwmffpi

The cursor will be point on each entry to indicate user that is clickable. Recording cannot catch it and I don't know why.

@darkdh darkdh force-pushed the SearchSuggetions branch from 5af84f9 to f7fa659 Compare July 27, 2016 15:06
@darkdh darkdh changed the title Search Settings Panel: Search Suggestions (Part 1) [WIP] Search Settings Panel: Search Suggestions (Part 1) Jul 27, 2016
@darkdh darkdh force-pushed the SearchSuggetions branch from 0359c3a to 99019b3 Compare July 27, 2016 15:39
@bbondy
Copy link
Member

bbondy commented Jul 27, 2016

wow this is looking really awesome so far. The functionality is a major improvement over our current search experience.

Here's a few things I noticed from testing:

  • When I go to Search preferences, it is not showing me my default from 0.11.1
  • It might already be the case but please make sure the default from 0.11.1 is preserved
  • When you detect a prefix in the urlbar please show the favicon to the left in the urlbar.
  • The titles of the search preferences page (Default, Search Engines, Engine Go Key (type first)), seem to underline and look like they are clickable but they don’t do anything. Maybe just remove the underlining for them for now.

@@ -134,7 +134,7 @@ AppStore
'general.downloads.default-save-path': string, // default path for saving files
'general.autohide-menu': boolean, // true if the Windows menu should be autohidden
'general.disable-title-mode': boolean, // true if title mode should always be disabled
'search.default-search-engine': string, // path to the open search XML
'search.default-search-engine': string, // name of search engine, from js/data/searchProviders.js
Copy link
Member

Choose a reason for hiding this comment

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

This will need to be set inside app.sessionStore based on the user's old selected xml engine. And only done once, after that it should jus preserve the setting. Also some users won't have an old xml setting if it is their first time install.

Copy link
Member

Choose a reason for hiding this comment

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

It is the same setting name as before so just check for special case values of content/search/google.xml and content/search/duckduckgo.xml when loading the session state and migrate accordingly.

@bbondy
Copy link
Member

bbondy commented Jul 27, 2016

ok made a few minor comments but this is close to being able to be merged, this might still make 0.11.2.

@luixxiul luixxiul modified the milestones: 0.11.2dev, 0.11.3dev Jul 28, 2016
@bbondy bbondy modified the milestones: 0.11.3dev, 0.11.2dev Jul 28, 2016
@bbondy
Copy link
Member

bbondy commented Jul 29, 2016

Pls also add some tests for the shortcut prefix text for this as well.

@bbondy
Copy link
Member

bbondy commented Jul 29, 2016

thanks!

@darkdh
Copy link
Member Author

darkdh commented Jul 29, 2016

Ok, working on it

@bbondy
Copy link
Member

bbondy commented Jul 29, 2016

There's a couple things off about the urlbar icon image. It seems like not enough padding on the right and also some of the favicons just look bad. cc @bradleyrichter please take a look locally before you work more on that aspect @darkdh

}
if (data.settings['search.default-search-engine'] === 'contnt/search/duckduckgo.xml') {
data.settings['search.default-search-engine'] = 'DuckDuckGo'
}
Copy link
Member

Choose a reason for hiding this comment

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

great!

@bradleyrichter
Copy link
Contributor

ok. I'll run the PR and reply with suggestions if needed.

So far from the clip above, it looks great!

const searchRE = new RegExp('^' + entry.shortcut + ' .*', 'g')
if (searchRE.test(location)) {
const iconSize = 16
this.searchFaviconStyle = {
Copy link
Member

Choose a reason for hiding this comment

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

Style should really only be calculated inside render, here you'd set state which indicated the active engine, something like frame.x.navbar.urlbar.activeSearchEngine. I think we should also show the favicon as soon as you put searchTerm + ' ' and you don't need an extra char after that. I think it will be fixed by what I'm suggesting here.
You might want to wait for Brad to weigh in first to make sure we still want to have the favicon in the urlbar because I mentioned some of the favicons are looking bad as is, like yahoo and duck duck go seems pixelated.

@bbondy
Copy link
Member

bbondy commented Jul 29, 2016

It's a super great feature, can't wait to get it in. My concerns are with some favicon replacement in the urlbar after the shortcut is entered, in particular I noticed duckduckgo looks small and pixelated and yahoo icon looks huge and ugly. Text doesn't seem to be fully aligned and missing padding as small tweaks that would help. Maybe we need a smaller than 16x16 image here.

@darkdh
Copy link
Member Author

darkdh commented Jul 29, 2016

I noticed that not just urlbar but in search engine table got the same issue. Maybe we should replace the icon image source

@luixxiul
Copy link
Contributor

It would be nice if svg images can be used here

@bradleyrichter
Copy link
Contributor

  1. There is a mystery to solve as to why they appear different in the URL bar and tab...

image

@darkdh Can you check if the same favicon path is being used in both cases?

  1. Can you set the URL bar icon to appear after the space is typed rather than waiting for the first letter?
  2. It looks like the URL bar favicon needs to move down 2 px.
  3. Make sure it is hidden when the URL bar changes to Title Mode.

image

  1. oops. the wrong favicon is sticking around in different URLS.

image

@bradleyrichter
Copy link
Contributor

@darkdh I restyled the panel a bit but I won't commit until your are done with the other things.

Please remove the title under "Search Settings" in your code though...

image

@luixxiul
Copy link
Contributor

Are favicons cached here?

@darkdh
Copy link
Member Author

darkdh commented Jul 30, 2016

Thanks for all your valuable feedback.
There is one problem remain that cause the different icon between preference and urlbar.
Which is I cannot use favicon url in preference due to CSP.
screen shot 2016-07-30 at 16 45 06
So in 3efd6dc there are two image source of search providers in js/data/searchProviders.js. Static data uri is for preference used and favicon url can be used in urlbar.

@bbondy
Copy link
Member

bbondy commented Jul 31, 2016

cc @diracdeltas for advise.

@diracdeltas
Copy link
Member

feel free to change the app/extensions.js CSP (i assume that's where the error is from?) to * data:

@darkdh
Copy link
Member Author

darkdh commented Aug 2, 2016

Thanks @diracdeltas. It works fine now.

@bradleyrichter
Copy link
Contributor

@darkdh Can you please use this fontawesome icon in place of the "X" to indicate the default choice?

http://fontawesome.io/icon/check-square/

16x16px

Color it as @braveorange or #FF5000.

@darkdh
Copy link
Member Author

darkdh commented Aug 2, 2016

@bradleyrichter Ok, I will replace it with fontawesome in next commit.

@darkdh
Copy link
Member Author

darkdh commented Aug 2, 2016

@bradleyrichter , please take a look at screenshot of b9567d6
screen shot 2016-08-02 at 10 54 09

@bradleyrichter
Copy link
Contributor

looks great! thanks...

@bbondy bbondy modified the milestones: 0.11.2dev, 0.11.3dev Aug 2, 2016
@darkdh darkdh force-pushed the SearchSuggetions branch from 6fa97b1 to 688fa23 Compare August 2, 2016 05:29
@bbondy bbondy merged commit 2e150a4 into brave:master Aug 2, 2016
@bbondy
Copy link
Member

bbondy commented Aug 2, 2016

thanks for all your hard work on this!

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.

Search Settings Panel: Search Suggestions (Part 1)
5 participants