Skip to content

Release to npm - #528

Merged
lkostrowski merged 1 commit into
mainfrom
changeset-release/main
Oct 5, 2026
Merged

lkostrowski merged 1 commit into
mainfrom
changeset-release/main

Conversation

@saleor-deployments

@saleor-deployments saleor-deployments Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@saleor/app-sdk@1.16.0

Minor Changes

  • c94ac69: Forward Dashboard-owned keyboard shortcuts out of the app iframe so global handlers (e.g. Cmd+K) keep working while the app has focus.

    Public API

    • shortcutsChanged event — Dashboard → app, full-replace list of { id, key, metaKey?, ctrlKey?, altKey?, shiftKey? }. Stored as the optional appBridgeState.dashboardShortcuts (always set by AppBridge, defaults to []). Entries without a non-empty id and key are dropped with a warning.
    • new AppBridge({ forwardKeyboardShortcuts }) — default true. Pass false to disable, or { shouldForward(event) } to claim a registered chord back for the app.
    • matchDashboardShortcut, createShortcutForwarder — matcher and listener used internally; exported for tests and non-React hosts.
    • AppBridge.destroy() — detaches the instance from the window: stops forwarding shortcuts, stops receiving Dashboard events, and drops all subscribers. Safe to call more than once.

    AppBridgeProvider now destroys the AppBridge it created when it unmounts (an instance passed via appBridgeInstance is left alone, since the caller owns it). Without this, React StrictMode's double-mount left two live bridges on the same window and every shortcut and event was handled twice.

    Forwarding is a no-op until the Dashboard advertises a registry, so older Dashboards are unchanged.

    There is deliberately no actions.TriggerShortcut(...) helper. The triggerShortcut action is dispatched by AppBridge itself in response to a real keypress that matched the advertised registry, and its payload only describes that keypress — apps should not synthesize input on the user's behalf. A capability an app wants to invoke directly (e.g. opening the command palette) belongs behind its own action instead.

    Dashboard contract (implement in the Dashboard repo alongside this release)

    1. After handshake, postMessage to the app iframe:

      {
        type: "shortcutsChanged",
        payload: {
          shortcuts: [
            { id: "commandPalette.open", key: "k", metaKey: true },
            // Windows/Linux equivalent if you handle it separately:
            { id: "commandPalette.open", key: "k", ctrlKey: true },
          ],
        },
      }

      Full replace, not a delta. Send again when the owned set changes (route/context). Send { shortcuts: [] } to revoke.

    2. Handle triggerShortcut in useAppActions:

      • Look up payload.shortcutId and run that command.
      • Respond { type: "response", payload: { actionId, ok: true } }.
      • Unknown ids: respond ok: false (do not stay silent — silence times out dispatch after 10s).
    3. Move focus out of the iframe when the resulting UI opens (e.g. .focus() the command-palette input). Without this, subsequent typing stays in the app.

    key is KeyboardEvent.key, matched case-insensitively. Modifier flags are exact: registering Cmd+K does not swallow Cmd+Shift+K.

  • f01c044: Added optional deprecationReason field to AppManifest. Apps can declare their deprecation and point users to a replacement app. Supported in Saleor 3.23+.

@saleor-deployments
saleor-deployments Bot requested a review from a team as a code owner August 24, 2026 10:07
@saleor-deployments
saleor-deployments Bot requested a review from stmpn August 24, 2026 10:07
@codecov

codecov Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.81%. Comparing base (f01c044) to head (29aa185).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #528   +/-   ##
=======================================
  Coverage   95.81%   95.81%           
=======================================
  Files          93       93           
  Lines        1794     1794           
  Branches      312      312           
=======================================
  Hits         1719     1719           
  Misses         73       73           
  Partials        2        2           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

lkostrowski
lkostrowski previously approved these changes Aug 24, 2026
@saleor-deployments
saleor-deployments Bot force-pushed the changeset-release/main branch from 2531e99 to e0b400b Compare August 26, 2026 09:25
@saleor-deployments
saleor-deployments Bot force-pushed the changeset-release/main branch from c83bd4e to f9447e6 Compare October 1, 2026 08:42
@lkostrowski
lkostrowski merged commit fbb4813 into main Oct 5, 2026
10 checks passed
@lkostrowski
lkostrowski deleted the changeset-release/main branch October 5, 2026 14:38
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