Add application/page intent type (create, edit) - #17
Add application/page intent type (create, edit)#17NguyenQuangHuy-Harry wants to merge 3 commits into
Conversation
|
I have signed the CLA! |
- snake_case multi-word fields (page_type, media_url, blog_post) - draft 2020-12 and '<Name> Schema' title, matching published schemas - move draft schema ahead of the field table, matching application-email.md - move rationale into the PR body per the repo PR template
|
Hi @NguyenQuangHuy-Harry, thank you for an excellent proposal. The merchant asks you anchored this in are real ones, and the composition story with Initial reactions on your three questions:
One ask: consider a more specific type name. On the two convention divergences: good catches, both. The No need to move to an RFC; this PR is the right venue. We're reviewing the open type proposals (this and #14) and will come back with consolidated schema-level feedback. |
Proposed type
application/pagecreateandeditWhy this type
Real merchant asks this captures:
editthat currently means finding the right app, the right page, and the right insertion point by hand.application/adintent, where the two types compose.Storefront page building is a mature, multi-vendor App Store category and currently the largest one with no way to register an intent.
Who would register intents for it
The design constraint I worked to: two page builders will never agree on a component tree, but they can agree on "a page titled X, for surface Y, featuring products Z, roughly these sections."
Schema sketch
Full draft is inline in
types/application-page.mdin this PR. Shape summary:id,title,handle,page_type(home/product/collection/blog_post/page/password),goal,sections[](type,heading,body,media_url),products[]/collections[]GIDs,status,seo.Deliberately excluded, as app document-model concerns rather than merchant-facing ones: element and component trees, style objects, breakpoints, template file bindings, revision history.
Confirmed:
inputSchemadoes not declarerequiredfieldstypes/— snake_case for multi-word fields, matching the fields proposed onapplication/email(body_html,reply_to,template_id)application/*, the schema refs the canonical application schema (TOML example$refs the would-be canonical URL; draft inline pending publication)shopify/*— n/aPrior art
shopify/productwithimportcovers "build a page for this product", which is real and useful. It can't express a page with no single anchoring resource — an About page, a campaign landing page, a multi-product comparison — and it carries no page-level intent (title, handle, outline, goal).application/campaigndescribes the campaign's schedule, audience, and channels. A page is usually the campaign's destination, and most pages have no campaign behind them at all.application/faqalready covers the case where the page is an FAQ, and should keep doing so. The shapes differ: question-and-answer versus section outline.application/theme-edit-task(proposed in discussions) targets theme code; this targets a merchant-authored page.Anything else
Three things I'd rather have your read on than guess at:
sectionstoo app-specific to carry? It's the field most likely to vary between builders. Dropping it and lettinggoalcarry the whole intent is a legitimate alternative, at the cost of structure Sidekick could otherwise pre-fill. Related: every publishedapplication/*schema exceptemailis currentlyidplusadditionalProperties: true, so if the house style is to ship minimal and let apps extend, I'm happy to cut this draft back a long way.page_type? Closed is safer for routing; open avoids a schema revision each time a new storefront surface appears.publishaction out of scope? Everyapplication/*type intypes/declares exactlycreateandedit, so I've followed that — but "publish the page I made yesterday" is a plausible merchant ask, and it's a state transition rather than an edit. Happy to leave it out if the omission across the catalog is deliberate.Two small conventions I diverged on, both easy to revert if you'd rather I matched the existing files:
https://json-schema.org/draft/2020-12/schemaand a"Page Schema"title, matching what's actually published atextensions.shopifycdn.comtoday.types/application-email.mdshowsdraft-07in its example, so the two are inconsistent and I followed the published artifact.type = "admin_link"withtarget = "admin.app.intent.link", since page building is long-running and visual enough that navigating into the app's editor beats an inline surface. Note thattypes/application-email.mdcurrently showstarget = "admin.intent.render", which doesn't appear in the current docs — the render target is documented asadmin.app.intent.render. Happy to open that as a separate fix if useful.Glad to iterate on any of it, and happy to move this to an RFC discussion if you'd rather shape it there first.