Skip to content

fix(content-editor): declare contentCollection/contentItem in route search schemas - #7154

Merged
yuriassuncx merged 1 commit into
mainfrom
fix/site-editor-content-deeplink
Sep 11, 2026
Merged

yuriassuncx merged 1 commit into
mainfrom
fix/site-editor-content-deeplink

Conversation

@yuriassuncx

@yuriassuncx yuriassuncx commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Bug

The Blog Manager's "Editar no Studio ↗" button redirects to
?virtualmcpid=…&main=content&contentCollection=posts&contentItem=<blockKey>
expecting the content editor to open on that exact post — instead it lands on
an empty/generic content editor (attachments 2 vs 3 in the report).

Root cause

#7151 added the contentCollection/contentItem read + selection logic
inside ContentBrowser (useSearch({ strict: false })), but neither route
that can host it — the unified-chat route (/$org/$taskId) nor the agents
route (/$org/agents/{-$panel}) — declared those two keys in their
validateSearch schema.

TanStack Router validates search params per-route and strips any key the
matched route's schema doesn't declare
before the component ever reads it.
So the params were dropped in-flight and ContentBrowser always saw
contentCollection: undefined, falling back to the generic Pages view —
reproducing exactly the bug #7151 was meant to fix.

Fix

Factored the content-editor search params (storefront "." deep-link +
contentCollection/contentItem) into one content-search-params.ts module,
spread into both route schemas that can render ContentBrowser. A future
param the browser reads now can't silently be dropped by one route and not
the other.

Note on the second reported issue

The "Ver visualização" (post preview) button was also reported as
not-clickable. That's already fixed on main by #7150 (derive preview
route from decofile Page blocks) and #7152 (stop gating the button on
unrelated publish-readiness fields) — both merged today, just not yet
deployed to studio.decocms.com. Not reproducible against current main;
no additional change needed.

Testing

  • bun test apps/web/src — 3357 pass / 110 fail, identical to main
    baseline (the 110 are pre-existing pt-BR locale-formatting failures,
    unrelated to this change).
  • bun run check (apps/web) — same error count as main baseline (1983,
    all pre-existing @decocms/ui unbuilt-package resolution errors).

Co-Authored-By: Claude Opus 5 (1M context) [email protected]

🤖 Generated with Claude Code


Summary by cubic

Fixes the Blog Manager's "Editar no Studio" deep-link so the content editor opens on the selected post instead of a generic empty editor.

  • The contentCollection/contentItem search params were stripped by TanStack Router because the hosting routes didn't declare them in their validateSearch schemas.
  • Declares all content-editor search params once in content-search-params.ts and spreads them into both route schemas that render ContentBrowser.
  • The reported preview button issue is already fixed on main and not reproducible here.

Written for commit 95a30d0. Summary will update on new commits.

Review in cubic

…earch schemas

#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]>
@github-actions github-actions Bot added the claude PR authored by a coding agent label Sep 11, 2026
@yuriassuncx
yuriassuncx merged commit d0e02e4 into main Sep 11, 2026
34 checks passed
@yuriassuncx
yuriassuncx deleted the fix/site-editor-content-deeplink branch September 11, 2026 02:24
decocms Bot pushed a commit that referenced this pull request Sep 11, 2026
PR: #7154 fix(content-editor): declare contentCollection/contentItem in route search schemas
Bump type: patch

- decocms (apps/api/package.json): 4.353.2 -> 4.353.3
- @decocms/native (apps/native/package.json): 4.353.2 -> 4.353.3

Deploy-Scope: web
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude PR authored by a coding agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant