Schema suite UX polish

A series of phases that compound into a smoother workflow when shipping schema across multiple resources.

Shop-defaults pre-fill (phases 666 + 667)

Organization Schema fetches GET /seo-tools/shop-defaults on mount and pre-fills name + url + logoUrl + telephone from shop_metadata + general_settings. Article Schema does the same for publisher name + publisher logo. Only fills empty fields — never overwrites merchant edits. Small info banner confirms when prefill landed.

Every fallback path swallowed (missing tables, missing columns) so the form works the same when defaults unavailable.

Native handle autocomplete (phases 668-670)

Every Inject panel + the per-resource SchemaInjectionAudit lookup now uses a <datalist> autocomplete sourced from listEmbeddingProducts / listEmbeddingArticles:

  • FAQ, HowTo, Recipe, Author, Article, Video, Event generators
  • Schema Injection Audit per-resource lookup form

One module-level cache per resource type means the first Inject panel to focus triggers the fetch; the other 6 share the cached list. Browser-native prefix matching keeps the dependency surface tiny.

The native datalist works across every Shopify theme without adding the Polaris React combobox dependency.

Audit chip → generator click-through (phases 644 + 647 + 660)

In the SchemaInjectionAudit per-resource lookup, the "Could ship" warning chips are now clickable. Click → cross-tab switch (Spy → Generators if needed) → matching generator's Inject panel pre-filled with the same handle + resourceType.

The plumbing:

  1. Chip click calls dispatchPrefill({kind, handle, resourceType}) from schema-apply-prefill.ts
  2. Dispatch writes to sessionStorage (versioned .v1 key) + fires CustomEvent + ALSO fires the cross-tab event
  3. The matching generator's subscribePrefill(kind, callback) subscriber fills applyHandle + applyResourceType
  4. 50ms setTimeout defers the scroll so the conditional sub-tab render has time to mount

End-to-end: discover gap → ship in 2 clicks.

Why it matters

Compound speed: a merchant auditing "is FAQ schema applied to my top 10 products" can:

  1. Open Schema Injection Audit, switch to Product
  2. Start typing — autocomplete suggests their products
  3. See "Could ship: faq, howto" warning chips
  4. Click "faq →" — auto-jumps to FAQ generator with handle pre-filled
  5. Generate + click Inject

Compared to: scroll up, find FAQ generator, scroll back to lookup form to copy the handle, scroll back down to paste, generate, type the handle AGAIN in the Inject panel, click Inject.

Plan

All UX polish is free-tier accessible (the underlying inject path retains its Growth+/trial gate).