Skip to content

Feature / support Chrome side panel overlay view and in-panel request handling#2518

Open
Maskln wants to merge 7 commits into
v2from
chrome-side-panel
Open

Feature / support Chrome side panel overlay view and in-panel request handling#2518
Maskln wants to merge 7 commits into
v2from
chrome-side-panel

Conversation

@Maskln

@Maskln Maskln commented Jul 2, 2026

Copy link
Copy Markdown
Member

paired with: https://github.com/AmbireTech/ambire-app/pull/7448

Summary

Adds controller-layer support for running the extension in Chrome’s side panel instead of a separate popup request window.

  • Introduce side-panel as an extension overlay view type alongside popup, and update UiController to treat popup/side-panel as a single overlay slot (swap type in place when the user toggles modes).
  • Update RequestsController to detect an open side panel and skip opening/focusing a request window; action requests are rendered in-place in the panel via currentUserRequest.
  • Add dismissActiveRequest() with the same queue semantics as closing the request window (calls stay queued, non-calls are rejected per existing rules).
  • Extract shared #onActiveRequestDismissed() / #handleRequestWindowClose() logic so popup close and side-panel dismiss behave consistently.
  • Wire side-panel awareness through dapps, transfer, and main controllers where overlay view type matters.

Test plan

  • With side panel open, trigger a dapp connect / sign message / sign transaction request — no popup window opens; request becomes currentUserRequest.
  • Dismiss an active request from the side panel — calls are queued with notification; other request types are rejected as before.
  • Close the side panel while requests are pending — behavior matches popup overlay teardown.
  • Toggle side panel mode off — extension falls back to popup request window flow.
  • Regression: popup-only mode still opens, focuses, and closes request windows correctly.

@Maskln Maskln marked this pull request as ready for review July 3, 2026 08:03
@Maskln Maskln changed the title Add side-panel overlay view support for Chrome side panel mode Feature / support Chrome side panel overlay view and in-panel request handling Jul 3, 2026
@Maskln

Maskln commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

/review

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🔒 No security concerns identified
✅ No TODO sections
⚡ Recommended focus areas for review

Unhandled Errors

The new public method dismissActiveRequest() awaits #onActiveRequestDismissed(), which performs multiple async operations (#setCurrentUserRequest, notification.create, resolveUserRequest, rejectUserRequests) that can throw. The method lacks a try/catch or this.emitError() guard, violating the invariant that public controller methods must never propagate errors. If an inner rejection occurs (e.g., rejectUserRequests fails due to a race condition), the error propagates to the caller and can leave the request queue in an inconsistent state.

async dismissActiveRequest() {
  await this.#awaitPendingPromises()
  if (!this.currentUserRequest) return

  // In the side panel there is no window to close; apply the same queue semantics as
  // closing the request window (keep calls queued, clear the active request).
  if (this.#isSidePanelOpen) {
    await this.#onActiveRequestDismissed()
    return
  }

  if (this.requestWindow.windowProps) {
    await this.closeRequestWindow()
  }
}

@Maskln

Maskln commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

/review

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🔒 No security concerns identified
✅ No TODO sections
⚡ No major issues detected

@Maskln Maskln requested review from Oxbobby and sonytooo July 3, 2026 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant