Repository navigation
feat(system): add system.perspective.closeAllPopups - #115
Conversation
Reviewer's GuideAPIAdd the public
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/system/perspective/__init__.py" line_range="170" />
<code_context>
+ pageId: Identifier of the page to target. If omitted, the
+ current page will be used automatically. Optional.
+ """
+ builtins.print(id, sessionId, pageId)
+
+
</code_context>
<issue_to_address>
**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`.
</issue_to_address>
### Comment 2
<location path="src/system/perspective/__init__.py" line_range="155" />
<code_context>
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
</code_context>
<issue_to_address>
**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`.
</issue_to_address>Sourcery assessment
Approval pending. 2 findings to address first.
Blocking findings: src/system/perspective/__init__.py:170, src/system/perspective/__init__.py:155
| pageId: Identifier of the page to target. If omitted, the | ||
| current page will be used automatically. Optional. | ||
| """ | ||
| builtins.print(id, sessionId, pageId) |
There was a problem hiding this comment.
🟠 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`.| builtins.print(sessionId, pageId, idp, forceAuth, timeout, payload, framing) | ||
|
|
||
|
|
||
| def closeAllPopups(sessionId="current_session", pageId="current_page"): |
There was a problem hiding this comment.
🟠 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`.5b57910 to
c8181fa
Compare
Summary by Sourcery
New Features:
system.perspective.closeAllPopupsto the public API, with optional session and page targeting.