-
Notifications
You must be signed in to change notification settings - Fork 100
docs: Add modal_show/remove examples #1628
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
# Now that we have model results, remove the modal | ||
# and update the model result reactive value | ||
ui.modal_remove() | ||
model_result.set(result) |
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.
If we're going to set a reactive val here, let's display it somewhere? I'd also be fine getting rid of it.
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.
I don't think we should get rid of it; it's a core part of the pattern. On the other hand I don't think it's worth showing the value; that ends up just being something to delete if you use this example as a template.
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.
it's a core part of the pattern
It's a core part of a pattern, but not everyone coming to modal_remove()
wants that pattern (e.g., maybe they just want to delay n seconds, or provide another UI control to close)? IMO introducing state that isn't actually used has potential to cause confusion. That said, I ultimately don't want to dwell on such a minor detail.
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.
It's a core part of a pattern, but not everyone coming to modal_remove() wants that pattern
lol very true. I meant "the pattern being demonstrated", not the only pattern.
IMO introducing state that isn't actually used has potential to cause confusion.
I probably wouldn't have included it either, but I've independently shown this pattern to 2-4 different people asking about how to remove the modal.
* main: CI(deploy): Add more installation configs to surface failure cause (posit-dev#1658) `Chat.messages()` no longer trims messages by default (posit-dev#1657) tests(controllers): Split _controls.py into separate files (posit-dev#1652) Chat tweaks (posit-dev#1607) docs: Add modal_show/remove examples (posit-dev#1628) Delay sending of chat UI messages until reactive graph is flushed (posit-dev#1593) ci(remove future behavior warning): Set the `asyncio_default_fixture_loop_scope` to `fixture` (posit-dev#1655) bug: Verify mypy can run on CI (posit-dev#1650) Fix CI install failures on Windows (posit-dev#1651) Quartodoc 0.7.6 (posit-dev#1636) Allow `@chat.transform_assistant_response` function to return `None` (posit-dev#1641) feat: Support templates with `_template.json` metadata (posit-dev#1631) Fix KeyError when serving static files (posit-dev#1648) tests(navsets): Add navsets kitchensink tests (posit-dev#1602) Change default claude model to 3.5 sonnet
Fixes posit-dev/py-shiny-site#201
Related: #1318
Adds an example using
ui.modal_show()
andui.modal_remove()
that is re-used in the documentation for both functions.