twenty icon indicating copy to clipboard operation
twenty copied to clipboard

Select component should have a scroll and be searchable

Open FelixMalfait opened this issue 1 year ago • 11 comments

I created a custom column in the data model with lots of options.

Settings: Screenshot 2024-01-10 at 16 15 00

Here's how it was displayed in the UI — I had to scroll the page to scroll the list, there was no "sub scroll": Screenshot 2024-01-10 at 16 13 49

Can we create a component similar to the component we use for account owner field or even better adapt it re-use that one? The main difference is that the search here would probably be done on the frontend side only.

A quick fix would be to just set a max-height + make this scrollable, but it would be best if we can add search.

Figma: https://www.figma.com/file/xt8O9mFeLl46C5InWwoMrN/Twenty?node-id=3007%3A69739&mode=dev

Screenshot 2024-01-10 at 16 21 24

FelixMalfait avatar Jan 10 '24 15:01 FelixMalfait

Hi @FelixMalfait a first-time contributor here, but can I take this ??

gold-olar avatar Jan 18 '24 10:01 gold-olar

@gold-olar The scroll part would be easy but what's hard is the search. You would probably need to adapt and migrate to this existing component that does search already: https://storybook.twenty.com/?path=/story/ui-input-relationpicker-singleentityselect--default

So probably not very easy for a first issue. But if you feel confident and still want to give it a shot let us know!

FelixMalfait avatar Jan 18 '24 11:01 FelixMalfait

Yeah, I saw that component, but I was thinking I would need to just add the search functionality to the current component (instead of re-working the relationship picker component) since this search is going to be done on the frontend side only.

If you'd like, I can work on the issues separately. I can send in a fix for the scroll part first, and take more time to work on the search (if you really want me to adapt and migrate to the existing component).

gold-olar avatar Jan 18 '24 11:01 gold-olar

@gold-olar Yes you're right, probably worth keeping 2 separate high-level components but reusing the same underlying components as much as we can (so that we don't duplicate keyboard behavior code for example). So you can start in this direction!

@charlesBochet can give better guidance than I would

FelixMalfait avatar Jan 18 '24 12:01 FelixMalfait

@gold-olar A few hints about this one:

  • we would like to improve the SelectFieldInput (which should stay different from the RelationFieldInput)
  • you can use SelectableList to make it scrollable and navigable with keyboard
  • you can use components from ui/layout/dropdown for the UI layer (DropdownMenuSearchInput, DropdownMenuSeparator, DropdownMenuItemsContainer...)

You should find example in the code about how to use these components Good luck! :)

charlesBochet avatar Jan 22 '24 10:01 charlesBochet

A little design hint:

The following picker should be used for Select. The label size should be 20px and not 16px.

image

As a reminder the tag background color is the one set here:

CleanShot 2024-01-24 at 16 55 28

Bonapara avatar Jan 24 '24 15:01 Bonapara

Hey @gold-olar have you made any progress on this yet? Would be amazing to have it in the next release! Thanks a lot

FelixMalfait avatar Jan 25 '24 09:01 FelixMalfait

@FelixMalfait I am working on #3354 and all requirements will be covered in that as I have added the Search and Listing feature already. Since I have made lots of progress in that it would be easy if I resolve this along with that issue.

ARSHIL1804 avatar Jan 25 '24 10:01 ARSHIL1804

@ARSHIL1804 oh cool

FelixMalfait avatar Jan 25 '24 11:01 FelixMalfait

A little design hint:

The following picker should be used for Select. The label size should be 20px and not 16px.

image

As a reminder the tag background color is the one set here:

CleanShot 2024-01-24 at 16 55 28

@Bonapara for the options we need to create this select with label background?. Or we can make change in exsisting MenuItemSelect?

ARSHIL1804 avatar Jan 25 '24 15:01 ARSHIL1804

@ARSHIL1804 Charles gave some direction above. MenuItemSelect is something different that is not related I think

we would like to improve the SelectFieldInput (which should stay different from the RelationFieldInput) you can use SelectableList to make it scrollable and navigable with keyboard you can use components from ui/layout/dropdown for the UI layer (DropdownMenuSearchInput, DropdownMenuSeparator, DropdownMenuItemsContainer...)

FelixMalfait avatar Jan 25 '24 15:01 FelixMalfait