-
Notifications
You must be signed in to change notification settings - Fork 39
feat(frontend): Add NFT collections refresh button to header #10632
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
feat(frontend): Add NFT collections refresh button to header #10632
Conversation
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.
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
RefreshCollectionsButtoncomponent with loading state management - Updated
LoaderCollectionsto handle reload events with callback support - Enhanced type safety by properly typing the
oisyReloadCollectionscustom 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.
src/frontend/src/lib/components/nfts/RefreshCollectionsButton.svelte
Outdated
Show resolved
Hide resolved
src/frontend/src/lib/components/nfts/RefreshCollectionsButton.svelte
Outdated
Show resolved
Hide resolved
…svelte Co-authored-by: Copilot <[email protected]>
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
Assetsheader.Note that the button will be loading/disabled, until the callback (called after the refresh is finished) is called.
Changes
RefreshCollectionsButtonto emit the eventoisyReloadCollectionswith a callback for when the event is finished.oisyReloadCollectionsto accept a callback.Tests
Practical test:
Screen.Recording.2025-11-28.at.23.29.55.mov