Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/system/perspective/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"alterDock",
"alterLogging",
"authenticationChallenge",
"closeAllPopups",
"closeDock",
"closePage",
"closePopup",
Expand Down Expand Up @@ -151,6 +152,24 @@ def authenticationChallenge(
builtins.print(sessionId, pageId, idp, forceAuth, timeout, payload, framing)


def closeAllPopups(sessionId="current_session", pageId="current_page"):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High · Other pages stay open

When a caller omits pageId to request session-wide closure, closeAllPopups substitutes current_page and its annotation excludes None, so the request targets only the current page and popups on other pages stay open.

Default pageId to None and annotate it as optional so omission requests closure across the session.

Also at stubs/stubs/system/perspective/__init__.pyi:28.

Prompt for AI agents
In `src/system/perspective/__init__.py` at line 155:

**Other pages stay open**

When a caller omits `pageId` to request session-wide closure, `closeAllPopups` substitutes `current_page` and its annotation excludes `None`, so the request targets only the current page and popups on other pages stay open.

Default `pageId` to `None` and annotate it as optional so omission requests closure across the session.

Also at `stubs/stubs/system/perspective/__init__.pyi:28`.

# type: (Union[str, unicode], Union[str, unicode]) -> None
"""Closes all open popups on the page with the given pageId, or on
all pages in the Session with the given sessionId if no pageId is
provided.

If neither a pageId nor a sessionId is provided, all open popups on
every page in the current Session are closed.

Args:
sessionId: Identifier of the Session to target. If omitted, the
current Session will be used automatically. Optional.
pageId: Identifier of the page to target. If omitted, the
current page will be used automatically. Optional.
"""
builtins.print(id, sessionId, pageId)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High · Popup close requests fail

When closeAllPopups is called, builtins.print includes Python’s built-in id as an extra first argument, so the close request has the wrong payload and popups remain open.

Remove id from the builtins.print call.

Also at src/system/perspective/__init__.py:171.

Prompt for AI agents
In `src/system/perspective/__init__.py` at line 170:

**Popup close requests fail**

When `closeAllPopups` is called, `builtins.print` includes Python’s built-in `id` as an extra first argument, so the close request has the wrong payload and popups remain open.

Remove `id` from the `builtins.print` call.

Also at `src/system/perspective/__init__.py:171`.



def closeDock(
id, # type: Union[str, unicode]
sessionId="current_session", # type: Union[str, unicode]
Expand Down
3 changes: 3 additions & 0 deletions stubs/stubs/system/perspective/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ def authenticationChallenge(
payload: Optional[Dict[Union[str, unicode], Any]] = ...,
framing: Union[str, unicode] = ...,
) -> None: ...
def closeAllPopups(
sessionId: Union[str, unicode] = ..., pageId: Union[str, unicode] = ...
) -> None: ...
def closeDock(
id: Union[str, unicode],
sessionId: Union[str, unicode] = ...,
Expand Down