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

Display user feedback when IPFS fails to provide annotations #3396

Merged
merged 7 commits into from
May 17, 2022

Conversation

danbr
Copy link
Contributor

@danbr danbr commented May 15, 2022

Description

This PR displays a warning to update the user when IPFS is uncontactable and does not return annotations for the annotation hash provided.

No IPFS connection:
Screenshot 2022-05-15 at 17 46 25

With IPFS connection:
Screenshot 2022-05-15 at 17 47 09

To promote simplification and standardisation, I have created a CalloutCard component to display the message. This new generic component is very configurable and can be used in exiting situations, such as Confusable warnings ( i will create a new issue to search & replace), and should be considered for use in new dev.

Resolves #3237

@danbr danbr added the feature label May 15, 2022
@danbr danbr requested a review from a team May 15, 2022 17:18
@danbr danbr self-assigned this May 15, 2022
@danbr danbr changed the title Display user feedback when IPFS fail to provide annotations Display user feedback when IPFS fails to provide annotations May 15, 2022
Copy link
Member

@arrenv arrenv left a comment

Choose a reason for hiding this comment

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

Looks good to me. The only thing I noticed was the padding difference with the design, I'm assuming you just matched the padding of the annotations, although I believe the intention was to make this stand out more.

Design

Screenshot 2022-05-16 122427

This PR

b7b457e0-260a-4c18-8c74-8e05a829ed71

Annotation

download

@arrenv
Copy link
Member

arrenv commented May 16, 2022

@danbr Here are the paddings from the design. 14px left and right, 24px top and bottom.

Screenshot 2022-05-16 135714

Screenshot 2022-05-16 135705
.

@danbr
Copy link
Contributor Author

danbr commented May 16, 2022

@danbr Here are the paddings from the design. 14px left and right, 24px top and bottom.

Screenshot 2022-05-16 135714

Screenshot 2022-05-16 135705 .

@arrenv - Padding updated (24px top and bottom, 14px left and right)

Screenshot 2022-05-16 at 14 05 49

@danbr danbr requested a review from arrenv May 16, 2022 12:30
@danbr danbr force-pushed the fix/3237-failing-annotations-feedback branch from ebad860 to ec98a50 Compare May 16, 2022 16:07
@danbr
Copy link
Contributor Author

danbr commented May 16, 2022

@arrenv After a little more finessing.....

Screenshot 2022-05-16 at 17 45 06

Copy link
Member

@arrenv arrenv left a comment

Choose a reason for hiding this comment

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

Looks good to me! The padding looks better and better aligns with the design.

Confirming that we discussed the difference in the paddings and line heights. So, we aimed to match the height of the whole element. Which, made the padding top and bottom 20px

to={location.pathname}
text={MSG.reloadLink}
className={styles.link}
onClick={() => window.location.reload(false)}
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't need false, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@arrenv correct. Its superfluous - I will remove.

Copy link
Contributor

@chinins chinins left a comment

Choose a reason for hiding this comment

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

Very nice work on how you manage the reusability of the component.
You just need to implement one change - as per my comment for the CalloutCard component.

@@ -0,0 +1,34 @@
.main {
padding: 20px 14px 20px 14px;
Copy link
Contributor

Choose a reason for hiding this comment

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

you can just do padding: 20px 14px

return (
<div className={getMainClasses(appearance, styles)}>
<FormattedMessage {...label} values={labelValues} />
<FormattedMessage {...description} values={descriptionValues} />
Copy link
Contributor

Choose a reason for hiding this comment

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

Both for label and for description your types give string as an option and you can't destructure a string. You either need to change types to restrict it to only MessageDescriptor, or you call it depending on what type the prop is (similar to some other core components)

Copy link
Member

Choose a reason for hiding this comment

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

I think you should make them a MessageDescriptor required type. I'm not seeing this being used with simple strings anyway

Copy link
Member

@rdig rdig left a comment

Choose a reason for hiding this comment

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

Other than what the others said, I'm good with this.

@@ -0,0 +1,61 @@
**Description**
Copy link
Member

Choose a reason for hiding this comment

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

Very cool of you to add a styleguide entry for this, but I think we're going to discontinue this. (unless you guys have other opinions on this)

Leave it in for now

return (
<div className={getMainClasses(appearance, styles)}>
<FormattedMessage {...label} values={labelValues} />
<FormattedMessage {...description} values={descriptionValues} />
Copy link
Member

Choose a reason for hiding this comment

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

I think you should make them a MessageDescriptor required type. I'm not seeing this being used with simple strings anyway


const annotationMessage = getAnnotationMessage();
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add a spinner loader while trying to fetch / parse the IPFS hash (and subsequent object)

Copy link
Contributor

@chinins chinins left a comment

Choose a reason for hiding this comment

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

All good - nice work!

@danbr danbr merged commit 64a93cb into master May 17, 2022
@danbr danbr deleted the fix/3237-failing-annotations-feedback branch May 17, 2022 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failing to retrieve annotations shows no feedback to user
4 participants