Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/8166 - Show current upload speed and upload details in tooltip #8187

Merged
merged 3 commits into from
Feb 9, 2023

Conversation

pascalwengerter
Copy link
Contributor

Description

Quick draft for #8166, happy to have someone else pick up the ball here :)

Related Issue

Motivation and Context

Community request

Screenshots (if appropriate):

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@update-docs
Copy link

update-docs bot commented Jan 4, 2023

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.


// "bytesTotal" is a wrong type documentation,
// fix in progress via https://github.com/transloadit/uppy/pull/4263
this.uploadSpeed = getSpeed({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had the content of getSpeed copied to a local method while figuring out why it wouldn't do what I expected it to, using it directly still returns NaN and breaks the tooltip so further investigation needed/potentially a type error somewhere

Copy link
Contributor

Choose a reason for hiding this comment

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

upstream fix has been released.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah nice, thanks for the reminder! I'll see if I can get this PR done this week then :)

return ''
}
const todo = filesize(this.bytesUploaded)
const done = filesize(this.bytesTotal)
Copy link
Member

Choose a reason for hiding this comment

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

Naming of these two variables seems off

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated, thx! (no clue what I was thinking 😶‍🌫️ )

@pascalwengerter pascalwengerter marked this pull request as ready for review February 6, 2023 20:45
@pascalwengerter
Copy link
Contributor Author

pascalwengerter commented Feb 6, 2023

@JammingBen @kulmann could someone give this a look and potentially test it on oC10 also? Don't think I'll find more time to invest into this, but so far it was looking okay (limited connection via network tab in dev tools, obviously)

Screenshot 2023-02-06 at 21 42 08

Screenshot 2023-02-06 at 21 42 20

Copy link
Member

@kulmann kulmann left a comment

Choose a reason for hiding this comment

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

The tooltip feels very jumpy because of the rapid text changes and a non-monospaced font. I don't think there is much we can do about it... one thing you could try is using only 1 decimal instead of 2. And the other option would be debouncing the text changes by like 200-500ms, so that the changes are frequent but not as frequent as they are now. I would definitely like to keep the upload speed in the tooltip. Maybe we should indicate somehow that a tooltip is available in this case...

@@ -0,0 +1,8 @@
# Show upload speed
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# Show upload speed
Enhancement: Show upload speed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

const totalBytes = filesize(this.bytesTotal)
const currentUploadSpeed = filesize(this.uploadSpeed)
// needs $gettext interpolation
return `${uploadedBytes} of ${totalBytes} (${currentUploadSpeed}/s)`
Copy link
Member

Choose a reason for hiding this comment

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

that's a TODO that should be solved before merging. :-) fyi, in the vue3 version of gettext the interpolation happens directly in $gettext (grep for examples in the code)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated, thx

packages/web-runtime/src/components/UploadInfo.vue Outdated Show resolved Hide resolved
@kulmann
Copy link
Member

kulmann commented Feb 7, 2023

Forgot to say, oc10 works fine as well 👍

@sonarcloud
Copy link

sonarcloud bot commented Feb 7, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

26.7% 26.7% Coverage
0.0% 0.0% Duplication

@pascalwengerter
Copy link
Contributor Author

I've updated this PR to use $gettext and formatFileSize, feels better now if you ask me. I've also added a catch to prevent the tooltip from being displayed after the download finishes (or has been cancelled).
Regarding debouncing - I took a look at https://vueuse.org/shared/watchDebounced/, but that would mean we'd have to introduce @vueuse/core also (could also be done in a subsequent PR)
Regarding discoverability - not sure what possibilities we'd have, given that the tooltip is also not visible on mobile (and not sure how to present it to screenreaders in a way that doesn't "spam" them with information 😅 )

Copy link
Member

@kulmann kulmann left a comment

Choose a reason for hiding this comment

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

nice improvement! thank you! 💪

@kulmann kulmann merged commit 8304bd4 into owncloud:master Feb 9, 2023
@kulmann
Copy link
Member

kulmann commented Feb 9, 2023

I've updated this PR to use $gettext and formatFileSize, feels better now if you ask me. I've also added a catch to prevent the tooltip from being displayed after the download finishes (or has been cancelled).
Regarding debouncing - I took a look at https://vueuse.org/shared/watchDebounced/, but that would mean we'd have to introduce @vueuse/core also (could also be done in a subsequent PR)

The "level of jumpiness" is much better now with less decimal places. IMO sufficient without the debounce.

Regarding discoverability - not sure what possibilities we'd have, given that the tooltip is also not visible on mobile (and not sure how to present it to screenreaders in a way that doesn't "spam" them with information 😅 )

It's good that the tooltip is not accessible for screen readers anyway at the moment. Don't see that this is valuable for screen reader in the current state. A hidden announcer could be an option, but the information is so "nice to have" that I wouldn't try that at the moment.

@pascalwengerter pascalwengerter deleted the feature/8166 branch February 10, 2023 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show file upload speed
4 participants