Skip to content

DEVREL-2693: Examples for extended app modes#49

Open
AndrewDiMola wants to merge 1 commit intoWebflow-Examples:mainfrom
AndrewDiMola:2693-extended-app-modes
Open

DEVREL-2693: Examples for extended app modes#49
AndrewDiMola wants to merge 1 commit intoWebflow-Examples:mainfrom
AndrewDiMola:2693-extended-app-modes

Conversation

@AndrewDiMola
Copy link
Copy Markdown

Companion examples for the docs work in webflow/openapi-internal#790.

Adds three new methods to the Utilities object in src/examples/utilities.ts:

  • getCurrentMode — reads the current Designer mode with webflow.getCurrentMode() and logs a mode-specific message.
  • isMode — checks whether the Designer is in Design mode with webflow.isMode("design") and notifies the user when it is not.
  • subscribeAppModesEnriched — subscribes to currentappmode using the new event argument, showing how event.mode and event.appModes remove the need for a separate canForAppMode() call inside the callback.

Existing checkAppMode and subscribeAppModes methods are left in place to preserve the legacy pattern for reference and backward-compat demonstration.

Feature-flagged behind ff-devpl-3603-app-mode-notifications and ff-devpl-3896-app-modes-build-mode on the platform side.

Covers the extended app modes work on the docs side (openapi-internal
PR #790):

- getCurrentMode: reads the current Designer mode and logs a
  mode-specific message.
- isMode: checks whether the Designer is in Design mode and notifies
  the user when it is not.
- subscribeAppModesEnriched: subscribes to currentappmode using the new
  event argument, demonstrating how the callback can read event.mode
  and event.appModes without a separate canForAppMode() call.

Leaves the existing checkAppMode and subscribeAppModes methods intact
to preserve the legacy pattern for reference.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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