Skip to content

Commit 980dc32

Browse files
committed
Remove notes as they are now implemented for in Issues
1 parent ec95cdb commit 980dc32

File tree

1 file changed

+14
-53
lines changed

1 file changed

+14
-53
lines changed

shiny/bookmark/_bookmark.py

Lines changed: 14 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -12,53 +12,6 @@
1212
from ._save_state import BookmarkState
1313
from ._types import BookmarkStore
1414

15-
# TODO: Barret - Bookmark state
16-
# bookmark -> save/load interface
17-
# * √ global hooks
18-
# * √ default local functions
19-
# save/load interface -> register functions
20-
# * `shiny.bookmark.globals`
21-
# register interface -> Make interface for Connect
22-
# * TODO: implement in Connect PR
23-
# bookmark -> save state
24-
# save state -> {inputs, values, exclude}
25-
# {inputs} -> custom serializer
26-
# * √ Hook to `Inputs.set_serializer(id, fn)`
27-
# * √ `Inputs._serialize()` to create a dict
28-
# {values} -> dict (where as in R is an environment)
29-
# * √ values is a dict!
30-
# {exclude} -> Requires `session.setBookmarkExclude(names)`, `session.getBookmarkExclude()`
31-
# * √ `session.bookmark_exclude: list[str]` value!
32-
# * √ `session._get_bookmark_exclude()` & `session._bookmark_exclude_fn`
33-
# Using a `.bookmark_exclude = []` and `._get_bookmark_exclude()` helper that accesses a `._bookmark_exclude_fns` list of functions which return scoped bookmark excluded values
34-
# Enable bookmarking hooks:
35-
# * √ `session.bookmark_store`: `url`, `server`, `disable`
36-
# Session hooks -> `onBookmark()`, `onBookmarked()`, `onRestore(), `onRestored()`
37-
# * √ `session.on_bookmark()` # Takes the save state
38-
# * Cancel callback
39-
# * √ `session.on_bookmarked()` # Takes a url
40-
# * Cancel callback
41-
# * `session.onRestore()`
42-
# * `session.onRestored()`
43-
# Session hooks -> Require list of callback functions for each
44-
# * √ Session hooks -> Calling hooks in proper locations with info
45-
# * √ Session hook -> Call bookmark "right now": `doBookmark()`
46-
# * √ `session.do_bookmark()`
47-
# Session updates -> Require updates for `SessionProxy` object
48-
# * √ `doBookmark()` -> Update query string
49-
# * √ Update query string
50-
51-
# bookmark -> restore state
52-
# restore state -> {inputs, values}
53-
# restore {inputs} -> Update all inputs given restored value
54-
55-
# Shinylive!
56-
# Get query string from parent frame / tab
57-
# * Ignore the code itself
58-
# * May need to escape (all?) the parameters to avoid collisions with `h=` or `code=`.
59-
# Set query string to parent frame / tab
60-
61-
6215
if TYPE_CHECKING:
6316
from ..express._stub_session import ExpressStubSession
6417
from ..module import ResolvedId
@@ -102,7 +55,9 @@ def __init__(self):
10255
self._on_restore_callbacks = AsyncCallbacks()
10356
self._on_restored_callbacks = AsyncCallbacks()
10457

105-
# Making this a read only property as app authors will not be able to change how the session is restored as the server function will run after the session has been restored.
58+
# Making this a read only property as app authors will not be able to change how the
59+
# session is restored as the server function will run after the session has been
60+
# restored.
10661
@property
10762
@abstractmethod
10863
def store(self) -> BookmarkStore:
@@ -174,8 +129,9 @@ def on_bookmarked(
174129
Parameters
175130
----------
176131
callback
177-
The callback function to call when the session is bookmarked.
178-
This method should accept a single argument, the string representing the query parameter component of the URL.
132+
The callback function to call when the session is bookmarked. This method
133+
should accept a single argument, the string representing the query parameter
134+
component of the URL.
179135
"""
180136
return self._on_bookmarked_callbacks.register(wrap_async(callback))
181137

@@ -219,7 +175,8 @@ async def update_query_string(
219175
query_string
220176
The query string to set.
221177
mode
222-
Whether to replace the current URL or push a new one. Pushing a new value will add to the user's browser history.
178+
Whether to replace the current URL or push a new one. Pushing a new value
179+
will add to the user's browser history.
223180
"""
224181
...
225182

@@ -228,7 +185,9 @@ async def do_bookmark(self) -> None:
228185
"""
229186
Perform bookmarking.
230187
231-
This method will also call the `on_bookmark` and `on_bookmarked` callbacks to alter the bookmark state. Then, the bookmark state will be either saved to the server or encoded in the URL, depending on the `.store` option.
188+
This method will also call the `on_bookmark` and `on_bookmarked` callbacks to
189+
alter the bookmark state. Then, the bookmark state will be either saved to the
190+
server or encoded in the URL, depending on the `.store` option.
232191
233192
No actions will be performed if the `.store` option is set to `"disable"`.
234193
@@ -256,7 +215,9 @@ def __init__(self, session: AppSession):
256215
self._session = session
257216
# self._restore_context_value = None
258217

259-
# Making this a read only property as app authors will not be able to change how the session is restored as the server function will run after the session has been restored.
218+
# Making this a read only property as app authors will not be able to change how the
219+
# session is restored as the server function will run after the session has been
220+
# restored.
260221
@property
261222
def store(self) -> BookmarkStore:
262223

0 commit comments

Comments
 (0)