brave / brave-talk

Unlimited private video calls with your friends and colleagues
Mozilla Public License 2.0
123 stars 35 forks source link

Make NFT lists scrollable #1380

Open mrose17 opened 8 months ago

mrose17 commented 8 months ago

We have entered an interesting era of NFTs wherein you can subscribe to services that send you NFTs daily (or more frequently). This effectively makes the "show the latest 50 NFTs" display strategy unhelpful.

Sadly, it is time to retrieve all the NFTs (filtered or not on spam_score) and present them to the user in a scrollable list.

mrose17 commented 7 months ago

if possible, add cached paging support to the back-end, so that once the front-end makes the first rquest, and it is returned, then we pre-fetch/cache the second page, and try to maintain 3 pages in the cache for the address we are asking about (one back, one current, one forward).

bcaller commented 7 months ago

I believe this can be done all in the frontend by adding the required paging parameters to URLs like https://github.com/brave/brave-talk/blob/173f35e62b03a194634be3c0cb4206bedc1ec852/src/components/web3/api.ts#L104-L106 (except caching).

mrose17 commented 7 months ago

great! i suspect it would be good to review the brave-talk-server code to make sure it sanitizes the query params so that only chains,wallet_addresses,order_by,limit and cursor.

bcaller commented 7 months ago

Hmm no I'm not sure we care to do that for client requests. Proxy code is https://github.com/search?q=repo%3Abrave%2Fanon-proxy%20simplehash&type=code

mrose17 commented 7 months ago

OK, let's not worry about the query parameters. Let's just make the lists scrollable.