Skip to content

Commit dbc810d

Browse files
authored
Merge branch 'main' into input_bookmark_docs
2 parents effcb4c + c441a62 commit dbc810d

File tree

2 files changed

+9
-26
lines changed

2 files changed

+9
-26
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919

2020
* Explicitly call out module usage in UI input bookmark button documentation. (#1983)
2121

22+
* Fix missing session when trying to display an error duing bookmarking. (#1984)
23+
2224

2325
## [1.4.0] - 2025-04-08
2426

shiny/bookmark/_bookmark.py

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ async def invoke_on_restored_callbacks():
436436
except Exception as e:
437437
warnings.warn(
438438
f"Error calling on_restored callback: {e}",
439-
stacklevel=2,
439+
stacklevel=1,
440440
)
441441
notification_show(
442442
f"Error calling on_restored callback: {e}",
@@ -561,7 +561,12 @@ async def do_bookmark(self) -> None:
561561
msg = f"Error bookmarking state: {e}"
562562
from ..ui._notification import notification_show
563563

564-
notification_show(msg, duration=None, type="error")
564+
notification_show(
565+
msg,
566+
duration=None,
567+
type="error",
568+
session=self._root_session,
569+
)
565570

566571

567572
class BookmarkProxy(Bookmark):
@@ -806,27 +811,3 @@ def on_restored(
806811
) -> CancelCallback:
807812
# Provide a no-op function within ExpressStub
808813
return lambda: None
809-
810-
811-
# #' Display a modal dialog for bookmarking
812-
# #'
813-
# #' This is a wrapper function for [urlModal()] that is automatically
814-
# #' called if an application is bookmarked but no other [onBookmark()]
815-
# #' callback was set. It displays a modal dialog with the bookmark URL, along
816-
# #' with a subtitle that is appropriate for the type of bookmarking used ("url"
817-
# #' or "server").
818-
# #'
819-
# #' @param url A URL to show in the modal dialog.
820-
# #' @export
821-
# showBookmarkUrlModal <- function(url) {
822-
# store <- getShinyOption("bookmarkStore", default = "")
823-
# if (store == "url") {
824-
# subtitle <- "This link stores the current state of this application."
825-
# } else if (store == "server") {
826-
# subtitle <- "The current state of this application has been stored on the server."
827-
# } else {
828-
# subtitle <- NULL
829-
# }
830-
831-
# showModal(urlModal(url, subtitle = subtitle))
832-
# }

0 commit comments

Comments
 (0)