feat(framework-editor): Save as Draft / Save and Commit (FRAME-4)#3129
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
cubic analysis
No issues found across 4 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Linked issue analysis
Linked issue: FRAME-4: Framework Editor - Requirements->Description
| Status | Acceptance criteria | Notes |
|---|---|---|
| ✅ | Render three buttons labeled: Cancel, Save as Draft, Save and Commit | The toolbar was updated to show the three buttons and the tests assert each button is present when dirty. |
| ✅ | Cancel discards uncommitted edits (unchanged behaviour) | Cancel is wired to the existing handleCancel from useRequirementChangeTracking and the PR does not change that behavior. |
| ✅ | Save as Draft persists edits without opening the publish dialog | Save as Draft calls handleCommit (the existing persist action) and tests verify the commit runs and the publish dialog remains closed. |
| ✅ | Save and Commit persists edits then opens the Publish Version dialog only when the save succeeds (and stays closed on failure) | A new handleSaveAndCommit awaits handleCommit and opens PublishVersionDialog only if the save returned success. Tests cover both the success path (opens publish) and failure path (stays closed). |
| Accumulation behavior: repeated Save as Draft calls accumulate and the final Save and Commit publishes the accumulated changes (e.g. “5 drafts then commit = 6 changes committed”) | The implementation and tests show that Save as Draft persists edits and Save and Commit publishes after a successful save, which supports the interpreted accumulation behavior, but there is no explicit test that simulates multiple draft saves and verifies the published version contains all accumulated changes. |
Replaces the single "Commit Changes" button with the three buttons Joe asked for (FRAME-4, interpretation A): - Cancel — discard the uncommitted grid edits (unchanged). - Save as Draft — persist edits to the live templates without publishing (the previous "Commit Changes" behaviour). - Save and Commit — persist edits, then open the Publish Version dialog so the accumulated changes go out as a new version. Publish only opens when every edit saved cleanly. handleCommit now returns whether the save succeeded so Save-and-Commit can chain the publish step safely. Reuses the existing PublishVersionDialog and useFrameworkVersions (for the next-version suggestion). Closes FRAME-4 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
b691ec6 to
bb7064b
Compare
Contributor
|
🎉 This PR is included in version 3.82.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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
Replaces the single Commit Changes button on the requirements editor with the three buttons Joe asked for: Cancel, Save as Draft, Save and Commit.
Why (FRAME-4, interpretation A)
Per Joe's confirmation of interpretation A:
This matches Joe's "5 drafts then commit = 6 changes committed": each Save-as-Draft persists edits as you go, and the final Save-and-Commit publishes a version containing everything.
Changes
FrameworkRequirementsClientPage: three-button toolbar; Save and Commit runs the save then opensPublishVersionDialog— but only if the save succeeded (so we never publish a half-saved state). ReusesuseFrameworkVersionsfor the next-version suggestion (same as the Versions tab).useRequirementChangeTracking.handleCommitnow returnsboolean(true when every edit persisted) so the publish step can be chained safely. Existing callers (onClick={handleCommit}) are unaffected.No API or DB changes — reuses the existing publish endpoint + dialog.
Testing
FrameworkRequirementsClientPage.toolbar.test.tsx(4 tests): all three buttons render when dirty; Save-as-Draft commits without opening publish; Save-and-Commit commits then opens publish; publish stays closed when the save fails.…expandable.test.tsxwith mocks for the new imports.turbo typecheck --filter=@trycompai/framework-editor: clean.Worth a quick click-through on the preview (Save as Draft, then Save and Commit → publish dialog).
🤖 Generated with Claude Code
Summary by cubic
Adds Cancel, Save as Draft, and Save and Commit to the requirements editor to match FRAME-4 (interpretation A). Save as Draft saves edits without publishing; Save and Commit saves then opens the publish dialog to release a new version.
PublishVersionDialogonly on success; usesuseFrameworkVersionsfor next-version suggestion.handleCommitnow returns a boolean to signal save success; existing callers remain compatible.Written for commit bb7064b. Summary will update on new commits.