Repository navigation
fix(content-editor): declare contentCollection/contentItem in route search schemas - #7154
Merged
Merged
Conversation
…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]>
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
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.
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
#7151added thecontentCollection/contentItemread + selection logicinside
ContentBrowser(useSearch({ strict: false })), but neither routethat can host it — the unified-chat route (
/$org/$taskId) nor the agentsroute (
/$org/agents/{-$panel}) — declared those two keys in theirvalidateSearchschema.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
ContentBrowseralways sawcontentCollection: undefined, falling back to the generic Pages view —reproducing exactly the bug
#7151was meant to fix.Fix
Factored the content-editor search params (storefront "." deep-link +
contentCollection/contentItem) into onecontent-search-params.tsmodule,spread into both route schemas that can render
ContentBrowser. A futureparam 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
mainby#7150(derive previewroute from decofile Page blocks) and
#7152(stop gating the button onunrelated publish-readiness fields) — both merged today, just not yet
deployed to
studio.decocms.com. Not reproducible against currentmain;no additional change needed.
Testing
bun test apps/web/src— 3357 pass / 110 fail, identical tomainbaseline (the 110 are pre-existing pt-BR locale-formatting failures,
unrelated to this change).
bun run check(apps/web) — same error count asmainbaseline (1983,all pre-existing
@decocms/uiunbuilt-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.
contentCollection/contentItemsearch params were stripped by TanStack Router because the hosting routes didn't declare them in theirvalidateSearchschemas.content-search-params.tsand spreads them into both route schemas that renderContentBrowser.mainand not reproducible here.Written for commit 95a30d0. Summary will update on new commits.