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

Dropdown Component Updates #3211

Merged
merged 33 commits into from
Feb 23, 2023
Merged

Dropdown Component Updates #3211

merged 33 commits into from
Feb 23, 2023

Conversation

dawoodkhan82
Copy link
Collaborator

@dawoodkhan82 dawoodkhan82 commented Feb 16, 2023

Description

Default dropdown uses the custom dropdown UI (adding searching ability)
max_choices param, can be set when multiselect is True
Adding A11y accessibility
Some styling updates (hover over tokens)

Please include:

  • relevant motivation
  • a summary of the change
  • which issue is fixed.
  • any additional dependencies that are required for this change.

Closes: #3184, #3163

Checklist:

  • I have performed a self-review of my own code
  • I have added a short summary of my change to the CHANGELOG.md
  • My code follows the style guidelines of this project
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

A note about the CHANGELOG

Hello 👋 and thank you for contributing to Gradio!

All pull requests must update the change log located in CHANGELOG.md, unless the pull request is labeled with the "no-changelog-update" label.

Please add a brief summary of the change to the Upcoming Release > Full Changelog section of the CHANGELOG.md file and include
a link to the PR (formatted in markdown) and a link to your github profile (if you like). For example, "* Added a cool new feature by [@myusername](link-to-your-github-profile) in [PR 11111](https://github.com/gradio-app/gradio/pull/11111)".

If you would like to elaborate on your change further, feel free to include a longer explanation in the other sections.
If you would like an image/gif/video showcasing your feature, it may be best to edit the CHANGELOG file using the
GitHub web UI since that lets you upload files directly via drag-and-drop.

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Feb 16, 2023

🎉 The demo notebooks match the run.py files! 🎉

@gradio-pr-bot
Copy link
Collaborator

All the demos for this PR have been deployed at https://huggingface.co/spaces/gradio-pr-deploys/pr-3211-all-demos

@dawoodkhan82 dawoodkhan82 marked this pull request as ready for review February 18, 2023 21:40
Copy link
Member

@pngwn pngwn left a comment

Choose a reason for hiding this comment

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

The design of this dropdown isn't consistent with the previous one. The font size is too large when typing into the box and the padding around the text is not consistent with the other form inputs. As a result the heights of this component don't match with the heights of the other 'input' components.

Compare the dropdown to the Number component at the top.

Screenshot 2023-02-21 at 12 08 42

ui/packages/form/src/Dropdown.svelte Show resolved Hide resolved
@dawoodkhan82
Copy link
Collaborator Author

@pngwn I can update the text size and padding but didn't want to interfere with the changes being made here (#3163). But I guess I can make those changes myself in this PR

@pngwn
Copy link
Member

pngwn commented Feb 21, 2023

@dawoodkhan82 We can find another issue for that person. They are still having difficulties running the project locally.

@Neilblaze
Copy link

Neilblaze commented Feb 22, 2023

@dawoodkhan82 @pngwn for sure! I think it's something to do with the config of codespaces. I'll finally have access to my PC tomorrow (running on Ubuntu 22.04 LTS x64), and I'll take a final shot at it. I'll share an update if it doesn't work, else I'll simply drop a PR for #3163. Thanks again! 🙌🏼

Meanwhile, @dawoodkhan82 if there are any free issues that are up for grabs & need to be resolved, feel free to tag me. I'd love to fix that!

@pngwn
Copy link
Member

pngwn commented Feb 22, 2023

@Neilblaze I'll be looking into your issue this week too. We don't want to discourage contributions because things are difficult to setup.

@dawoodkhan82
Copy link
Collaborator Author

@Neilblaze Will do!

dawoodkhan82 and others added 13 commits February 22, 2023 18:17
* add wildcard to image input

* simplify mime types

* changelog

* regen noteboks

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Co-authored-by: pngwn <hello@pngwn.io>
* fix webcam

* changelog

* fix changelog

* fix changelog

* fix changelog

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
* add interactive=False to button

* add interactive=True by default

* changelog

* fix frontend

* fix backend test

* formatting

* review changes
* latex height fix

* changelog

* formatting

* em

* em
* added benchmark queue script

* changelg

* fix instructions
* Fix matplotlib css

* CHANGELOG

* Undo lockfile
* Fix + test

* Remove print statements + fix import for 3.7

* CHANGELOG

* Remove more print statements

* Add 60 second timeout for uploading data

* Fix test

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
@dawoodkhan82 dawoodkhan82 requested a review from pngwn February 23, 2023 16:58
@dawoodkhan82
Copy link
Collaborator Author

"flaky" backend tests are passing locally. Not sure what's going on

@freddyaboulton
Copy link
Collaborator

I would ignore that failure @dawoodkhan82 !

Copy link
Member

@pngwn pngwn left a comment

Choose a reason for hiding this comment

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

lgtm!

@dawoodkhan82
Copy link
Collaborator Author

@abidlabs mind taking a quick look?

CHANGELOG.md Outdated Show resolved Hide resolved
@@ -1238,6 +1240,9 @@ def __init__(
if multiselect:
if isinstance(value, str):
value = [value]
if not multiselect and max_choices is not None:
warnings.warn("Max choices is ignored when multiselect is False.")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
warnings.warn("Max choices is ignored when multiselect is False.")
warnings.warn("The `max_choices` parameter is ignored when `multiselect` is False.")

@abidlabs
Copy link
Member

Some documentation nits, but otherwise looks awesome @dawoodkhan82!

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.

Limit choices for gr.Dropdown multiselect
7 participants