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

Contract Explorer: Contract storage filters #1233

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

quietbits
Copy link
Contributor

@quietbits quietbits commented Jan 29, 2025

  1. The filter logic is "or", meaning that selecting more filters includes more records. We could implement "and" logic (narrowing down selection), making the filters dynamic. Adding more data to store locally might slow the UI, though.
  2. We need an "Apply" button to apply the selected filters. Because we can have thousands of records, we can't make updates on the fly as the filters are selected. For now, I added a basic button, so we have "Apply" and "Clear filter" buttons.
  3. What should be the logic for selecting value filters? I'm using object keys from decoded value XDR, and we might end up with numbers. For example, CAS3FL6TLZKDGGSISDBWGGPXT3NRR4DYTZD7YOD3HMYO6LTJUVGRVEAM (Mainnet). key filters are much more predictable than value, which can be pretty much anything.
  4. How should we handle very long lists of filters? For example, CDVQVKOY2YSXS2IC7KN6MNASSHPAO7UN2UR2ON4OI2SKMFJNVAMDX6DP (Mainnet) has a very long list of value filters.
  5. We need to keep checking how we handle thousands of records. On my machine, CDVQVKOY2YSXS2IC7KN6MNASSHPAO7UN2UR2ON4OI2SKMFJNVAMDX6DP (Mainnet) with 6k+ records at this time, seems OK. It takes a few seconds on the initial load, and then the loader is displayed when sorting. But the UI doesn't feel sluggish; it just takes longer to load the result.
  6. Should we display the filtered results count?
  7. I will add tests in a follow-up PR once we're all set with the UI.

image

@quietbits quietbits linked an issue Jan 29, 2025 that may be closed by this pull request
@stellar-jenkins
Copy link

Comment on lines +71 to +72
keyJson: i.key ? decodeScVal(i.key) : undefined,
valueJson: i.value ? decodeScVal(i.value) : undefined,
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 need to decode key and value XDR to get filter values.

@stellar-jenkins
Copy link

@stellar-jenkins
Copy link

@quietbits quietbits requested a review from jeesunikim January 29, 2025 16:32
@janewang
Copy link
Contributor

Should we display the filtered results count?
No, I think there is no need. Once they filter down the list, maybe the user can download

@jeesunikim
Copy link
Contributor

I'm getting a warning for missing key prop in console.
console

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog (Not Ready)
Development

Successfully merging this pull request may close these issues.

Contract Details > Contract Storage > Add filters
4 participants