Skip to content

fix(content-editor): honor contentCollection/contentItem deep-link params - #7151

Merged
yuriassuncx merged 1 commit into
mainfrom
fix/blog-content-editor-deep-link
Sep 11, 2026
Merged

yuriassuncx merged 1 commit into
mainfrom
fix/blog-content-editor-deep-link

Conversation

@yuriassuncx

@yuriassuncx yuriassuncx commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Clicking "Editar no Studio ↗" in the Blog Manager doesn't land on the
post being edited — it opens the generic Posts list instead.

Root cause

The Blog Manager's redirect (decocms/spire-agent PR
#11, merged
2026-07-14) navigates to:

{studioBase}/{org}/{taskId}?virtualmcpid=...&main=content&contentCollection=posts&contentItem=collections/blog/posts/<file>.json

ContentBrowser never read contentCollection/contentItem. This
support was written once, in #4302 — but that PR is stale (based on a
pre-rename apps/mesh/... path that no longer exists after the
mesh→web rename) and bundles two unrelated features, so it never
merged.

Fix

Extracted just the deep-link piece and reapplied it to the current
apps/web/... layout: seed activeCollection/selection from
useSearch({ strict: false }) via lazy useState initializers,
mirroring the existing storefront "." deep-link pattern
(deepLinkPage) already in this file. Read once — normal navigation
takes over from there. Older Studio builds without this change simply
ignore the extra params (unaffected — same graceful-degradation the
spire-agent side already relies on).

Test plan

  • tsc --noEmit (apps/web) clean
  • Click "Editar no Studio" from a Blog Manager post → lands on that
    exact post in the content editor (needs a live deploy to verify)

Related

  • Does NOT touch feat(mesh): blog product-block editor + post publication status #4302 — that PR's product-string-editor + post-status
    work is unrelated and still needs its own rebase/decision.
  • Companion investigation also found a real Checklist-block data
    contract bug in spire-agent causing a Minified React error #31
    crash when opening posts with a checklist section — fixed separately
    in decocms/spire-agent.

Co-Authored-By: Claude Sonnet 5 [email protected]


Summary by cubic

Fixes the content editor so Blog Manager’s “Editar no Studio” link opens the exact post instead of landing on the generic Posts list.

ContentBrowser now reads the contentCollection and contentItem query params once on mount and uses them to seed the active collection and selection. Normal navigation takes over afterward, and older Studio builds ignore the extra params without any change in behavior.

Written for commit e661516. Summary will update on new commits.

Review in cubic

…rams

The Blog Manager's "Editar no Studio" redirect (spire-agent PR #11,
merged 2026-07-14) navigates to
`?virtualmcpid=...&main=content&contentCollection=posts&contentItem=<blockKey>`
expecting the content editor to land on that exact post. Studio's
ContentBrowser never read those params — added in the still-open,
now-stale PR #4302 (based on a pre-rename `apps/mesh` path that no
longer exists) — so every "Editar no Studio" click just opened the
generic Posts list instead of the post itself.

Seed `activeCollection`/`selection` from `useSearch()` once via lazy
useState initializers, mirroring the existing storefront "." deep-link
pattern (`deepLinkPage`) already in this file. Older Studio builds
without this simply ignore the extra params (unaffected).

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@yuriassuncx
yuriassuncx merged commit c90c1ce into main Sep 11, 2026
34 checks passed
@yuriassuncx
yuriassuncx deleted the fix/blog-content-editor-deep-link branch September 11, 2026 00:03
decocms Bot pushed a commit that referenced this pull request Sep 11, 2026
PR: #7151 fix(content-editor): honor contentCollection/contentItem deep-link params
Bump type: patch

- decocms (apps/api/package.json): 4.353.0 -> 4.353.1
- @decocms/native (apps/native/package.json): 4.353.0 -> 4.353.1

Deploy-Scope: web
yuriassuncx added a commit that referenced this pull request Sep 11, 2026
…earch schemas (#7154)

#7151 added contentCollection/contentItem read + selection logic in
ContentBrowser (Blog Manager's "Editar no Studio" deep-link), but
neither the unified-chat route nor the agents route validateSearch
schema declared them. TanStack Router strips any search param a
route's validateSearch doesn't declare before the component ever sees
it via useSearch — so the redirect landed on an empty content editor
instead of the selected post, reproducing exactly what #7151 was
meant to fix.

Factor the content-editor search params (storefront "." deep-link +
Blog Manager deep-link) into one `content-search-params.ts` module
spread into both route schemas, so a future param ContentBrowser reads
can't silently be dropped by one route and not the other again.

The reported "Ver visualização" preview button issue was already
fixed on main by #7150 (route derivation) + #7152 (stop gating on
unrelated fields) earlier today — not reproducible against current
main, just not yet deployed to studio.decocms.com.

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant