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

Brand new about:newtab page #5301

Merged
merged 4 commits into from
Nov 1, 2016
Merged

Brand new about:newtab page #5301

merged 4 commits into from
Nov 1, 2016

Conversation

bsclifton
Copy link
Member

@bsclifton bsclifton commented Nov 1, 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).

Auditors: @bbondy @bradleyrichter @jkup

Summary

The project that @cezaraugusto has been working hard to deliver!

(his original PR for reference: #3199)

This PR adds an attractive new screen for use with new tabs. It features:

  • lifetime stats (the # of ads/trackers blocked, # http resources upgraded, etc)
  • a beautiful image with attribution to the author
  • quick links to preferences, history, bookmarks
  • a customizable grid view featuring high-res favicons (if available) for 6, 12, or 18 sites

The screen is of course optional; you can instead choose to open a new tab to:

  • your home page
  • your default search engine

Brand new about:newtab screen to Brave (fixes #3001):

screen shot 2016-11-01 at 12 41 44 am

about:newtab screen is configurable in preferences (fixes #2106):

screen shot 2016-11-01 at 12 45 11 am

What's left?

  • "blank" mode needs to be removed. It was put in to prevent folks from getting the newtab page if this was accidentally merged. Picking "blank" preserves the existing behavior of an empty page.

Other work and feature requests can be found by searching our issues with the new feature/newtab label:
feature/newtab

cezaraugusto and others added 3 commits November 1, 2016 00:06
Fixes #3001

Test plan for unpinning topSites:
* Pin a topSite
* Check that there are a pinned icon
* Hover over topSite
* Check that there are a minus icon
* Hit minus icon
* Pinned icon should be removed
Updates to resources / styles
- moving SVGs into img/newtab/ folder
- standardized colors between about:newtab and Bravery panel (pulled into variables.less)
- marked items we don't want having text selection w/ -webkit-user-select:none
- marked items as cursor:default, to ensure a more app-like feel (versus browser icons)
- SVG icons in bottom right are now drawn via mask and have a hover color (gray)
- all wallpaper images (except one) removed from project
- image details are now stored in json in ./js/data/backgrounds.js

Updates to components
- updated SiteRemovalNotification to use component state (triggering re-render when change happens)
- code retrieving about links moved into footer component
- components not using state were updated to inherit from ImmutableComponent
- clock updated to start with a time (no longer waits 1 second before showing)
- properties that read newTabState moved into stats component

Misc
- remove multiple calls to aboutAction where possible
- added tests
- images will try to load remotely:
  - if they fail, they'll fall back to the built-in image (see config.js)
  - if the built-in image fails, the screen still looks nice (uses gradient)
  - screen desperately needs fade in transition to avoid FOUC (https://en.wikipedia.org/wiki/Flash_of_unstyled_content)

NOTE: the ONLY way I could find to detect image load failure was to put a hidden
image tag with an onerror handler. Having a div with a `background-image` CSS
attribute doesn't appear to offer a way to catch the error. You can provide a
fallback image URL, but the title of the image won't match (and down the road,
the author details may not match, if there are multiple authors)
- Add settings for new tab behaviour, handle this behaviour when you click the new tab button
- Scaffolding for deafult search engine appearing as new tab
- Grab proper search engine information on new tab
- New tab can load default search engine
- Add functionality for new tab options
- Abstraction of handling new tab settings
- Hopefully final abstraction to complete new tab functionality
@bsclifton bsclifton added this to the 0.12.8dev milestone Nov 1, 2016
Fixes #2106

Updated defaultUrl logic
- windowStore.js now uses new defaultUrl method (from appUrlUtil) instead of config.defaultUrl
- default unknown values to about:blank

Removed conflicting defaultUrl behavior (since it gets defaulted in windowStore.js) from:
- main.js
- window.js
- tabs.js

Misc
- pulled out setting values into an enum
- position moved to below "Brave starts with" (in preferences.js)
- resolved circular dependency issue in appUrlUtil
- adding missing "base" element to searchProviders that had it missing (mdn, github, startpage, etc)
- made a newtab option called BLANK and renamed value TEMP. We can change back when ready to go live

Auditors: @kingscott @cezaraugusto
@bsclifton bsclifton mentioned this pull request Nov 1, 2016
46 tasks
@bsclifton bsclifton changed the title WIP - Brand new about:newtab page Brand new about:newtab page Nov 1, 2016
@cezaraugusto
Copy link
Contributor

excited

@bbondy
Copy link
Member

bbondy commented Nov 1, 2016

Let's merge this and do follow ups in master 💯

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.