[WIKI-632] chore: add extended document editor props#7783
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughAdds an optional Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor App as App/Parent
participant PR as PageRenderer
participant CDE as CollaborativeDocumentEditor
participant Hook as useCollaborativeEditor
App->>PR: Render({ extendedDocumentEditorProps? })
PR->>CDE: Render({ extendedDocumentEditorProps? })
CDE->>Hook: init({ dragDropEnabled, realtimeConfig, serverHandler, user, extendedDocumentEditorProps? })
Note right of Hook: Receives optional extendedDocumentEditorProps (type-only change)
Hook-->>CDE: returns editor instance
CDE-->>PR: editor ready
PR-->>App: render page with editor
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks (2 passed, 1 inconclusive)❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
Poem
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
✨ Finishing touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Linked to Plane Work Item(s) This comment was auto-generated by Plane |
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for extended document editor properties by introducing a new extendedDocumentEditorProps property to the collaborative document editor component. The change enables passing additional configuration properties through the collaborative editor hooks and components.
- Added
extendedDocumentEditorPropsproperty to the collaborative editor hook type - Updated the PageRenderer component to accept and type the new extended props
- Threaded the new property through the CollaborativeDocumentEditor component
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/editor/src/core/types/hook.ts | Added extendedDocumentEditorProps to the collaborative editor hook props type |
| packages/editor/src/core/components/editors/document/page-renderer.tsx | Added extended props parameter and type import to the PageRenderer component |
| packages/editor/src/core/components/editors/document/collaborative-editor.tsx | Destructured and passed through the new extended props in the collaborative editor |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
packages/editor/src/core/components/editors/document/collaborative-editor.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
packages/editor/src/core/components/editors/document/collaborative-editor.tsx (1)
90-102: Pass extendedDocumentEditorProps down to PageRenderer for API consistency.PageRenderer now accepts extendedDocumentEditorProps but it isn’t provided here. Recommend threading it now to avoid a dead prop surface.
Apply:
<PageRenderer aiHandler={aiHandler} bubbleMenuEnabled={bubbleMenuEnabled} displayConfig={displayConfig} documentLoaderClassName={documentLoaderClassName} editor={editor} editorContainerClassName={cn(editorContainerClassNames, "document-editor")} id={id} isTouchDevice={!!isTouchDevice} isLoading={!hasServerSynced && !hasServerConnectionFailed} tabIndex={tabIndex} flaggedExtensions={flaggedExtensions} disabledExtensions={disabledExtensions} + extendedDocumentEditorProps={extendedDocumentEditorProps} />If this is intentionally hook-only, consider removing the prop from PageRenderer until it’s needed.
packages/editor/src/core/components/editors/document/page-renderer.tsx (1)
17-17: Remove or forward unused propextendedDocumentEditorPropsDeclared in Props but not used inside PageRenderer — either forward it to the child components (e.g., EditorContainer / EditorContentWrapper) if needed or remove it from the Props to avoid expanding the public API.
Location: packages/editor/src/core/components/editors/document/page-renderer.tsx
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
packages/editor/src/core/components/editors/document/collaborative-editor.tsx(2 hunks)packages/editor/src/core/components/editors/document/page-renderer.tsx(2 hunks)packages/editor/src/core/types/hook.ts(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
packages/editor/src/core/types/hook.ts (1)
packages/editor/src/core/types/editor.ts (1)
ICollaborativeDocumentEditorProps(175-184)
packages/editor/src/core/components/editors/document/page-renderer.tsx (1)
packages/editor/src/ce/types/editor-extended.ts (1)
ICollaborativeDocumentEditorPropsExtended(5-5)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build and lint web apps
🔇 Additional comments (3)
packages/editor/src/core/components/editors/document/collaborative-editor.tsx (1)
47-48: LGTM on threading extendedDocumentEditorProps into the hook.Prop is correctly surfaced and forwarded to useCollaborativeEditor.
Also applies to: 75-76
packages/editor/src/core/types/hook.ts (1)
54-57: Type surface update looks correct.Including extendedDocumentEditorProps in TCollaborativeEditorHookProps aligns with the new editor prop; non-breaking since it’s optional.
Confirm the hook implementation actually reads this field (or add a TODO) to avoid an unused config path.
packages/editor/src/core/components/editors/document/page-renderer.tsx (1)
8-8: Good use of type-only import.Prevents runtime bundle impact.
Description
This PR adds an extended document editor type.
Type of Change
Summary by CodeRabbit