This repository was archived by the owner on Sep 11, 2024. It is now read-only.
Improve download interactions#6509
Merged
Merged
Conversation
With help from Palid. This does two major things: 1. Makes the tile part of a file body clickable to trigger a download. 2. Refactors a lot of the recyclable code out of the DownloadActionButton in favour of a utility. It's not a perfect refactoring, but it sets the stage for future work in the area (if needed). The refactoring still has a heavy reliance on being supplied an iframe, but simplifies the DownloadActionButton and a hair of the MFileBody download code. In future, we'd probably want to make the iframe completely managed by the FileDownloader rather than have it only sometimes manage a hidden iframe.
Turns out the tooltip component doesn't copy over class names.
germain-gg
reviewed
Jul 30, 2021
| blob: blob, | ||
| download: name, | ||
| auto: autoDownload, | ||
| }, '*'); |
Contributor
There was a problem hiding this comment.
Should we use location.origin over *. It looks like that iframe will and should always be loaded on the same origin as the parent page
Member
Author
There was a problem hiding this comment.
possibly, though postMessage is known to be fiddly with origins so would advocate that we do it in a different PR
Contributor
Member
Author
|
@janogarcia would it be okay to add the file size to the tooltip to cover all 3 issues for the short term? |
Contributor
|
@turt2live Let's do that for the short term, yes. |
2 tasks
Member
Author
|
@janogarcia done; ptal :) |
janogarcia
approved these changes
Jul 30, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes element-hq/element-web#18238
Fixes element-hq/element-web#18239
With help from @Palid
See commits for individual descriptions. Much of the detail is also contained within the diff itself.
The tooltip behaviour on the file name (see below) is technically an accident that it appears right over top of the tile, but I think it works out okay enough to not be concerned.
Designers: Instead of truncating to 20-30 characters, this truncates to roughly 15 characters so that the file size has a chance at fitting in the tile at all times.
Notes: none
element-web notes: none