-
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
Added max lines and overflow scrollbar for gr.Code
#9311
Conversation
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-pypi-previews.s3.amazonaws.com/73e710f188359c68b2a213cfc34cc40ab913a30f/gradio-4.44.0-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@73e710f188359c68b2a213cfc34cc40ab913a30f#subdirectory=client/python" Install Gradio JS Client from this PR npm install https://gradio-npm-previews.s3.amazonaws.com/73e710f188359c68b2a213cfc34cc40ab913a30f/gradio-client-1.6.0-beta.1.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.
|
Btw @micpst we are temporarily not merging PRs to
but I'll probably rebase this to target |
Hi @micpst I just tested this PR and it looks like the behavior of import gradio as gr
with gr.Blocks() as demo:
gr.Code(lines=5)
demo.launch() only 1 line is shown instead of 5: |
Hi @abidlabs this is the standard behavior of the |
Ah you're right. Tested and confirms this PR works correct. Brilliant, thanks @micpst! |
Description
Adds
max_lines
parameter forgr.Code
component, similar togr.Textbox
. This can be used for controlling the display size of this component.Please run
js/component-test
to see it in action (go to Code tab)pnpm i cd js/component-test pnpm dev
I kindly request you @abidlabs to please review this change and let me know your feedback! 🙂
Related to #9192
🎯 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