-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add placeholder
param to Image and ImageEditor to replace upload image text
#8930
Conversation
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-pypi-previews.s3.amazonaws.com/4cbd45192a6f8d70f953de3fd355f1ec278bbbb8/gradio-4.41.0-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@4cbd45192a6f8d70f953de3fd355f1ec278bbbb8#subdirectory=client/python" Install Gradio JS Client from this PR npm install https://gradio-npm-previews.s3.amazonaws.com/4cbd45192a6f8d70f953de3fd355f1ec278bbbb8/gradio-client-1.5.0.tgz |
🦄 change detectedThis Pull Request includes changes to the following packages.
With the following changelog entry.
Maintainers or the PR author can modify the PR title to modify this entry.
|
@hannahblair the functionality looks good but two comments:
|
Yeah you're right. I'll make some changes! |
there's a slight px difference in the chromatic tests so i'll fix that |
I like the second design but now it covers up too much of the image I feel. |
Thanks @hannahblair! I tested this out, and I'm seeing:
|
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
@@ -292,7 +319,7 @@ | |||
align-items: center; | |||
color: var(--block-label-text-color); | |||
line-height: var(--line-md); | |||
font-size: var(--text-lg); | |||
font-size: var(--text-md); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tweaked to be consistent with gr.Image
const _paragraph = remaining_text || false; | ||
|
||
return [_heading, _paragraph]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pngwn tweaked this to accommodate headings on new lines - also a general note this only extracts the first heading, which I think is fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small comment but looks good and works great! Thanks for taking care of this @hannahblair!
Nice @hannahblair. I noticed a couple of things with the heading: (1) If the placeholder is only a heading, it will repeat twice, like this: (2) The difference between the heading font size and the regular text in Nit: although even for |
Left a comment about the above issue. |
@abidlabs fixed the dupe heading text. wdyt of this heading text size? I've changed them from |
Looks good to me! Let me do another round of testing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM @hannahblair, thanks for accommodating all of the feedback!
@abidlabs Thank you for the patience with the rereviews 😅 |
Description
Adds the option to add a
placeholder
parameter to the image components, to allow replacing the upload text on the upload area.Closes: #3511
🎯 PRs Should Target Issues
Before your create a PR, please check to see if there is an existing issue for this change. If not, please create an issue before you create this PR, unless the fix is very small.
Not adhering to this guideline will result in the PR being closed.
Tests
PRs will only be merged if tests pass on CI. To run the tests locally, please set up your Gradio environment locally and run the tests:
bash scripts/run_all_tests.sh
You may need to run the linters:
bash scripts/format_backend.sh
andbash scripts/format_frontend.sh