Repository navigation
feat(system): add system.perspective.closeAllPopups #115
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ | |
| "alterDock", | ||
| "alterLogging", | ||
| "authenticationChallenge", | ||
| "closeAllPopups", | ||
| "closeDock", | ||
| "closePage", | ||
| "closePopup", | ||
|
|
@@ -151,6 +152,24 @@ def authenticationChallenge( | |
| builtins.print(sessionId, pageId, idp, forceAuth, timeout, payload, framing) | ||
|
|
||
|
|
||
| def closeAllPopups(sessionId="current_session", pageId="current_page"): | ||
| # 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) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 High · Popup close requests fail When Remove Also at Prompt for AI agentsIn `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] | ||
|
|
||
There was a problem hiding this comment.
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
pageIdto request session-wide closure,closeAllPopupssubstitutescurrent_pageand its annotation excludesNone, so the request targets only the current page and popups on other pages stay open.Default
pageIdtoNoneand annotate it as optional so omission requests closure across the session.Also at
stubs/stubs/system/perspective/__init__.pyi:28.Prompt for AI agents