Repository navigation
feat(publish): one before/after publish dialog for Fast Preview and sandbox - #7792
Merged
Merged
Conversation
…andbox Coding sessions now publish through the same dialog as Fast Preview: change cards, a version note and a before/after review pane. The sandbox side reads its changes from the daemon (base…head plus the working tree) and renders the "after" frame on the sandbox preview. The visual review is no longer a project setting — it is the only publish surface, so the compact popover, the publishVisualReview metadata field and the legacy commit-message dialog are removed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
- Sandbox: only offer Discard for working-tree paths; committed changes cannot be reverted by the daemon and showed a false success. - Sandbox: publish re-reads the diff and refuses when it no longer matches what was shown (the agent can edit the working tree without moving HEAD). - A failed background refetch no longer replaces a loaded dialog with the load error; re-provisioning runs at most once per opening. - Fetch the base diff for legacy daemons without aheadOfBase and for unpushed commits. - Narrow screens stack the review pane above the list instead of hiding it. - "In production" labels only for main/master bases. - Read the last previewed page when the dialog opens, not on every header render; drop the unused orgId prop and stale "popover" docs. - Remove the now-unused /git/suggest-commit route, its library and the native intercept; judge-review keeps its shared context builder. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Stable 1.99 deprecates `Atomic::fetch_update` (renamed `try_update`) and flags the `#[must_use]` that async-trait <0.1.92 emits as double_must_use, so `cargo clippy -D warnings` fails for any PR touching apps/native. Rename the three call sites and bump async-trait to 0.1.92, which drops the redundant attribute. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Code files (the "Other" group) only offered the Code tab, which made sense for Fast Preview, where code never changes. A sandbox already runs the changed code, so render those cards too: live site against the sandbox preview, starting on the home page with an editable path. A new or removed code file no longer shows the "didn't exist" placeholders, since the page itself still exists on both sides. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Opened before the editor's decofile loaded, a page card has no path until its body lands. The compare pane froze that empty path in state, and once the path arrived the page was no longer editable, leaving "Type a page address" with no field to type in. The path and view now follow the change until the reviewer types a path or picks a tab. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Every card switch remounted the compare pane, and every tab switch unmounted a frame, so each one reloaded a full storefront page. Panes now stay mounted and hidden: the selected card, the recently visited ones and the next in the list (up to four, so at most eight frames) load once, and switching cards or tabs is instant. Each pane also keeps its own path, tab and device. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
decocms Bot
pushed a commit
that referenced
this pull request
Oct 8, 2026
PR: #7792 feat(publish): one before/after publish dialog for Fast Preview and sandbox Bump type: minor - decocms (apps/api/package.json): 4.453.1 -> 4.454.0 - @decocms/native (apps/native/package.json): 4.453.1 -> 4.454.0 - @decocms/shared (packages/shared/package.json): 0.139.0 -> 0.140.0 Deploy-Scope: both
tlgimenes
added a commit
that referenced
this pull request
Oct 8, 2026
…ship follows the org_sites link Brings in #7796 (org_sites.project_id link, immutable site slugs) and main. Hosted switch: - ownedProjectSite(orgSites, projectId, orgId) reads the project's org_sites link (getByProject) instead of metadata.siteSlug. hosted routes, decofile scope and the sandbox-less draft status use it. - claim-site.ts: a project's site is linked once (linkProjectSite): a slug no org owns is claimed first (still refused for deco.cx sites and slugs another org's project names), then linked. Tombstoned (reserved) slugs, another org's, another project's, or a second slug for a linked project are refused. - Admin backfill links v8 projects (report: linked / alreadyLinked / refused / ambiguous); several projects of one org naming one slug are ambiguous. - e2e: a slug change is refused and hosted keys stay on the linked site. Conflicts: - publish UI: main (#7792) replaced cms-publish-popover.tsx with publish-dialog.tsx; the hosted changes (no review mode, no Request approval, hosted publish action) moved into publish-dialog.tsx. - main removed the project "git" tab; kept hosted's "releases" tab only. - sandbox-proxy.ts: main dropped /git/suggest-commit; judge-review keeps the hosted-aware fastPreviewStatus/fastPreviewDiff backfill. - create.ts: project creation goes through claimProjectSite (claim + link). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
tlgimenes
added a commit
that referenced
this pull request
Oct 15, 2026
…uction build Run against the production web build (vite preview, as CI does), four deco serve tests failed and others timed out at random. None is a product bug: - Changes: the change card names its status in the icon's title since #7792 ("Edited" is not visible text). Assert it with getByTitle. - Outdated 8.1.x server: the protocol handler gzips larger answers, and the stub's 1.0 rewrite read the gzip bytes as text and resent them with Content-Encoding: gzip, so Chromium failed with ERR_CONTENT_DECODING_FAILED and the page said "Another program is using localhost". The stub now decodes the answer and sends it plain. - Localhost: picking it closes the drafts menu (edd6986), so "Connected" was only seen when the connection beat the close animation. The test waits for the menu to close and reopens it. - Stub close: server.close() waits for idle keep-alive connections, which a polling editor never leaves, so a test hung in `finally` until its 120 s timeout. Close every connection first. - Off-machine link: the guide's warning is checked with the 30 s timeout the other page loads use, not the 5 s default. deco serve spec, production build, --repeat-each=4: 40/40. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu
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?
Publishing looked different depending on the session runtime. Fast Preview opened the content-first popover, with change cards, a version note and an optional before/after review. Coding sessions with a sandbox opened a separate dialog with a commit-message form, Description/Changes tabs and a raw file diff. Both ran the same publish sequence (
publish-flow.ts), but they showed it differently.This PR gives both runtimes one publish surface: the fullscreen before/after review.
Sandbox sessions use the shared dialog.
HeaderActionsmountsPublishDialog, the formerCmsPublishPopover, in place of the legacy dialog. "Review & Publish" opens it in publish mode and "Submit for review" opens it in review mode. A blocked gate switches it to review mode through "Request approval".Sandbox changes come from the daemon. The daemon has no changed-file manifest, so
useCmsPublishStatebuilds the cards from the publish diff instead.fetchPublishDiffcombines base…head with the working-tree diff, because a sandbox publish commits the working tree too.aheadOfBase.Sandbox publishes are checked against what was shown. The agent can edit the working tree without moving HEAD. So a sandbox publish re-reads the diff and refuses with "branch changed" if its
reviewDiffSignatureno longer matches the confirmed one, before anything is pushed.Discard is offered only where it works. The daemon's
/git/discardrestores working-tree paths only. In a sandbox, Discard and "Discard all" are hidden for committed changes instead of reporting a false success.The "after" frame renders on the sandbox preview.
CompareDraftis either Fast Preview's?__draft=pointer or the sandbox preview URL.compareDraftUrlrenders the same path and query on the sandbox dev server, for pages and for isolated global sections. "Before" is still the live site. In a sandbox, code changes (the "Other" group) get the same comparison, starting on the home page with an editable path. Fast Preview never changes code, so there those cards keep only the Code tab.The visual review is the only mode. The
publishVisualReviewproject setting, its settings toggle, the compact 420px popover, the narrow-viewport modal and the inline expand-diff card mode are removed. On narrow screens the review pane, including its Code tab, is stacked above the change list.Labels and retry.
mainandmasterbases; other bases get plain "Publish N changes".QueryErrorResetBoundary, so "Retry" refetches failed queries instead of rethrowing the cached error.Removed as unused:
PublishDialog,publish-label.ts,shouldUseBaseDiffand thepublishVisualReviewschema field (tool contracts regenerated), plus their i18n keys.fetchSuggestCommitMessage, the API/git/suggest-commitroute andsuggest-commit-message.ts, and the nativesuggest-commitintercept. Judge-review's shared context builder moved toapps/api/src/lib/git-change-context.ts.Native clippy on Rust 1.99. Stable 1.99 deprecates
Atomic::fetch_updateand flags async-trait's generated#[must_use], which failedrust-checksfor any PR touchingapps/native. The three call sites now usetry_update, and async-trait is bumped to 0.1.92, whose release fixes the lint.Behavior changes for sandbox sessions:
branch → main · squash-mergeline is no longer shown.blocks.gen.json,tailwind.css,meta.gen.json) are not listed as cards. They still publish and are reverted by "Discard all".Known gaps:
How did you verify your code works?
apps/native:cargo clippy --workspace --exclude deco --all-targets -- -D warningsandcargo fmt --checkpass on Rust 1.99. The Tauri crate needs CI-fetched binaries, so it is left to CI.bun run verifypasses: fmt, oxlint and knip are clean, and 10353 tests pass with 0 failures.tsc --noEmitpasses inapps/web,apps/apiandpackages/shared.publish-flow.test.ts: a sandbox publish stops before pushing when the working tree changed under the same head, and pushes when it still matches what was shown.sandbox-git-api.test.ts→fetchPublishDiff:headSha.sandbox-git-api.test.ts→mayHaveCommitsToPublish: commits ahead, unpushed commits, and a daemon that omitsaheadOfBase.cms-publish-compare-path.test.ts→canRenderCompare: content renders in both runtimes, code only on a sandbox, and nothing renders without a live site.cms-publish-compare-path.test.ts→compareDraftUrl:__draft.props, on the sandbox origin.apps/api/src/lib/git-change-context.test.tskeeps the coverage of the moved judge-review helpers.suggest-commitintercept) was not compiled locally because no Rust toolchain was available.native.ymlruns clippy andcargo teston it.Screenshots/Demonstration
Pending: screenshots of the dialog in a Fast Preview session and in a sandbox session will be attached before merge.
How to Test
Migration Notes
None. Virtual MCP metadata schemas are
.loose(), so rows that still storepublishVisualReviewkeep validating and the key is ignored.Review Checklist
🤖 Generated with Claude Code