feat(mesh): blog product-block editor + post publication status - #4302
Open
yuriassuncx wants to merge 10 commits into
Open
feat(mesh): blog product-block editor + post publication status#4302yuriassuncx wants to merge 10 commits into
yuriassuncx wants to merge 10 commits into
Conversation
Route blog/sections/blocks/Product* to editors that persist platform:kind:id strings so Spire/admin posts are not rewritten to VTEX loader-ref shapes when saved from the mesh sandbox. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
AppProductCardBlock/AppProductShelfBlock rendered raw text inputs for the platform:kind:id product ref, bypassing the DynamicOptionsField picker that the generic SchemaForm already resolves via the app's @Format dynamic-options / @options annotations (same UX as the admin's loader-ref editor). Thread SandboxConfig down to the product blocks so the picker can call the productsByTerm loader. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…-string-editor # Conflicts: # apps/mesh/src/web/components/sandbox/content/blog/blocks/block-registry.tsx
Mounts AppProductCardBlock/AppProductShelfBlock in a real browser with the productsByTerm network call mocked at /deco/invoke/..., asserting the DynamicOptionsField combobox renders (not a raw text input), resolves selected refs to their labeled/imaged option, and persists the correct platform:kind:id string. Regression guard for the picker fix. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Replace placeholder fixture data (picsum.photos images, arbitrary names) with option shapes matching what productResolver.ts#toOption actually produces per platform: VTEX refs/CDN images/BRL-formatted prices, plus a Shopify handle ref to prove the picker UI is platform-agnostic. Drop the screenshot captures — they were only needed to demo the fix, not to guard against regressions. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Publication status (draft/published/archived/…) lives inside the post payload (post.status), surviving mesh saves. Adds a status selector + badge in the post editor, an orthogonal status filter and per-row badge in the posts list, and appends preview=true to the "See preview" URL so drafts render on the sandbox. Legacy posts with no status are treated as published. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
5 tasks
ContentBrowser reads ?contentCollection=<blog kind>&contentItem=<blockKey> on mount to seed the active collection and open a specific record (e.g. a blog post) directly. Params added to the unified-chat route search schema. Absent params keep the current behavior (Pages, no selection) — no regression. Lets the Blog Manager's "Editar no Studio" redirect (spire-agent) land straight on the post the user clicked. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The main merge brought the require-cn-classname lint rule, which flagged the two template-literal classNames in PostStatusBadge/PostStatusSelect. Switch them to cn(...) so the lint check passes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
blog/sections/blocks/ProductCardandProductShelfto dedicated editors that persistplatform:kind:idstring refs (vtex:product:123), aligned with the deco-cms/blog app schema.site/sections/Blog/Post/*blocks (e.g. Elux storefront sections).productListloader-ref shapes.Context
Complements deco-cx/apps#1603, which keeps string refs as the canonical blog app contract and adds hybrid runtime coercion for loader-ref compat.
Test plan
bun testforproduct-string-blocks.test.tsandblog-data.app-blocks.test.ts{ product: vtex:product:ID }in mesh — field shows the ref; save keeps string formatsite/sections/Blog/Post/ProductCard) — loader-ref editor unchangedSummary by cubic
Adds a platform‑agnostic string‑ref editor for
blog/sections/blocks/ProductCardandProductShelf, and brings post publication status to the blog editor with live draft previews. Also adds deep‑linking to open the content editor on a specific blog item.New Features
AppProductCardBlockandAppProductShelfBlockviaisBlogAppBlockResolveType; keep loader‑ref editors forsite/sections/Blog/Post/*.post.status, with a badge + selector in the editor, a status filter and per‑row badge in the posts list; legacy posts default to published; preview URLs append?preview=trueso drafts render.contentCollection/contentItemURL params to preselect a blog collection and open a specific record.Bug Fixes
DynamicOptionsFieldfor app product refs and threadSandboxConfigfromPostEditor/CategoryEditorthroughBlockDocument→BlockRow→ product blocks so the picker works.cn()to satisfy the new lint rule.Written for commit f3b5e8e. Summary will update on new commits.