Repository navigation
feat(thread/github): split Submit for review and Publish into separate header actions - #4416
Merged
Merged
Conversation
…e header actions Replace the single "Save changes" header button with a two-action model: the primary button now always reads "Submit for review" whenever there is local work, and a dedicated green "Publish" button sits alongside it. - panel-state: dirty tree and unpushed-with-PR states now map to "Submit for review" (create-pr) instead of "Save changes" (commit-and-push) - header-actions: persistent side "Publish" button opens the dialog in a new publish-only mode; ignores an existing open PR so the diff resolves - publish-dialog: add "publish-only" intent (single green "Publish to production" button, gated by isDecoOnlyDiff); the Submit-for-review modal now shows only the Submit button; show working-tree diff when there are uncommitted changes so the diff isn't empty - sandbox-git-api: export hasGitLocalWork for the diff-selection logic - update panel-state tests for the new labels/actions Co-Authored-By: Claude Opus 4.8 <[email protected]>
…ead Save-changes flow Follow-up to the Submit-for-review / Publish split, addressing review findings: - fix(security): block direct publish when the branch has BOTH commits ahead of base AND uncommitted work. Publish squash-merges base…HEAD plus the working tree, but the deco-only gate can only inspect one diff (the daemon has no combined base→working-tree diff), so committed code could slip past the gate via a deco-only working-tree edit. Now refused with a clear tooltip. - extract shouldUseBaseDiff() and canPublishDirectly() as pure helpers in sandbox-git-api.ts and unit-test them (+ hasGitLocalWork); the safety-critical gate logic is no longer inlined in the component - remove the now-unreachable "Save changes" flow: commit-and-push action, the "publish" dialog intent, handleSaveChanges, isSaveChangesFlow branches, and the related state — every producer now emits create-pr - move showPublishSide into the panel-state descriptor (single source of truth for header state) instead of re-deriving it in header-actions; assert it in panel-state tests - collapse duplicated description copy, drop the vestigial flex wrapper and the always-false isSubmittingForReview prop on the lone PublishButton - refresh stale "Save changes" comments/doc-strings and the side-button tooltip Co-Authored-By: Claude Opus 4.8 <[email protected]>
…combined diff Replace the blanket "commit your changes first" block (mixed committed + uncommitted work) with a combined-diff gate. In publish-only mode the dialog now fetches BOTH the base…head committed diff and the working-tree diff and shows/gates their union — the full payload a direct publish squash-merges. - deco commit + uncommitted deco edit now publishes directly (was wrongly blocked), since the whole payload is deco-only - code anywhere in the payload (committed or uncommitted) is still blocked with the normal "use Submit for review" message — the gate sees committed code even when the working tree is deco-only, so the security hole stays closed - add combinePublishDiffs() pure helper; simplify canPublishDirectly() to gate the full payload; drop PUBLISH_MIXED_WORK_TOOLTIP; update unit tests Co-Authored-By: Claude Opus 4.8 <[email protected]>
decocms Bot
pushed a commit
that referenced
this pull request
Jul 9, 2026
PR: #4416 feat(thread/github): split Submit for review and Publish into separate header actions Bump type: minor - decocms (apps/mesh/package.json): 3.115.1 -> 3.116.0 Deploy-Scope: web
tlgimenes
pushed a commit
that referenced
this pull request
Jul 16, 2026
…TS.md (#4475) Mined ~300 merged PRs for the delta between the first PR proposal and the work added before merge. The dominant shape: a first draft ships the happy path, then a hardening pass (often a different engineer who takes over the branch and merges — the vibecoder→engineer handoff) adds the same categories every time. Encoded those 9 categories as an actionable first-pass checklist, each citing a real PR (#4008, #4230, #4365, #4409, #4426, #4445, #4357, #4355, #4449, #4350, #4373, #4416, #4446, #4461, #4134, #4469). Covers: variant/edge-case handling, tenant/permission scoping, concurrency & silent-data-loss, test-per-fix + invert-bug-tests + real-PG, dead-code/knip, lifecycle symmetry + state reset, kill-switch/GC/git-exclude for risky infra, input validation vs over-engineering, compile-time type-safety. Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
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.
Summary
Reworks the sandbox git header so the review/publish actions are two distinct buttons instead of one state-driven "Save changes" button.
Publishbutton sits alongside it. Opens the dialog in a new publish-only mode showing a single green Publish to production button. Still gated byisDecoOnlyDiff— code changes stay disabled with the "use Submit for review" tooltip; only.deco/(CMS) diffs can publish directly.Each header button now maps to a modal with exactly one action, instead of the old modal that showed Submit + Publish together.
Changes
panel-state.ts— dirty-tree and unpushed-with-open-PR states now returnSubmit for review(create-pr) rather thanSave changes(commit-and-push).header-actions.tsx— persistent sidePublishbutton; opens dialog withpublish-onlyintent and passesopenPullRequest={null}in that mode so the diff resolves against base/working tree correctly.publish-dialog.tsx— newpublish-onlyintent (single green button); Submit-for-review footer trimmed to just the Submit button; description copy split per mode; show the working-tree diff when there are uncommitted changes so the diff isn't empty for a freshly-edited tree.sandbox-git-api.ts— exporthasGitLocalWorkfor the diff-selection logic.panel-state.test.ts— updated the 6 cases that asserted the oldSave changes/commit-and-pushbehavior.Testing
bun run --cwd=apps/mesh check— passesbun test apps/mesh/src/web/components/thread/github/— 101 pass / 0 failbun run fmt+bun run lint— clean (0 errors)Not exercised end-to-end in the real app (requires an attached GitHub repo + running sandbox).
Notes
The old
Save changesmachinery (commit-and-pushaction,isSaveChangesFlowfooter branches,handleSaveChanges) is now unreachable but left in place; can be removed in a follow-up cleanup once the new UX is confirmed.🤖 Generated with Claude Code
Summary by cubic
Split the header into two actions: a primary Submit for review for local work and a green Publish for CMS-only publishes. Publish-only now gates on a combined base…HEAD + working-tree diff, allowing direct publish for
.deco/-only payloads (even when mixed) and blocking any code changes.publish-onlydialog intent with a single “Publish to production”, gated bycanPublishDirectlyover a combined diff viacombinePublishDiffs(allows.deco/-only; blocks any code).shouldUseBaseDiffshows the working-tree diff when dirty; otherwise uses base…head. Publish-only fetches both and unions them for gating.create-pr);showPublishSideis owned by panel-state.hasGitLocalWork; addcombinePublishDiffs; testhasGitLocalWork,shouldUseBaseDiff,canPublishDirectly, andcombinePublishDiffs; remove unreachable “Save changes” flow; update unit tests and labels.Written for commit 10fc200. Summary will update on new commits.