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

Reorganize about pages and less files #10881

Closed
wants to merge 4 commits into from
Closed

Reorganize about pages and less files #10881

wants to merge 4 commits into from

Conversation

luixxiul
Copy link
Contributor

@luixxiul luixxiul commented Sep 10, 2017

Requires #10951 for buttons on about:autofill.

Fixes #10711
Closes #8056
Closes #10700
Closes #10712
Closes #10880
Closes #11120

  • Add less/about/common.less to the about js files
  • Add globalStyles.spacing.aboutPageMargin
  • Add the MPL license header
  • Remove import from the less files
  • Remove button.less from common.less
  • Remove require of the less files imported in common.less to avoid duplicates
  • Move the height:100% property from common.less to preferences.less

Please have a look at #10880 why I thought this reorganization is important, thanks.

Test Plans

1st commit

Closes #10700
Closes #10880
Addresses #8056

Test Plan 1: npm run unittest

Test Plan 2:

  1. Open about:about
  2. Open all linked about pages
  3. Make sure they are properly styled
  4. Open https://webtorrent.io/free-torrents
  5. Open a torrent link
  6. Make sure the webtorrent viewer is properly styled

Test Plan 3:

  1. Open https://expired.badssl.com (for certerror.js)
  2. Open https://brave.rules (for errorPage.js)
  3. Open about:preferences (for preferences.js)
  4. Open http://downloadme.org (for safebrowsing.js)
  5. Make sure the all error pages are rendered
  6. Make sure all error pages do not have the black background color

Test Plan 4:

  1. Open about:brave
  2. Change the window size
  3. Make sure the scroll bar does not appear

2nd commit

Fixes #10711
Closes #10712

Test Plan:

  1. Open about:brave
  2. Make sure the layout is not broken

3rd commit

Closes #8056

Test Plan:

  1. Open about:about
  2. Make sure the page is properly rendered

4th commit

Closes #11120

Test Plan:

  1. Open about:about
  2. Open about:adblock
  3. Open about:autofill
  4. Open about:brave
  5. Open about:downloads
  6. Open about:extensions
  7. Make sure the section titles are styled in the same way

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:

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

panelPadding: '18px',

// about pages
aboutPageMargin: '20px',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only this line is added. The others are just grouped below.


const ipc = window.chrome.ipcRenderer

// Stylesheets
require('../../less/switchControls.less')
Copy link
Contributor Author

@luixxiul luixxiul Sep 10, 2017

Choose a reason for hiding this comment

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

@@ -1,19 +1,13 @@
@import "./siteDetails.less";
Copy link
Contributor Author

@luixxiul luixxiul Sep 10, 2017

Choose a reason for hiding this comment

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

@@ -1,4 +1,8 @@
@import "./common.less";
Copy link
Contributor Author

@luixxiul luixxiul Sep 10, 2017

Choose a reason for hiding this comment

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

@@ -13,10 +17,12 @@
padding: 0;
}

html, body, #appContainer, #appContainer > div {
height: 100%;
}
Copy link
Contributor Author

@luixxiul luixxiul Sep 10, 2017

Choose a reason for hiding this comment

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

deprecated with https://github.com/brave/browser-laptop/pull/10881/files#diff-4b50ff14dadc9756719a577a72f520d6R7 on preferences.less. height:100% is required on preferences.js only.

@@ -21,6 +21,7 @@ const aboutActions = require('../../../../js/about/aboutActions')
const windowActions = require('../../../../js/actions/windowActions')

// Stylesheets
require('../../../../less/about/siteDetails.less')
Copy link
Contributor Author

@luixxiul luixxiul Sep 10, 2017

Choose a reason for hiding this comment

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

const commonStyles = require('../../app/renderer/components/styles/commonStyles')

const {
AboutPageSectionTitle,
AboutPageSectionSubTitle
} = require('../../app/renderer/components/common/sectionTitle')

require('../../less/about/history.less')
Copy link
Contributor Author

@luixxiul luixxiul Sep 10, 2017

Choose a reason for hiding this comment

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

Removed along with https://github.com/brave/browser-laptop/pull/10881/files#diff-6f6a63435cccded794332a0616b5f0e3L7, in favor of the converted styles below and siteDetails.less, which is more straightforward.

@@ -9,8 +9,8 @@ const messages = require('../constants/messages')
const ipc = window.chrome.ipcRenderer
const {isSourceAboutUrl, getTargetAboutUrl} = require('../lib/appUrlUtil')

require('../../less/button.less')
Copy link
Contributor Author

@luixxiul luixxiul Sep 10, 2017

Choose a reason for hiding this comment

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

Deprecated with common.less

