feat: allow hiding section header accordions#435
Conversation
🪼 branch checks and previews
|
🦄 change detectedThis Pull Request includes changes to the following packages.
|
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
|
@abidlabs Thanks for the feedback! It should all be implemented now. |
|
@Saba9 so the next version of Gradio (which should be released today/tomorrow) should make this feature easier to implement because it will allow the creation of custom accordions. So let's set this PR to draft status. Once the next version of Gradio is out, I'll adapt this PR to use that feature. cc @aliabid94 for visibility |
abidlabs
left a comment
There was a problem hiding this comment.
LGTM @Saba9! I changed the implementation to use gr.HTML custom layouts which were introduced recently in Gradio.
The UI is effectively the same, but the implementation is a little simpler (at least on the python side), while giving us complete flexibility to customize the UI of the accordions down the line if we want.
Short description
This PR adds a "Show section headers" checkbox below the embed options panel (default checked). When unchecked, accordion wrappers around metric groups are hidden. The state is also encoded in the iframe URL so that the embed reflects the setting.
Shown (default)
Hidden
AI Disclosure
Type of Change
Related Issues
Closes: #332
Testing and linting
python -m pytest— 89 passed, 11 skippedruff check --fix --select I && ruff format— all checks passed