feat: unified open entrypoint with auto-login and standalone support #2363
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR simplifies the user experience for interacting with Controller UI components by introducing a unified entrypoint and automatic authentication. Previously, users were required to be logged in before they could access specific UI pages like starter packs or settings.
Key Changes
openEntrypoint: Refactored theopenmethod to be the single entrypoint for all UI actions, including both iframe-based pages and the standalone redirect flow.settings,starterpack,profile,purchase-credits,execute, andstandalone.ensureConnected): Added logic to automatically trigger the connection flow if a user attempts to open a UI component while logged out. The iframe now remains open after a successful login to transition seamlessly to the requested page.openmethod has been made private (openStandalone) and is now accessed viaopen({ target: 'standalone' }).openSettings,openStarterPack,openProfile, and others to be wrappers around the new unifiedopenlogic. These methods are nowasyncand handle authentication automatically.openmethod in@cartridge/connector, along with shorthands for common UI actions.Usage Comparison
1. Opening Settings
Previous way (requires user to be connected):
New way (automatically handles login if needed):
2. Opening a Starterpack
Previous way:
New way:
3. Standalone Redirect Flow
Previous way:
New way:
Impact