-
Notifications
You must be signed in to change notification settings - Fork 56
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
Download bundle UX improvement #2453
Download bundle UX improvement #2453
Conversation
…tched; show progress for paginated downloads only when there are more than 1 page
This doesn't appear to be updating the % complete correctly. tmp-2021-06-22_10.40.57.mp4You can use the |
I fixed it. Thank you for guidance |
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'm seeing two issues.
- A
ticketvote/v1/details
request is being made when you load the proposal details page. This is a expensive route and should only be retrieved when the votes bundle is being downloaded. - Downloading the votes bundle does not download the actual cast votes.
@@ -59,7 +60,7 @@ export function useDownloadCommentsTimestamps(recordToken) { | |||
const getProgressPercentage = useCallback( | |||
(timestamps) => | |||
timestamps | |||
? (Object.keys(timestamps.length * 100) / commentsLength).toFixed(2) | |||
? ((Object.keys(timestamps).length * 100) / commentsLength).toFixed(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.
I don't think we need to show decimal places on these % complete indicators. Instead of 66.67%
, lets just show 67%
.
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.
Hey @vibros68, thanks for the PR. Left some inline comments in addition to luke's review.
useDownloadCommentsTimestamps(recordToken); | ||
|
||
return loading ? ( | ||
<div> | ||
<span style={{ marginRight: 10 }}>{progress}%</span> | ||
{multiPage ? <span style={{ marginRight: 10 }}>{progress}%</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.
{multiPage ? <span style={{ marginRight: 10 }}>{progress}%</span> : <></>} | |
{multiPage && <span style={{ marginRight: 10 }}>{progress}%</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.
Thank you
|
||
return loading ? ( | ||
<div> | ||
<span style={{ marginRight: 10 }}>{progress}%</span> | ||
{multiPage ? <span style={{ marginRight: 10 }}>{progress}%</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.
{multiPage ? <span style={{ marginRight: 10 }}>{progress}%</span> : <></>} | |
{multiPage && <span style={{ marginRight: 10 }}>{progress}%</span> } |
<div> | ||
<DownloadJSON | ||
label={"Comments Timestamps"} | ||
fileName={`${recordToken}-comments-timestamps`} | ||
content={timestamps} | ||
/> | ||
</div> |
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 is an issue on master. It was not introduce by this pull request. Please disregard this comment. |
Two pre-existing bugs were discovered during review of this pull request. #2460 and #2461. This pull request does not need to fix 2460, but it should assume that the vote details call is being removed and should not rely on the vote details being available prior to download. 2461 should be fixed in this pull request. To accomplish both of these it should:
|
5d613f8
to
6f12a0a
Compare
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.
auths: voteSummary?.details?.auths, | ||
details: voteSummary?.details?.details, | ||
votes: voteSummary?.votes, | ||
serverpublickey | ||
}; | ||
return <DownloadJSON fileName={fileName} label={label} content={bundle} />; | ||
return <DownloadJSON fileName={fileName} label={label} content={bundle} />;*/ |
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.
comment
/*const bundle = { | ||
auths: voteSummary?.details?.auths, | ||
details: voteSummary?.details?.details, | ||
votes: voteSummary?.votes, | ||
serverpublickey | ||
}; |
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.
comment
…nt, remove decimal of progress percentage
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.
The UX is looking good. See the comment about the server public key though.
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 am sorry. It is fixed now |
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.
tACK
This looks good from a UX standpoint. Verification using politeiaverify
works as expected with all bundle downloads.
@tiagoalvesdulce and @victorgcramos will need to approve the code.
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.
LGTM
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.
LGTM!
resolved #2438
resolved #2461
Description
adjust download bundle: show loading wheel while the data is being fetched; show progress for paginated downloads only when there are more than 1 page