Skip to content

fix: improve large lists of assets [PERA-3885]#230

Merged
fmsouza merged 7 commits intomainfrom
fmsouza/pera-3885
Mar 23, 2026
Merged

fix: improve large lists of assets [PERA-3885]#230
fmsouza merged 7 commits intomainfrom
fmsouza/pera-3885

Conversation

@fmsouza
Copy link
Contributor

@fmsouza fmsouza commented Mar 20, 2026

Pull Request Template

Description

  • Improve how the assets list is rendered to make sure it'll be performant and won't render any blank slots in the process.

Related Issues

Checklist

  • Have you tested your changes locally?
  • Have you reviewed the code for any potential issues?
  • Have you documented any necessary changes in the project's documentation?
  • Have you added any necessary tests for your changes?
  • Have you updated any relevant dependencies?

Additional Notes

  • Add any additional notes or comments that may be helpful for reviewers.

@fmsouza fmsouza self-assigned this Mar 20, 2026
@fmsouza fmsouza marked this pull request as ready for review March 23, 2026 11:33
@fmsouza fmsouza requested review from wjbeau and yasincaliskan March 23, 2026 11:34
fmsouza and others added 3 commits March 23, 2026 12:00
const priceIDs = useMemo(() => [sourceAssetId], [sourceAssetId])
// Skip per-item price fetch when a pre-fetched price is provided (bulk query optimization)
const priceIDs = useMemo(
() => (preFetchedUsdPrice !== undefined ? [] : [sourceAssetId]),
Copy link
Collaborator

Choose a reason for hiding this comment

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

We may consider adding no-negated-condition rule. What do you think?

Suggested change
() => (preFetchedUsdPrice !== undefined ? [] : [sourceAssetId]),
() => (!!preFetchedUsdPrice ? [] : [sourceAssetId]),

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can definitely discuss it, but I'm personally not a fan. There are some cases which are much easier to assess if we use negated conditions, so I don't see much benefit on not allowing that options to be used. But would be happy to do so in a follow up PR refactoring everywhere in case we agree on that.

@fmsouza fmsouza merged commit 87ef1b0 into main Mar 23, 2026
7 checks passed
@fmsouza fmsouza deleted the fmsouza/pera-3885 branch March 23, 2026 14:45
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.

2 participants