feat(cms): SEO editor with multi-format previews + JSON file viewer#3655
Open
rafavalls wants to merge 6 commits into
Open
feat(cms): SEO editor with multi-format previews + JSON file viewer#3655rafavalls wants to merge 6 commits into
rafavalls wants to merge 6 commits into
Conversation
Add a Content-tab "SEO" section for editing the site default SEO and a two-pane page SEO editor (form + live previews across Google, Facebook, X, LinkedIn, WhatsApp, Telegram, Slack, Discord). Page previews layer the site default behind page overrides to reflect what actually renders. Also: "View JSON" opens the page block file in the code view, colorized file-tree icons, an SEO icon, and a fix for clipped image/file inputs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
🧪 BenchmarkShould we run the Virtual MCP strategy benchmark for this PR? React with 👍 to run the benchmark.
Benchmark will run on the next push after you react. |
Contributor
Release OptionsSuggested: Minor ( React with an emoji to override the release type:
Current version:
|
Contributor
There was a problem hiding this comment.
2 issues found across 11 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
…tests
Unify the three duplicated debounced-save paths (SeoEditor, the SEO sheet,
inline SEO in SectionsEditor) behind a shared useDebouncedSaveBlock hook and a
single resolveSeoTarget resolver. Export AUTOSAVE_DELAY and
DEFAULT_SEO_RESOLVE_TYPE from one place; merge PageSeoSheet/SiteSeoSheet into a
single SeoSheet({ target }). Reset codeFilePath when leaving code mode so
re-entering opens the file tree, guard PageJsonDialog against a missing key,
and add unit tests for the seo-block heuristics.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…solveType cast The SEO autosave snapshotted the full page block at keystroke time and persisted it after a debounce, clobbering concurrent page name/path edits written to the same block from a separate debounce (and vice-versa). Resolve both writes at fire time against the freshest decofile (latestRef) so each is a read-modify-write rather than a stale snapshot; useDebouncedSaveBlock now accepts a fire-time builder for this. Also guard the unchecked `as string` cast on __resolveType in findSiteSeoEntry with a typeof check. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
2 issues found across 8 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
…O entries Address PR review (cubic-dev-ai): - useDebouncedSaveBlock now clears its pending debounce timer on unmount so a save can't fire against a torn-down editor. - resolveSeoTarget validates that the page block and its `seo` are plain objects before spreading them into the saved payload; add an isPlainObject guard and reuse it across findSiteSeoEntry/inferSeoResolveType. Covered by new tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Derive page and site SEO resolveTypes from live page/site JSON Schema unions instead of hardcoding SeoV2, and add an SEO type selector when the schema exposes multiple variants. Co-authored-by: Cursor <cursoragent@cursor.com>
Use fire-time decofile merges for SeoEditor/SeoSheet, flush pending saves on close, drive schema from active __resolveType with site type options, validate block file paths, restrict preview images to https, and route Preview CMS SEO through SeoSheet instead of inline editing. Co-authored-by: Cursor <cursoragent@cursor.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.
What is this contribution about?
Brings the deco.cx SEO and JSON viewer experiences into Studio's CMS. The Content tab gains an SEO section for editing the site default SEO, plus a two-pane page-SEO editor (form on the left, live previews on the right across Google, Facebook, X, LinkedIn, WhatsApp, Telegram, Slack and Discord), where page previews layer the site default behind page overrides to show what actually renders. "View JSON" now opens the page's block file in the code view, and SEO is also reachable from the Preview tab's
…menu and the sections editor header (with an "Edit default SEO" shortcut). Also includes polish: colorized/typed file-tree icons with a proper folder icon, acredit-card-searchSEO icon, and a fix for image/file widget inputs being clipped by anoverflow-hidden.How to Test
Migration Notes
None.
Review Checklist
Summary by cubic
Adds a schema-driven SEO editor with live, multi-platform previews and a “View JSON” viewer. Resolves SEO types from the manifest, unifies the SEO editor across entry points, and hardens autosave and preview/file safety.
New Features
/.deco/blocks/<key>.json) and colorized file/folder icons.Bug Fixes
__resolveTypeand site type options; guard__resolveTypeand malformed SEO/page entries to avoid crashes.Written for commit 5d56025. Summary will update on new commits.