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

'New tab' dashboard images fade in from dark #11817

Merged
merged 1 commit into from
Nov 16, 2017
Merged

'New tab' dashboard images fade in from dark #11817

merged 1 commit into from
Nov 16, 2017

Conversation

petemill
Copy link
Member

@petemill petemill commented Nov 6, 2017

Fix #5309

Addresses new tab when in 'Dashboard' mode. Sets default background color so that the text is readable without the background having loaded. Waits for image to load completely before fading it in. Also general clean up to remove separate gradient element and double-setting of wallpaper image source.

Note: I noticed after I had done this that this had been attempted before in #6590, but that was abandoned because of the white flash before the tab loads. This minimizes it by further explicitly setting the background color in html before the JS / react components have loaded (although webpack can be configured to output the css as a .css file which can be included in about-newtab.html). The flashes of white that are still present on both tab open and close are from both the background on open, and the window background on close (when no other tab is shown). These will be addressed in #11813.

Here's what it looks like: https://www.dropbox.com/s/qpsk8fk3m5rpx3f/newtab-fade-i5309.mov?dl=0

Here's what it looked like before (with empty profile): https://www.dropbox.com/s/05mz3expvewmcsv/newtab-fade-before-i5309.mov?dl=0

Submitter Checklist:

  • 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).
  • Tagged reviewers and labelled the pull request as needed.

Test Plan:
Automated tests included.

Manual tests include checking that image loads with good network, that fallback image loads with no network and clear cache, and that when settings are set to no images on Dashboard, that the very colorful gradient shows.

Reviewer Checklist:

Tests

  • Adequate test coverage exists to prevent regressions
  • Tests should be independent and work correctly when run individually or as a suite ref
  • New files have MPL2 license header

…s in the image when loaded

Fix #5309

Note: the flashes of white that are still present on both tab open and close are from both the <webview> background on open, and the window background on close (when no other tab is shown). These will be addressed in #11813
@codecov-io
Copy link

Codecov Report

Merging #11817 into master will increase coverage by 0.03%.
The diff coverage is 66.66%.

@@            Coverage Diff             @@
##           master   #11817      +/-   ##
==========================================
+ Coverage   52.61%   52.65%   +0.03%     
==========================================
  Files         271      271              
  Lines       25715    25673      -42     
  Branches     4104     4100       -4     
==========================================
- Hits        13530    13518      -12     
+ Misses      12185    12155      -30
Flag Coverage Δ
#unittest 52.65% <66.66%> (+0.03%) ⬆️
Impacted Files Coverage Δ
js/about/newtab.js 49.68% <66.66%> (-0.07%) ⬇️
js/stores/windowStore.js 27.01% <0%> (+0.29%) ⬆️
app/renderer/components/reduxComponent.js 90.62% <0%> (+6.25%) ⬆️
js/stores/appStoreRenderer.js 100% <0%> (+8.82%) ⬆️

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.

This is beautiful- works exactly as expected 😄 👍

Great job!

@bsclifton
Copy link
Member

Holding off on merge for this one; we'll likely pull into a future 0.19.x hotfix 😄

@bsclifton bsclifton merged commit 26249f6 into master Nov 16, 2017
@bsclifton bsclifton deleted the issue-5309 branch November 16, 2017 18:10
bsclifton added a commit that referenced this pull request Nov 16, 2017
'New tab' dashboard images fade in from dark
bsclifton added a commit that referenced this pull request Nov 16, 2017
'New tab' dashboard images fade in from dark
@bsclifton
Copy link
Member

bsclifton commented Nov 16, 2017

master 26249f6
0.21.x 663e841
0.20.x a9a1883
0.19.x 5ab40ba

petemill pushed a commit to petemill/browser-laptop that referenced this pull request Nov 17, 2017
'New tab' dashboard images fade in from dark
bsclifton added a commit that referenced this pull request Nov 17, 2017
'New tab' dashboard images fade in from dark
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.

about:newtab - avoid flash of unstyled content
4 participants