feat(studio): ADR-0033 Phase B — draft review surface (chat → designer → generic diff)#1466
Merged
Merged
Conversation
…r → generic diff)
Closes the AI metadata-authoring loop in Studio. The framework (Phases A+C)
stages every AI change as a DRAFT; this lets a human see and review them.
plugin-chatbot:
- mapMessages detects draft envelopes ({status:'drafted', type, name} single +
apply_blueprint {drafted:[…]} batch; peels the Vercel {type:text,value}
wrapper) and lifts targets onto ChatToolInvocation.draftReview.
- ChatbotEnhanced renders a "Review N change(s)" button (onReviewDraft prop).
app-shell:
- assistantBus review channel (requestReview/requestAssistantReview);
ConsoleFloatingChatbot wires the button; a navigator in AppContent routes to
/apps/:appName/metadata/:type/:name?review=1.
- ResourceEditPage honours ?review=1: force-reloads the pending draft and opens
the review/diff.
- New DraftReviewPanel — generic, type-agnostic draft↔published structural diff
reusing LayeredDiff.computeDiffRows, so every type gets a review (object keeps
its richer per-field review).
Nothing is published — the human still clicks Publish.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
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 & why
Implements Phase B of ADR-0033 (AI-assisted metadata authoring) in Studio. The framework side (Phases A + C, merged in
objectstack-ai/framework#1529 / #1537) makes the assistant stage every change as a draft — nothing goes live until a human publishes. Until now Studio gave the human no path from the chat to the review: a tool returned{status:'drafted', …}as raw JSON, and non-object types had no draft-vs-published diff at all. This PR closes the loop.Three pieces (one cohesive flow)
mapMessagesdetects the framework's draft envelopes (single{status:'drafted', type, name}andapply_blueprint's{drafted:[{type,name}]}batch; the Vercel{type:'text',value}wrapper is peeled) and lifts the targets ontoChatToolInvocation.draftReview.ChatbotEnhancedrenders a review button (newonReviewDraftprop). Mirrors the existing HITL approve-button path.blueprint_proposedis intentionally not surfaced (no draft yet).assistantBusgains a review channel;ConsoleFloatingChatbotwires the button to it; a navigator inAppContent(which knows the app base) routes to/apps/:appName/metadata/:type/:name?review=1.ResourceEditPagehonours?review=1by force-reloading the pending draft (covers the case where the AI drafted the item after the page mounted) and opening the review/diff.DraftReviewPanelcomputes a draft↔last-published diff (added / changed / removed by key) reusingLayeredDiff'scomputeDiffRows. Surfaced as a toolbar affordance + sheet whenever a draft exists, so view / dashboard / flow finally get a real review. The object designer keeps its richer per-field review.Verification
@object-ui/plugin-chatbot+@object-ui/app-shellclean.mapMessagesdraft-detection tests (single / batch / wrapper / negative cases) — plugin-chatbot 35 green. NewDraftReviewPanel+computeDraftChangeCounttests; app-shell metadata-admin 135 green.Scope
Phase B only. Flow's graph-aware review stays deferred (the generic structural diff still shows a flow change). Nothing here publishes — the human still clicks Publish.
🤖 Generated with Claude Code