feat: add experience-toolbar starter example [EXT-7365]#11009
Open
Jared Jolton (jjolton-contentful) wants to merge 1 commit into
Open
feat: add experience-toolbar starter example [EXT-7365]#11009Jared Jolton (jjolton-contentful) wants to merge 1 commit into
Jared Jolton (jjolton-contentful) wants to merge 1 commit into
Conversation
Add a Create Contentful App example demonstrating the new ExO toolbar App SDK location (LOCATION_EXPERIENCE_TOOLBAR), scaffoldable via `npx create-contentful-app --example experience-toolbar`. Typed with ExperienceEditorToolbarAppSDK (@contentful/app-sdk@4.58.0), it demonstrates location detection, reading sdk.exo.context (experience vs. fragment), subscribing to selection changes, reading the selected node's properties via getNode, and reacting to UI mode changes. React-only; no Data Assembly or save/publish (per ticket scope). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
EXT-7365
Summary
examples/experience-toolbarfor the new ExO toolbar App SDK location (LOCATION_EXPERIENCE_TOOLBAR), scaffoldable vianpx create-contentful-app --example experience-toolbar.ExperienceEditorToolbarAppSDKfrom@contentful/app-sdk@4.58.0(first example to pin 4.58.0). Demonstrates every pattern in the ticket AC:sdk.location.is(locations.LOCATION_EXPERIENCE_TOOLBAR)inApp.tsxsdk.exo.contextto tell experience vs. fragment apart (+onContextChanged)sdk.exo.experience.selection.onChange()sdk.exo.experience.getNode(nodeId)and reading its propertiessdk.exo.onUiModeChanged()(form/visual), with graceful form-mode degradationsave()/publish()(per ticket excluded scope). Mirrorsexamples/typescriptconventions (Vite + Vitest + Forma 36).Two deviations from the AC (intentional — flagging for review)
--example, not--template. The AC says--template experience-toolbar, but the CLI scaffolds repo examples via--example <name>(resolved fromapps/examples/via the GitHub API onmaster).--templateis a fixed allowlist of framework starters (IGNORED_EXAMPLE_FOLDERS). Delivered as an example, matching howeditor-assignment,page-location, etc. ship. The ticket hedges with "(or equivalent)".app-definition.json. No example in the repo ships a manifest, and the toolbar location is not anEditorInterfacetarget state — visibility is determined solely by whether the location is registered on the app definition. Documented registration viacreate-app-definition/add-locationsin the README and aConfigScreennote instead of inventing a manifest the CLI would strip.Verification status
tsc --noEmitclean against the published 4.58.0 types.vite buildclean.sdk.exois still rolling out (EXT-7363/EXT-7364). The README states this explicitly. API shapes match the published types exactly.Test plan
npm install && npm run buildinexamples/experience-toolbarsucceedsnpm run test:cipassesnpx create-contentful-app --example experience-toolbarscaffolds a working project (once merged tomaster, since the CLI reads examples from the GitHub API)experience-toolbarlocation, open an experience, and confirm context/selection/ui-mode/properties render liveGenerated with Claude Code