Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.

(Feature) - Expanded decoded data collapses automatically#1731

Merged
dasanra merged 14 commits intodevelopmentfrom
expanded-decoded-data-collapses-automatically
Dec 15, 2020
Merged

(Feature) - Expanded decoded data collapses automatically#1731
dasanra merged 14 commits intodevelopmentfrom
expanded-decoded-data-collapses-automatically

Conversation

@Agupane
Copy link
Contributor

@Agupane Agupane commented Dec 15, 2020

Closes #1693 by:

  • Adding shouldSafeStoreBeUpdated within UPDATE_SAFE reducer to avoid updating the safe in the case that the values didn't changed which would fire unnecessary renders of the entire app. This happens because most of the values of the safe object are arrays or nested objects that could be the same but the reference is different and it's treated as a different value
  • Also on checkAndUpdateSafe avoids adding featuresEnabled if the array didn't changed

How it was before:

before

How it's now:

after

@Agupane Agupane self-assigned this Dec 15, 2020
@github-actions
Copy link

CLA Assistant Lite All Contributors have signed the CLA.

@github-actions
Copy link

github-actions bot commented Dec 15, 2020

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 1 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@ghost
Copy link

ghost commented Dec 15, 2020

Travis automatic deployment:
https://pr1731--safereact.review.gnosisdev.com/rinkeby/app

@ghost
Copy link

ghost commented Dec 15, 2020

Travis automatic deployment:
https://pr1731--safereact.review.gnosisdev.com/volta/app

@francovenica
Copy link
Contributor

Checked that the "Actions" display doesn't closes with the new rendering of the table
Same with modals that opens from the table, like the one that confirms/rejects a tx or the "Send again" option
The table itself keeps re-rendering just fine, the status of the tx still update just fine, the executor tag keeps showing, the green dots keeps filling.

Looks good to me

…to expanded-decoded-data-collapses-automatically
@ghost
Copy link

ghost commented Dec 15, 2020

Travis automatic deployment:
https://pr1731--safereact.review.gnosisdev.com/rinkeby/app

@ghost
Copy link

ghost commented Dec 15, 2020

Travis automatic deployment:
https://pr1731--safereact.review.gnosisdev.com/volta/app

Copy link
Contributor

@fernandomg fernandomg left a comment

Choose a reason for hiding this comment

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

🥇 fantastic!


return array1
? array1.every((element, index) => {
return array2 ? element === array2[index] : false
Copy link
Contributor

Choose a reason for hiding this comment

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

you're assuming this as an array of a subset of primitives, isn't it?

I mean, if you compare two objects it will give false. Maybe narrowing the type would help.

So far, instead of unknown[] you can go with something around type ComparablePrimitives = string | boolean | number and array1?: ComparablePrimitives[] | null?

not sure at all about the names, but something around that.

Copy link
Contributor

Choose a reason for hiding this comment

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

as I comment before, I think we should use this: https://lodash.com/docs/4.17.15#isEqual it's pretty well tested.

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 replaced it with lodash as @nicosampler suggested

@Agupane Agupane requested a review from nicosampler December 15, 2020 18:31
@ghost
Copy link

ghost commented Dec 15, 2020

Travis automatic deployment:
https://pr1731--safereact.review.gnosisdev.com/volta/app

@ghost
Copy link

ghost commented Dec 15, 2020

Travis automatic deployment:
https://pr1731--safereact.review.gnosisdev.com/rinkeby/app

1 similar comment
@ghost
Copy link

ghost commented Dec 15, 2020

Travis automatic deployment:
https://pr1731--safereact.review.gnosisdev.com/rinkeby/app

@ghost
Copy link

ghost commented Dec 15, 2020

Travis automatic deployment:
https://pr1731--safereact.review.gnosisdev.com/volta/app

@ghost
Copy link

ghost commented Dec 15, 2020

Travis automatic deployment:
https://pr1731--safereact.review.gnosisdev.com/rinkeby/app

@ghost
Copy link

ghost commented Dec 15, 2020

Travis automatic deployment:
https://pr1731--safereact.review.gnosisdev.com/volta/app

@dasanra dasanra merged commit 7c19205 into development Dec 15, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Dec 15, 2020
@dasanra dasanra deleted the expanded-decoded-data-collapses-automatically branch December 15, 2020 21:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expanded decoded data collapses automatically

5 participants