Open
Description
Related R implementation: https://github.com/posit-dev/connect/blob/8de330aec6a61cf21e160b5081d08a1d3d7e8129/R/connect.R#L915
Location for Python implementation: https://github.com/posit-dev/connect/blob/49d698dd950351bf781759f18432b13070900486/python/connect_fastapi_runtime.py#L588-L597
Ex implementation:
@shiny.bookmark.set_global_save_dir_fn
def connect_save_shiny_bookmark(id: str) -> Path:
path = Path("connect") / id
path.mkdir(parents=True, exist_ok=True)
return path
@shiny.bookmark.set_global_restore_dir_fn
def connect_restore_shiny_bookmark(id: str) -> Path:
return Path("connect") / id
Once fixed within Connect's repo, Workbench and shinyapps.io will get the upgrade for free.
For anyone coming to this issue on how to perform custom integration, please use :
# Make an app with bookmarking enabled
app = App(ui, server, bookmark_store="url")
# Set save/restore functions
app.set_global_save_dir_fn(save_bookmark_dir)
app.set_global_restore_dir_fn(restore_bookmark_dir)
If this is impossible for you, please make an issue for discussion as we're trying to minimize global state as much as possible.
This is tolerable as it is setting the default state... not necessarily storing per-session information.
Metadata
Metadata
Assignees
Labels
No labels