Skip to content

[Feature]: Implement Connect/workbench/shinyapps.io (hosted) bookmark integrations #1907

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

Open
schloerke opened this issue Mar 12, 2025 · 4 comments
Assignees

Comments

@schloerke
Copy link
Collaborator

schloerke commented Mar 12, 2025

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.

@schloerke
Copy link
Collaborator Author

(Work with @karangattu on testing within Connect when it is implemented)

@schloerke schloerke changed the title Implement Connect bookmark integrations [Feature]: Implement Connect bookmark integrations Apr 7, 2025
@schloerke
Copy link
Collaborator Author

@schloerke
Copy link
Collaborator Author

Update: Connect team has verbally approved of PR. Waiting a couple weeks before hopefully having it merged in the 2025.04 release at the end of the month.

@schloerke schloerke changed the title [Feature]: Implement Connect bookmark integrations [Feature]: Implement Connect/workbench/shinyapps.io (hosted) bookmark integrations Apr 9, 2025
@schloerke
Copy link
Collaborator Author

schloerke commented Apr 29, 2025

@schloerke schloerke reopened this Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants