Skip to content

Conversation

@AntonioVentilii
Copy link
Collaborator

@AntonioVentilii AntonioVentilii commented Nov 28, 2025

Motivation

The EXT NFT collections are refreshed based on a curated list of EXT tokens. However, since they are a lot, it does not really make sense to keep refreshing them: it will only slow down the UI.

So, we will refresh it on demand.

In this PR we create the button to refresh collections and add it into the Assets header.

Note that the button will be loading/disabled, until the callback (called after the refresh is finished) is called.

Changes

  • Create component RefreshCollectionsButton to emit the event oisyReloadCollections with a callback for when the event is finished.
  • Add the new button in the header of Assets.
  • Adapt custom event oisyReloadCollections to accept a callback.

Tests

Practical test:

Screen.Recording.2025-11-28.at.23.29.55.mov

@AntonioVentilii AntonioVentilii marked this pull request as ready for review December 1, 2025 12:09
@AntonioVentilii AntonioVentilii requested a review from a team as a code owner December 1, 2025 12:10
Copilot AI review requested due to automatic review settings December 1, 2025 12:10
@AntonioVentilii AntonioVentilii requested a review from a team as a code owner December 1, 2025 12:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds an on-demand refresh button for NFT collections to the Assets header, addressing performance concerns with automatic collection refreshing. The button emits a custom event with a callback mechanism to manage loading states.

  • Created RefreshCollectionsButton component with loading state management
  • Updated LoaderCollections to handle reload events with callback support
  • Enhanced type safety by properly typing the oisyReloadCollections custom event

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/frontend/src/lib/components/nfts/RefreshCollectionsButton.svelte New button component that emits reload event and manages loading state via callback
src/frontend/src/lib/components/tokens/Assets.svelte Adds refresh button to NFT tab header alongside sort and settings menus
src/frontend/src/lib/components/loaders/LoaderCollections.svelte Updated to accept callback in reload event and invoke it after completion
src/frontend/src/lib/types/custom-events.ts New interface defining the callback structure for reload events
src/frontend/src/custom-events.d.ts Updated type declarations to use proper typing instead of any
src/frontend/src/tests/lib/components/nfts/RefreshCollectionsButton.spec.ts Comprehensive test coverage for the new button component
src/frontend/src/tests/lib/components/loaders/LoaderCollections.spec.ts Updated tests to verify callback invocation after reload completes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@AntonioVentilii AntonioVentilii added this pull request to the merge queue Dec 1, 2025
Merged via the queue into main with commit 5c6e5a8 Dec 1, 2025
79 checks passed
@AntonioVentilii AntonioVentilii deleted the feat-frontend/Add-NFT-collections-refresh-button-to-header branch December 1, 2025 12:27
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