-
Notifications
You must be signed in to change notification settings - Fork 975
Refactor downloads bar with Aphrodite & Add toolbar submenu #11547
Conversation
Codecov Report
@@ Coverage Diff @@
## master #11547 +/- ##
==========================================
+ Coverage 55.95% 55.97% +0.01%
==========================================
Files 278 279 +1
Lines 26976 27042 +66
Branches 4363 4374 +11
==========================================
+ Hits 15095 15136 +41
- Misses 11881 11906 +25
|
@bsclifton Done 😄 |
The test looks good to me 👍 https://travis-ci.org/brave/browser-laptop/jobs/301320701#L5634
|
} | ||
} | ||
|
||
&.deleteConfirmationVisible:hover { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Obviously we need a nice calculation here ... 😄
props.downloads = downloadUtil.getDownloadItems(state) || Immutable.List() | ||
|
||
return props | ||
} | ||
|
||
render () { | ||
return <div className='downloadsBar' | ||
return <div className={cx({ | ||
[css(styles.downloadsBar, !this.props.showToolbarWhenDownloading && styles.downloadBar_hidden)]: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once possible enhancement- if this setting is true (ex: hide toolbar), it would be better to not show the toolbar in the first place. To do this, you can remove the check here and instead, ONLY set the value in windowReducer.js/menu.js if that value is true. That prevents the component from being created in the first place
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds rational. As I am not sure how to implement that, would you mind adding a commit for that? thanks 😄
@bsclifton Thanks for your commit! I was trying to see how it is like but I got the error and the browser window gets blank:
Could I know how to fix that? |
cc @luixxiul @bsclifton what's the status of this? there's an error report but some follow-up commits after not sure if this is ready |
@cezaraugusto we need a rebase- I was supposed to re-review after @luixxiul 's latest comment. @luixxiul can you rebase again please 😄 |
Fixes #9320 Closes #10946 Closes #10948 Addresses #10947 Also: - Move color properties to theme.js Test Plan: 1. `npm run unittest -- --grep='downloadsToolbarMenuItem'` 2. `npm run test -- --grep='Downloads'` Test Plan 2: 1. Click a `100MB` file from `http://speedtest.reliableservers.com/` 2. Make sure the `Close` button is displayed on the download bar 3. Hover on the file item 4. Make sure the action buttons are displayed 5. Click the pause icon 6. Make sure the transition animation is canceled 7. Click the trash icon 8. Make sure the delete confirmation button works
Close #10548 Auditors: Test Plan: 1. Hide `Download Bar` from `Menu` 2. Download something 3. Make sure the download bar is hidden
- toolbar state removed from window state, moved to app state - menu code updated to properly show checked/unchecked status for toolbar - managing extra state for downloads will be much easier now (ex: if we wanted to track downloads on a per-window basis) Renamed SHOW_TOOLBAR_DOWNLOADS setting as SHOW_TOOLBAR_WHEN_DOWNLOADING - setting was renamed - appconfig value is renamed - setting was moved into general, under downloads area Auditors: @luixxiul
Rename identifiers inside menu.properties
For now I'm going to close this to work on later. |
This blocks #10951
Create
Toolbar
submenu underView
(to close Request: Option to hide download bar #10548)TODO for a follow-up PR: Add
Tabs Toolbar
andNavigation Bar
to hide everything except the menu bar on WindowsFixes #9320
Closes #10548
Closes #10946
Closes #10948
Addresses #10947
Test Plan:
npm run unittest -- --grep='downloadsToolbarMenuItem'
npm run test -- --grep='Downloads'
Test Plan 2:
100MB
file fromhttp://speedtest.reliableservers.com/
Close
button is displayed on the download barTest Plan 3:
Download Bar
fromMenu
Submitter Checklist:
git rebase -i
to squash commits (if needed).Test Plan:
Reviewer Checklist:
Tests