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

Overhaul card collection display #93

Open
norswap opened this issue Dec 17, 2023 · 1 comment
Open

Overhaul card collection display #93

norswap opened this issue Dec 17, 2023 · 1 comment
Assignees
Labels

Comments

@norswap
Copy link
Member

norswap commented Dec 17, 2023

The current display is a placeholder that doesn't pull on-chain data, and doesn't look great.

UI

Here's a suggestion of how it might look like. Open to more suggestions.

Untitled-2023-12-18-0038

Nevertheless, the picture illustrates the essential features we need:

  • List decks and deck contents
  • List cards staked in inventory
  • List all cards owned (optionally also those in inventory, should be present by default, and inventory card should be marked with a small icon overlayed on the card)
  • We probably don't need a checkbox at first.
  • Search box to search in the current category.

Data Architecture

We'll also need to think about the data architecture for this. Fetching the data is easy enough, we already have a function for fetching the content of a deck, as well as the list of decks (though they don't have names at present).

It's not hard to get all cards, but soon players' collections might be a little bit too big for that to be efficient or even possible.

It wouldn't be hard to add a paginated way to get cards. However the list of owned cards is not sorted, and that's probably not how we would like to display cards on the UI. We could do the sorting in the RPC call, but when collections get large that would be a helluvah lot of storage access. At this point, the only solution would be indexing (which we currently don't have).

I think for now we just get the full collections, do the sorting locally, and we will add indexing later (which can support pagination).

Then the question is how to deal with changes in the collection. It doesn't cost much to listen to events while the page (or even app?) is loaded. Then simply refresh when the page itself refresh (we need to investigate what happens if the client goes offline for a while, but this probably requires a similar refresh).

@norswap
Copy link
Member Author

norswap commented Mar 1, 2024

We should tackle these items while doing this PR: #108 (comment)

@eviterin eviterin mentioned this issue Mar 8, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants