Skip to content

feat(system): add system.perspective.closeAllPopups - #115

Merged
cesarcoatl merged 1 commit into
8.3from
8.3-feat/system/perspective-closeAllPopups
Dec 2, 2026
Merged

cesarcoatl merged 1 commit into
8.3from
8.3-feat/system/perspective-closeAllPopups

Conversation

@cesarcoatl

@cesarcoatl cesarcoatl commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Summary by Sourcery

New Features:

  • Add system.perspective.closeAllPopups to the public API, with optional session and page targeting.

@sourcery-ai

sourcery-ai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer's Guide

API

Add the public closeAllPopups function and its docstring describing page- and session-level behavior.

  • src/system/perspective/__init__.py L13, L155-172
  • stubs/stubs/system/perspective/__init__.pyi L27-29

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

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.

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


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

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`.

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`.

@cesarcoatl
cesarcoatl force-pushed the 8.3-feat/system/perspective-closeAllPopups branch from 5b57910 to c8181fa Compare December 2, 2026 06:38
@cesarcoatl
cesarcoatl merged commit 7d2016e into 8.3 Dec 2, 2026
5 checks passed
@cesarcoatl
cesarcoatl deleted the 8.3-feat/system/perspective-closeAllPopups branch December 2, 2026 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant