-
Notifications
You must be signed in to change notification settings - Fork 108
fix: Introduce a more ergonomic API for express.ui.insert_accordion_panel()
#2042
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
base: main
Are you sure you want to change the base?
Conversation
@karangattu thanks for kick-starting this effort! Would you mind finishing this PR off (i.e., updating tests, examples, and docs to use the new API)? |
Introduces a new app and Playwright test to verify dynamic updating and insertion of accordion panels in Shiny Express UI. Tests cover initial panel rendering, updating panel content and title, and adding new panels via action buttons.
Replaces the previous list-based accordion panel creation with context-managed blocks for improved readability and structure. Updates dynamic panel insertion to match the new format, specifying both the section title and narrative.
I added a test along with modifications to the example app. Where do you want me to make changes in the docs? @cpsievert |
I mainly had the |
3b571b5
to
47ccb7c
Compare
just to clarify the new api for insert_accordion_panel is only for express apps or Core apps should be able to use this api as well? # core app
def accordion_panel(
title: TagChild,
*args: TagChild | TagAttrs,
value: str | MISSING_TYPE | None = MISSING,
icon: TagChild = None,
**kwargs: TagAttrValue
) -> AccordionPanel # express app
def insert_accordion_panel(
id: str,
panel_title: str,
*panel_contents: TagChild | TagAttrs,
panel_value: str | MISSING_TYPE | None = MISSING,
panel_icon: TagChild = None,
target: str | None = None,
position: Literal['after', 'before'] = "after",
session: Session | None = None
) -> None |
Yep, Express and Core API for |
Refactors the accordion test app to use the new shiny.express API.
Closes #1802
Supersedes #2031
Minimal example of new API:
Whereas, with the old API: