Skip to content

Conversation

@kvnn
Copy link
Contributor

@kvnn kvnn commented May 6, 2024

Screenshot_2024-05-08_at_9 39 44_AM

This adds a multi-select checkbox type , similar to Actions:

 options = [ cl.CheckboxGroupOption(name='townhouse', value='townhouse', label='townhouse'), cl.CheckboxGroupOption(name='condo', value='condo', label='condo'), cl.CheckboxGroupOption(name='single_family', value='single_family', label='single_family'), cl.CheckboxGroupOption(name='multi_family', value='multi_family', label='multi_family'), cl.CheckboxGroupOption(name='land', value='land', label='land'), cl.CheckboxGroupOption(name='other', value='other', label='other') ] checkbox_group = cl.CheckboxGroup( name=current_model.__tablename__, options=options ) res = await cl.AskCheckboxMessage( content=message, checkbox_group=checkbox_group ).send() if res: print(res['selected']) selected_names = [option['name'] for option in res['selected']] 
@kvnn kvnn marked this pull request as draft May 6, 2024 01:42
@kvnn kvnn marked this pull request as ready for review May 9, 2024 20:04
@willydouhard
Copy link
Collaborator

This is interesting! Two feedback:

  1. It would be nice to have a test for this (you can look at the AskAction test for instance)
  2. The save button taking the whole width seems a bit too much. Maybe auto width and aligned to the right or left?
@kvnn
Copy link
Contributor Author

kvnn commented May 11, 2024

@wildermuthn
Copy link

I could really use this. Looking forward to it being merged!

@kvnn
Copy link
Contributor Author

kvnn commented Jun 17, 2024

@wildermuthn Ah, looks like there are conflicts to resolve now ...
You can use this in the meantime by running chainlit from this fork branch: https://github.com/kvnn/chainlit/tree/feature/checkbox

It takes some configuration to make that work. If you need help , feel free to email me. I'm not sure when I'll get around to these conflicts, and the Chainlit team is very behind on getting PR's merged .

cc @willydouhard

@dokterbob dokterbob added enhancement New feature or request frontend Pertains to the frontend. labels Aug 22, 2024
@dokterbob
Copy link
Collaborator

@kvnn Any chance you could resolve pending merge conflicts, so we can do a final review and get this in!

Sorry it's taken so long, I just joined the team and am hard at work catching up on pending PR's. ;)

@dokterbob
Copy link
Collaborator

From now on expect a reply of 1-3 days. :)

@kvnn
Copy link
Contributor Author

kvnn commented Aug 22, 2024 via email

@willydouhard
Copy link
Collaborator

I think custom elements (released in 2.0.0) are a better fit for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request frontend Pertains to the frontend.

4 participants