@@ -8,8 +8,8 @@ const BrowserButton = require('../../app/renderer/components/common/browserButto
const appActions = require('../../js/actions/appActions')
const tabActions = require('../../app/common/actions/tabActions')

require('../../less/button.less')
Copy link
Contributor Author

@luixxiul luixxiul Sep 10, 2017

Choose a reason for hiding this comment

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

@@ -30,6 +30,8 @@ const {
} = require('../../app/renderer/components/common/sectionTitle')

// Stylesheets
require('../../less/about/common.less')
require('../../less/about/siteDetails.less')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added as this is no longer imported on history.less

@@ -63,10 +63,9 @@ const ipc = window.chrome.ipcRenderer
const hintCount = 3

// Stylesheets
require('../../less/switchControls.less')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

require('../../less/forms.less')
require('../../less/button.less')
Copy link
Contributor Author

@luixxiul luixxiul Sep 10, 2017

Choose a reason for hiding this comment

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

@@ -7,8 +7,8 @@ const BrowserButton = require('../../app/renderer/components/common/browserButto

const {StyleSheet, css} = require('aphrodite/no-important')

require('../../less/button.less')
Copy link
Contributor Author

@luixxiul luixxiul Sep 10, 2017

Choose a reason for hiding this comment

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

@@ -1,4 +1,8 @@
@import "./common.less";
Copy link
Contributor Author

@luixxiul luixxiul Sep 10, 2017

Choose a reason for hiding this comment

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

@@ -1,4 +1,8 @@
@import "./siteDetails.less";
Copy link
Contributor Author

@luixxiul luixxiul Sep 10, 2017

Choose a reason for hiding this comment

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

@import "../animations.less";
@import "./common.less";
Copy link
Contributor Author

@luixxiul luixxiul Sep 10, 2017

Choose a reason for hiding this comment

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

@@ -1,12 +1,11 @@
@import "./common.less";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

}

body {
background: @veryLightGray;
Copy link
Contributor Author

@luixxiul luixxiul Sep 10, 2017

Choose a reason for hiding this comment

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

Deprecated with https://github.com/brave/browser-laptop/pull/10881/files#diff-b79e96c438a5b97dc31f04f68d4817a7R22 on common.less.

As common.less is required on all of the about js files, it should not cause a regression.

@import "./variables.less";
@import "./button.less";
@import "./about/siteDetails.less";
@import "variables.less";
Copy link
Contributor Author

@luixxiul luixxiul Sep 10, 2017

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@luixxiul luixxiul left a comment

Choose a reason for hiding this comment

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

Left comments for reference, thanks.

@luixxiul
Copy link
Contributor Author

Adding the impact/high label as there is a possibility of visual regressions.


const {
AboutPageSectionTitle,
AboutPageSectionSubTitle
} = require('../../app/renderer/components/common/sectionTitle')

require('../../less/about/history.less')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed as siteDetails* classes are no longer applied.

@ghost ghost removed the priority/P5 Cosmetic. Spelling, copy, layout. New features (which should also be part of an initiative). label Sep 26, 2017
@bbondy bbondy modified the milestones: 0.21.x (Developer Channel), 0.20.x (Beta Channel) Oct 25, 2017
@codecov-io
Copy link

codecov-io commented Oct 25, 2017

Codecov Report

Merging #10881 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master   #10881      +/-   ##
==========================================
+ Coverage   54.54%   54.55%   +<.01%     
==========================================
  Files         275      275              
  Lines       26144    26146       +2     
  Branches     4196     4196              
==========================================
+ Hits        14261    14263       +2     
  Misses      11883    11883
Flag Coverage Δ
#unittest 54.55% <100%> (ø) ⬆️
Impacted Files Coverage Δ
app/renderer/components/styles/global.js 100% <ø> (ø) ⬆️
js/about/newtab.js 50% <100%> (+0.61%) ⬆️
js/about/preferences.js 45.23% <100%> (-0.12%) ⬇️
js/about/newprivatetab.js 80% <100%> (+0.83%) ⬆️

@luixxiul
Copy link
Contributor Author

@cezaraugusto this PR is blocked by #10951 (for buttons on about:autofill). I would like to see #10951 reviewed before this one 😄

Suguru Hirahara added 4 commits November 26, 2017 00:36
Closes #10700
Closes #10880
Addresses #8056

- Add less/about/common.less to the about js files
- Add globalStyles.spacing.aboutPageMargin
- Add the MPL license header
- Remove import from the less files
- Remove button.less from common.less
- Remove require of the less files imported in common.less to avoid duplicates
- Move the height:100% property from common.less to preferences.less

Auditors:

Test Plan 1: npm run unittest

Test Plan 2:
1. Open about:about
2. Open all linked about pages
3. Make sure they are properly styled
4. Open https://webtorrent.io/free-torrents
5. Open a torrent link
6. Make sure the webtorrent viewer is properly styled

Test Plan 3:
1. Open https://expired.badssl.com/
2. Open http://downloadme.org/
3. Open http://brave.rules/
4. Make sure all error pages do not have the black background color

Test Plan 4:
1. Open about:brave
2. Change the window size
3. Make sure the scroll bar does not appear
Fixes #10711
Closes #10712

Auditors:

Test Plan:
1. Open about:brave
2. Make sure the layout is not broken
Closes #8056

Auditors:

Test Plan:
1. Open about:about
2. Make sure the page is properly rendered
Closes #11120

- about
- adblock
- autofill
- brave
- downloads
- extensions
- passwords

Auditors:

Test Plan:
1. Open about:about
2. Open about:adblock
3. Open about:autofill
4. Open about:brave
5. Open about:downloads
6. Open about:extensions
7. Make sure the section titles are styled in the same way
@cezaraugusto
Copy link
Contributor

left a comment in #10951 the text inside buttons doesn't seem ok to me, mind checking there what's happening?

@luixxiul
Copy link
Contributor Author

Let me close the PR until I'll find a better fix on #10951.

@luixxiul luixxiul closed this Jan 17, 2018
@luixxiul luixxiul removed this from the Triage Backlog milestone Jan 17, 2018
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