Add popupClose action support for apps#6310
Conversation
🦋 Changeset detectedLatest commit: 8cb48a2 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Pull request overview
Adds Dashboard-side handling for the new App SDK popupClose action so apps running in an embedded frame can request closing the popup.
Changes:
- Wire
popupCloseinto theuseAppActionsdispatcher. - Implement
useHandlePopupCloseActionthat deactivates the active app extension popup and responds with{ ok: true }. - Add a unit test for the new handler and introduce a changeset entry for the release.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/extensions/views/ViewManifestExtension/components/AppFrame/useAppActions.ts | Routes incoming popupClose messages to the new handler. |
| src/extensions/views/ViewManifestExtension/components/AppFrame/appActionsHandler.ts | Adds useHandlePopupCloseAction that deactivates the popup and returns a response status. |
| src/extensions/views/ViewManifestExtension/components/AppFrame/appActionsHandler.test.ts | Adds coverage for the popup close handler and mocks useActiveAppExtension. |
| .changeset/every-terms-drive.md | Release note for App SDK update + popupClose support. |
src/extensions/views/ViewManifestExtension/components/AppFrame/useAppActions.ts
Show resolved
Hide resolved
src/extensions/views/ViewManifestExtension/components/AppFrame/appActionsHandler.ts
Show resolved
Hide resolved
src/extensions/views/ViewManifestExtension/components/AppFrame/appActionsHandler.test.ts
Show resolved
Hide resolved
Differences Found✅ No packages or licenses were added. SummaryExpand
|
| minimumReleaseAge: 720 # 12h | ||
| minimumReleaseAgeExclude: | ||
| - "@saleor/app-sdk" |
There was a problem hiding this comment.
minimumReleaseAgeExclude for @saleor/app-sdk weakens the workspace’s supply-chain safeguard (allows installing very newly published versions). If this is intended as a temporary workaround for the SDK release, consider documenting the rationale (e.g., comment in the file / PR description) and/or scoping a plan to remove the exclusion once the release has aged.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6310 +/- ##
========================================
Coverage 42.58% 42.59%
========================================
Files 2497 2497
Lines 43373 43384 +11
Branches 10231 9851 -380
========================================
+ Hits 18470 18479 +9
- Misses 24866 24868 +2
Partials 37 37 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
popupCloseaction from@saleor/app-sdk, allowing apps to programmatically close popups via codeuseHandlePopupCloseActionhandler inappActionsHandler.tsthat callsdeactivate()on the active app extension and returns an OK responseuseAppActionsto handlepopupCloseaction type from app iframespopupCloseaction handlerDepends on: saleor/app-sdk#488 (app-sdk release with
PopupClosetype)Test plan
popupCloseaction to close itselfpnpm run test:quiet src/extensions/views/ViewManifestExtension/components/AppFrame/appActionsHandler.test.ts🤖 Generated with Claude Code