-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Conversation
@@ -14,6 +14,7 @@ | |||
"express-handlebars": "^3.0.0", | |||
"helmet": "^3.6.1", | |||
"jquery": "^3.2.1", | |||
"jquery-circle-progress": "^1.2.2", |
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.
AH! I think you added a dependency to package.json, but didn't update the package-lock.json shrinkwrap file, which may explain why Circle-CI is blowing up.
It works for me locally if I do this:
$ rm -rf node_modules package-lock.json
$ npm i && npm run lint
@@ -0,0 +1,311 @@ | |||
<!DOCTYPE html> |
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.
Not sure if all these files are needed or not. I can't imagine we'd want this on prod. /cc @ericawright
Same applies to the LICENSE and README files above. Not sure if it's good enough(tm) to include the fontello licensing information in the root README.md and not bundle those files in the /public/ dir.
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.
thanks for pointing that out. from the readme: "If your project is open-source, usually, it will be ok to make LICENSE.txt file publicly available in your repository." Se we can remove the readme file, but we need to keep the license file around somewhere.
As for the other files, I believe it is all CSS directly affecting the icons, where else would you propose we put it?
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.
Proposal: Let's remove the following files:
- public/resources/fontello-24c5e6ad/LICENSE.txt
- public/resources/fontello-24c5e6ad/README.txt
- public/resources/fontello-24c5e6ad/demo.html
Then let's copy the contents of public/resources/fontello-24c5e6ad/LICENSE.txt into our root README.md in the Licenses section below our MPL-2.0 notice.
</g> | ||
</g> | ||
</g> | ||
</svg> |
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.
I think we have an existing bug for this (Optimize images #63), but we could probably run all these through svgo or imagemin (at checkin or during build time) and shave a few KB.
views/download.handlebars
Outdated
<div class="progress-bar" id="dl-progress"> | ||
<div class="percentage"> | ||
<span class="percent-number"></span> | ||
<span class="percent-sign">%</span> |
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.
Personal curiosity, but couldn't we just do this w/ CSS and save a couple nested <span>
s?
<div class="percentage">13</div>
.percentage::after {
content: "%";
}
Nevermind. I think they are separate because the formatting looks slightly different for each element.
Private, Encrypted File Sharing | ||
</div> | ||
<div class="description"> | ||
Send files through a safe, private, and encrypted link that automatically expires to ensure your stuff does not remain online forever.<br> <a href="" class="link">Learn more</a> |
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.
Where should "Learn more" link to here?
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.
"needs ux" 😉
maybe we take it out until we have something to link to?
views/index.handlebars
Outdated
<div class="description"> | ||
Unfortunately this browser does not support the web technology that powers Firefox Send. You'll need to try another browser. We recommend Firefox! | ||
</div> | ||
<form action="https://www.mozilla.org/en-US/firefox/new/?scene=2" target="_blank"> |
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.
Nit: Remove the /en-US/ bit and let mozilla.org handle the locale detection.
When I try viewing this PR locally, it seems to show all the states on the homepage: UPDATE: Actually, this may not be a thing. I think I was running |
@pdehaan Same on my end, seems like some of the fonts are not loading properly. Also on the download page, it seems like the progress update is appending instead of overriding (picture attached). |
Private, Encrypted File Sharing | ||
</div> | ||
<div class="description"> | ||
Send files through a safe, private, and encrypted link that automatically expires to ensure your stuff does not remain online forever.<br> <a href="" class="link">Learn more</a> |
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.
where should this link to?
frontend/src/upload.js
Outdated
} | ||
} | ||
|
||
// create popup | ||
popupDiv.classList.add('popup'); | ||
$popupText.html( | ||
'<span class="del-file">Delete</span><span class="nvm" > Nevermind</span>' | ||
'<span class=\'del-file\'>Delete</span><span class=\'nvm\' > Nevermind</span>' |
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.
try `` for the outside, then you don't have to escape the single quotes just to please the linter
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.
I think we can also tweak the ESLint quotes
rule to allow escaping of strings:
quotes: [error, single, {avoidEscape: true}]
Or in this case since it's HTML strings, just use double quotes on the internal attributes.
'<span class="del-file">Delete</span> <span class="nvm">Nevermind</span>'
@@ -253,32 +293,41 @@ $(document).ready(function() { | |||
toggleHeader(); | |||
}); | |||
}); | |||
document.getElementById('delete-file').onclick = () => { |
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.
When I click "delete file", it takes me to the home page that lists all the files. at first, my deleted file will be there, then I can see it visually update to remove it. It should be gone from the beginning.
frontend/src/upload.js
Outdated
}); | ||
|
||
//cancel the upload | ||
$('#cancel-upload').click(() => {}); |
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.
what should happen here? I assume you'll add it later.
frontend/src/upload.js
Outdated
@@ -44,24 +46,40 @@ $(document).ready(function() { | |||
document.body.removeChild(aux); | |||
//disable button for 3s | |||
$copyBtn.attr('disabled', true); | |||
$copyBtn.html('Copied!'); | |||
$('#link').attr('disabled', true); | |||
$copyBtn.html('<span class=\'icon-check\'></span>'); |
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.
try ` and ' here too
public/main.css
Outdated
|
||
.percent-number { | ||
font-size: 43.2px; | ||
letter-spacing: -0.78px; |
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.
this and font-family can be rules on .percentage
to affect both children, then you won't have to write them twice.
public/main.css
Outdated
} | ||
|
||
.progress-text { | ||
font-family: 'SF Pro Text', sans-serif; |
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.
same here, some of these rules can pass from .upload
to both #cancel-upload
and progress-text
it might be worth setting font-family: 'SF Pro Text';
on the body, then only making rules for the ones that are different?
public/main.css
Outdated
font-family: 'SF Pro Text'; | ||
margin-top: 50px; | ||
margin-bottom: 12px; | ||
cursor: pointer; |
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.
perhaps we make a rule for button
and add some default rules to that too, like this one.
frontend/src/upload.js
Outdated
del.innerHTML = | ||
'<span class=\'icon-cancel-1\' title=\'Delete\' style=\'margin-left: -7px\'></span>'; | ||
|
||
link.innerHTML = '<span class=\'icon-docs\' title=\'Copy URL\'></span>'; |
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.
Can we get some feedback on clicking this just to show that it has been copied, a slight darkening of the colour, or bolding the font, at a minimum.
@pdehaan I can't replicate the multiple states. Do you have anything that might be affecting it, or anything in the console? it's a known bug on ie, but works perfectly for me on Firefox and Chrome |
@ericawright I think this was an issue with me running |
@pdehaan It still only shows one state when I run |
@pdehaan that's because it uploads so fast! if you use responsive design mode in the dev tools you can turn on throttling and slow down the upload/download. The animation always has a minimum time that it will take however, so it seems behind the number. |
I think regardless of upload speed, I think the displayed percentage should match the progress bar's filled-ness. Not sure if there's an easy way to force that, but that seems stretchy at best and could definitely be done post-merge. |
public/main.css
Outdated
font-weight: 300; | ||
font-style: normal; | ||
background-size: contain; | ||
background: url('resources/Send_bg.svg'); |
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.
Nit: "send_bg.svg"
public/main.css
Outdated
} | ||
|
||
.upload-window { | ||
border: 1px dashed; | ||
border: 1px dashed rgb(0, 148, 251, 0.5); |
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.
Should this be rgba()
?
public/main.css
Outdated
#upload-img { | ||
padding-right: 20px; | ||
.upload-window.ondrag { | ||
border: 3px dashed rgb(0, 148, 251, 0.5); |
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.
ditto re: rgba()
public/main.css
Outdated
height: 250px; | ||
border-radius: 5px; | ||
width: 640px; | ||
height: 254.7px; |
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.
This feels oddly specific.
public/main.css
Outdated
cursor: pointer; | ||
border: none; |
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.
356:11 warning A value of `none` is not allowed. `0` must be used border-zero
public/main.css
Outdated
} | ||
|
||
table { | ||
table-layout: fixed; | ||
border-collapse: collapse; | ||
font-family: Segoe UI, 'SF Pro Text', sans-serif; |
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.
Does 'Segoe UI'
need to be wrapped in single quotes?
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.
Same w/ lines 193 and 200 below. 🤷♀️
frontend/src/download.js
Outdated
$('.progress-text').append( | ||
` (${(progress[0] / 1000000).toFixed(2)}MB of ${(progress[1] / | ||
1000000).toFixed(2)}MB)` | ||
); |
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.
I think this is where the append bug is happening that @abhinadduri was reporting in #191 (comment).
views/index.handlebars
Outdated
</div> | ||
<form action="https://www.mozilla.org/en-US/firefox/new/?scene=2" target="_blank"> | ||
<button id="dl-firefox" type="submit"> | ||
<img src="/resources/firefox_logo-only.svg" id="firefox-logo"/> |
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.
Nit: Add an alt=""
attr, for giggles.
views/download.handlebars
Outdated
</div> | ||
<img src="/resources/illustration_download.svg" id="download-img"/> |
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.
Nit: Add alt=""
attribute.
The progress bar for uploads stays at 0 for me until the file download is done, at which point the progress bar quickly goes to 100. @ericawright Maybe the upload was big enough to go past the minimum animation time? |
I think we're also missing some footer links: https://github.com/mozilla/testpilot-assets/blob/master/Send/Send_03_uploading_file/preview/page-1-uploading-file.png Note the footer links of "Mozilla", "Legal", "About Test Pilot", "Privacy", "Terms", "Cookies", and then "GitHub" and "Twitter" logos. |
frontend/src/download.js
Outdated
); | ||
if (progress[1] < 1000000) { | ||
$('.progress-text').html( | ||
`${filename} (${(progress[0] / 1000).toFixed(1)}KB of ${(progress[1] / 1000).toFixed(1)}KB)` |
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.
I think I'm getting a bit lost with all these magic numbers floating around. Not sure if we want to create some const
s for 1000 (KB), 1000000 (MB), and 1000000000 (GB).
Something like:
const KB = 1000;
const MB = KB * 1000;
const GB = MB * 1000;
if (progress[1] < MB) {
$('.progress-text').html(
`${filename} (${(progress[0] / KB).toFixed(1)}KB of ${(progress[1] / KB).toFixed(1)}KB)`
);
else if (progress[1] < GB) {
Not sure if there'd be a prettier way to do something like:
function toKB(value) {
return `${(value / KB).toFixed(1)}KB`;
}
function toMB(value) {
return `${(value / MB).toFixed(1)}MB`;
}
function toGB(value) {
return `${(value / GB).toFixed(1)}GB`;
}
$('.progress-text').html(`${filename} (${toKB(progress[0])} of ${toKB(progress[1])}`);
The root .eslintrc.yml will need to tweak the quotes: [error, single, {avoidEscape: true}] |
dec7a0b
to
20afd7a
Compare
Awesome work @dnarcese!!! Let's merge now and do follow-up PRs for anything left. |
Fixes #169 "UX measurement and assets"