feat(studio): wire editor draft and publish flows#13
Conversation
There was a problem hiding this comment.
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.
Once credits are available, reopen this pull request to trigger a review.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9c6e0af274
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
The author of this PR is on the CodeRabbit Free Plan. In order to use the Chat feature, please upgrade the PR author to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. |
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughAdds routed-document support: new contract types and Zod schemas, deterministic schema-hash capability resolver, a Document Route HTTP API, version-diff logic, bootstrap integration to populate optional Changes
Sequence DiagramssequenceDiagram
participant UI as ContentDocumentPage
participant API as DocumentRouteAPI
participant Server as DocumentRoute Server
participant Auth as AuthService
UI->>API: loadDraft(documentId, locale)
API->>Server: GET /api/v1/content/<id>?draft=true (x-mdcms-project/env/locale)
Server-->>API: 200 ContentDocumentResponse
API-->>UI: Draft data
UI->>UI: User edits -> debounce auto-save
UI->>API: updateDraft(documentId, payload)
alt cookie auth
API->>Auth: GET /api/v1/auth/session (credentials: include)
Auth-->>API: CSRF token
API->>Server: PUT /api/v1/content/<id>?draft=true (with x-mdcms-csrf-token, x-mdcms-schema-hash)
else token auth
API->>Server: PUT /api/v1/content/<id>?draft=true (with Authorization: Bearer <token>)
end
Server-->>API: Updated document
API-->>UI: Persisted document
sequenceDiagram
participant Loader as StudioLoader
participant Config as LocalConfig
participant Resolver as SchemaResolver
participant Runtime as RemoteRuntime
Loader->>Config: read authored config (project/environment)
Loader->>Resolver: resolveStudioDocumentRouteSchemaCapability(config)
Resolver-->>Loader: { canWrite: true, schemaHash } | { canWrite: false, message }
Loader->>Runtime: mount remote runtime (mountContext includes documentRoute)
Runtime-->>Loader: mounted
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fdf0648ee2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
packages/studio/src/lib/runtime-ui/components/ui/dialog.tsx (1)
92-92: Remove redundantdata-slotat Line 92.
DialogPortalalready setsdata-slot="dialog-portal"internally, so passing it again is unnecessary.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/studio/src/lib/runtime-ui/components/ui/dialog.tsx` at line 92, Remove the redundant data-slot prop from the DialogPortal usage in components/ui/dialog.tsx: locate the JSX element DialogPortal (the line with <DialogPortal data-slot="dialog-portal" forceMount={forceMount}>) and delete the data-slot="dialog-portal" attribute so DialogPortal relies on its internal data-slot; keep the forceMount prop as-is.packages/studio/src/lib/runtime-ui/pages/content-document-page.tsx (1)
1-1: The@ts-nocheckdirective disables type safety for this entire file.This file implements complex state management and API orchestration where type checking would catch many potential issues. Consider removing the directive and resolving the underlying type errors, or document why it's necessary (e.g., incompatible third-party types, work-in-progress).
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/studio/src/lib/runtime-ui/pages/content-document-page.tsx` at line 1, Remove the top-level "// `@ts-nocheck`" and fix the real typing issues in this file instead of disabling checking: add proper TypeScript types for the React component export (ContentDocumentPage), its props/state, and for any API helpers such as loadDocument/updateDocument/fetchDocument (or similarly named functions and hooks used inside the component), annotate responses and event handlers, and update useEffect/useState generics to eliminate errors; if a narrow suppression is absolutely required, replace the file-level directive with targeted // `@ts-ignore` or typed any casts on the specific problematic lines and add a brief comment explaining why (e.g., third-party type mismatch) so type-checking remains enabled for the rest of the file.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/studio/src/lib/runtime-ui/components/ui/dialog.tsx`:
- Around line 82-94: Remove the unnecessary SSR check that tests typeof document
=== "undefined" and always render the portal branch; specifically delete the
conditional block and ensure the component unconditionally returns the
DialogPortal element containing <DialogOverlay forceMount={forceMount} /> and
{content} (keep existing props like forceMount and data-slot). This removes dead
code in the client component while preserving DialogPortal, DialogOverlay,
forceMount and content usage.
---
Nitpick comments:
In `@packages/studio/src/lib/runtime-ui/components/ui/dialog.tsx`:
- Line 92: Remove the redundant data-slot prop from the DialogPortal usage in
components/ui/dialog.tsx: locate the JSX element DialogPortal (the line with
<DialogPortal data-slot="dialog-portal" forceMount={forceMount}>) and delete the
data-slot="dialog-portal" attribute so DialogPortal relies on its internal
data-slot; keep the forceMount prop as-is.
In `@packages/studio/src/lib/runtime-ui/pages/content-document-page.tsx`:
- Line 1: Remove the top-level "// `@ts-nocheck`" and fix the real typing issues
in this file instead of disabling checking: add proper TypeScript types for the
React component export (ContentDocumentPage), its props/state, and for any API
helpers such as loadDocument/updateDocument/fetchDocument (or similarly named
functions and hooks used inside the component), annotate responses and event
handlers, and update useEffect/useState generics to eliminate errors; if a
narrow suppression is absolutely required, replace the file-level directive with
targeted // `@ts-ignore` or typed any casts on the specific problematic lines and
add a brief comment explaining why (e.g., third-party type mismatch) so
type-checking remains enabled for the rest of the file.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2de36815-1bb7-4604-af14-5fa22c45130e
📒 Files selected for processing (23)
.gitignorepackages/shared/src/lib/contracts/extensibility.test.tspackages/shared/src/lib/contracts/extensibility.tspackages/studio/README.mdpackages/studio/package.jsonpackages/studio/src/index.tspackages/studio/src/lib/dev-runtime-watch.test.tspackages/studio/src/lib/document-route-api.test.tspackages/studio/src/lib/document-route-api.tspackages/studio/src/lib/document-route-schema.test.tspackages/studio/src/lib/document-route-schema.tspackages/studio/src/lib/document-shell.tspackages/studio/src/lib/document-version-diff.test.tspackages/studio/src/lib/document-version-diff.tspackages/studio/src/lib/remote-studio-app.test.tspackages/studio/src/lib/request-auth.tspackages/studio/src/lib/runtime-ui/components/ui/dialog.tsxpackages/studio/src/lib/runtime-ui/pages/content-document-page.test.tsxpackages/studio/src/lib/runtime-ui/pages/content-document-page.tsxpackages/studio/src/lib/studio-loader.test.tspackages/studio/src/lib/studio-loader.tspackages/studio/src/lib/studio.test.tspackages/studio/src/lib/studio.ts
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Summary
Test Plan
Summary by CodeRabbit
New Features
Documentation
Bug Fixes
Tests
Chores