-
Notifications
You must be signed in to change notification settings - Fork 65
feat: update gradio image in readme, add limit of label in gradio #308
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
Conversation
add limit of label in gradio
Summary of ChangesHello @shijinpjlab, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the user interface of the Gradio application by implementing a solution for managing the display of potentially long lists within checkbox groups. It introduces a new CSS class and applies it to the 'Rule List' and 'LLM List' components, which now have a fixed maximum height and become scrollable. This change improves the overall layout and usability by preventing these elements from consuming excessive vertical space on the page, leading to a cleaner and more organized interface. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request adds a height limit with a scrollbar to the 'Rule List' and 'LLM List' checkbox groups in the Gradio interface. This is achieved by adding a CSS class to the components in app.py and defining the corresponding styles in header.html. The changes are functional and address the goal of improving the UI when there are many options.
I have one review comment on the CSS implementation in header.html with suggestions to improve maintainability.
On a side note, the pull request title mentions "update gradio image in readme", but no README files were modified. You might want to update the title to accurately reflect the changes.
| /* 限制 Rule List 和 LLM List 的高度 */ | ||
| .limited-height-checkboxgroup .wrap { | ||
| max-height: 160px !important; | ||
| overflow-y: auto !important; | ||
| } |
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.
This CSS block can be improved for better maintainability:
- Avoid
!important: Using!importantcan make stylesheets difficult to maintain and debug as it breaks the natural CSS cascade. It's better to use more specific selectors if you need to override Gradio's default styles. If!importantis truly necessary here to override inline styles from the Gradio library, consider adding a comment explaining why. - Use English for comments: For consistency with the rest of the codebase and to ensure all contributors can understand it, it's best to write comments in English.
Here's a suggested revision that applies these points:
| /* 限制 Rule List 和 LLM List 的高度 */ | |
| .limited-height-checkboxgroup .wrap { | |
| max-height: 160px !important; | |
| overflow-y: auto !important; | |
| } | |
| /* Limit the height of the checkbox group and enable scrolling */ | |
| .limited-height-checkboxgroup .wrap { | |
| max-height: 160px; | |
| overflow-y: auto; | |
| } |
add limit of label in gradio
No description provided.