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

[APR] PoolTable Filter #251

Merged
merged 46 commits into from
Aug 31, 2023
Merged

Conversation

Rawallon
Copy link
Contributor

@Rawallon Rawallon commented Aug 29, 2023

  • Altered calculatePoolStats to return tokens used on Pool

  • Add PoolType return to calcutePoolStats/Route

  • Altered PoolListTable column headings

  • Added Downshift as a dependency

  • Implemented Multi selector with Downshift

  • Implemented TokenFilter with Multi selector component

  • Implemented util function to generate API url with filters

  • Changed token filter name and added Type

  • Better Ux on MultiSelect

  • Refactor PoolTable to use queryParams to sort and order

  • Adds initial min tvl and limit on filter url

  • Implemented function to filter selected items

  • Moved MultiSelectDropdown to components folder

  • Smaller text on the popover

  • Add max width to MultiSelect

  • Add empty state to poolTable

  • Added hasMorePool conditional to PoolTable

@linear
Copy link

linear bot commented Aug 29, 2023

BAL-710 UI for filter on poolTable

input filter poolTable

  • by name

  • by network

  • by token

    image.png

  • from breadcrumbs select a field on filter

Base automatically changed from rawallon/bal-718-pool-list-design-must-be-consistent-with-pool-metadata-left to main August 29, 2023 21:32
@ribeirojose
Copy link
Contributor

would take a look into https://ui.shadcn.com/docs/components/combobox

@Rawallon
Copy link
Contributor Author

@ribeirojose I got the Downshift recommendantion from this thread on shadcn's repo about multi-select

@Rawallon Rawallon force-pushed the rawallon/bal-710-ui-for-filter-on-pooltable branch from 2ac1767 to df86cb5 Compare August 30, 2023 13:03
@netlify
Copy link

netlify bot commented Aug 30, 2023

Deploy Preview for balancer-tools ready!

Name Link
🔨 Latest commit 81cb3f7
🔍 Latest deploy log https://app.netlify.com/sites/balancer-tools/deploys/64f0bea5fca3d100087fe897
😎 Deploy Preview https://deploy-preview-251--balancer-tools.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ribeirojose
Copy link
Contributor

@ribeirojose I got the Downshift recommendantion from this thread on shadcn's repo about multi-select

Cool! Haven't tried out the PR yet but just pointed it as a resource. This comment from the thread you mentioned is 🔥 shadcn-ui/ui#66 (comment)

@Rawallon
Copy link
Contributor Author

Rawallon commented Aug 31, 2023

Here's how to select looks like

chrome_gPk5QwrF4r.mp4

I think we could iterate on it to end up with something like Balancer's, but I think this is good enough as it is, what do you guys think?

Here's the balancer search

image

@Rawallon Rawallon force-pushed the rawallon/bal-710-ui-for-filter-on-pooltable branch from eaac9ad to 50e60a0 Compare August 31, 2023 14:26
@Rawallon Rawallon marked this pull request as ready for review August 31, 2023 14:31
@Rawallon Rawallon force-pushed the rawallon/bal-710-ui-for-filter-on-pooltable branch from 95d5708 to f88a9a1 Compare August 31, 2023 14:48
return (
<Badge key={value + idx} color="blue">
<div
className="flex gap-2 items-center w-max"
Copy link
Contributor

@ribeirojose ribeirojose Aug 31, 2023

Choose a reason for hiding this comment

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

I think either gap-1 or adding some more horizontal padding will make this look better.
Screenshot 2023-08-31 at 11 51 59

Copy link
Contributor Author

Choose a reason for hiding this comment

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

gap-1 would reduce the gap tho

);

return (
<div className="relative">
Copy link
Contributor

@ribeirojose ribeirojose Aug 31, 2023

Choose a reason for hiding this comment

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

Copy link
Contributor

@ribeirojose ribeirojose Aug 31, 2023

Choose a reason for hiding this comment

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

From that above example ☝️ we also need an empty state when that search doesn't yield any results. Can you track that on Linear?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking about it, do you think we should limit number os tokens to be searched at once?

cc @luizakp

Copy link
Contributor

Choose a reason for hiding this comment

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

I just checked Balancer UI and they don't handle this case as well... from all the pool type the max amount of tokens is 8. So I think it makes sense to limit 8 tokens.WDYT?


return (
<div className="relative">
<Downshift {...rest} onChange={changeHandler()}>
Copy link
Contributor

@ribeirojose ribeirojose Aug 31, 2023

Choose a reason for hiding this comment

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

Keyboard arrow navigation doesn't work for this Select 😞 no need to work on this now since we've already put a lot of time here, but it's certainly something that's very intuitive to me that I couldn't use here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 Downshift should help with that, I'll take a stab at it later

@Rawallon
Copy link
Contributor Author

@ribeirojose @luizakp Need you guys' approval

@Rawallon Rawallon merged commit 320c48a into main Aug 31, 2023
10 checks passed
@Rawallon Rawallon deleted the rawallon/bal-710-ui-for-filter-on-pooltable branch August 31, 2023 17:11
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.

None yet

3 participants