Skip to content

[WIKI-632] chore: add extended document editor props#7783

Merged
pushya22 merged 3 commits intopreviewfrom
chore/extended-props
Sep 18, 2025
Merged

[WIKI-632] chore: add extended document editor props#7783
pushya22 merged 3 commits intopreviewfrom
chore/extended-props

Conversation

@1akhanBaheti
Copy link
Member

@1akhanBaheti 1akhanBaheti commented Sep 12, 2025

Description

This PR adds an extended document editor type.

Type of Change

  • Code refactoring

Summary by CodeRabbit

  • New Features
    • Added an optional extendedDocumentEditorProps to the collaborative document editor, page renderer, and related hooks to support extended configuration and integrations.
    • Enables passing advanced editing/display options without changing defaults; backward compatible—existing behavior unchanged unless the new prop is provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 12, 2025

Note

Other AI code review bot(s) detected

CodeRabbit 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.

Walkthrough

Adds an optional extendedDocumentEditorProps prop to CollaborativeDocumentEditor and PageRenderer, threads it into useCollaborativeEditor via TCollaborativeEditorHookProps, and changes an import to a type-only import. No runtime behavior changes.

Changes

Cohort / File(s) Summary
Document editor components
packages/editor/src/core/components/editors/document/collaborative-editor.tsx, packages/editor/src/core/components/editors/document/page-renderer.tsx
Add optional extendedDocumentEditorProps prop; CollaborativeDocumentEditor destructures and forwards it to useCollaborativeEditor; PageRenderer accepts it and import updated to import type.
Hook/types update
packages/editor/src/core/types/hook.ts
TCollaborativeEditorHookProps Pick now includes extendedDocumentEditorProps, expanding the hook's typed inputs.

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

🛠️refactor

Suggested reviewers

  • aaryan610
  • Palanikannan1437
  • sriramveeraghanta

Pre-merge checks (2 passed, 1 inconclusive)

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description Check ❓ Inconclusive The current description gives a very brief high-level summary and marks the Type of Change, but it omits several template sections (notably Test Scenarios and References) and lacks detail about which files were changed, the rationale, and verification steps, making the description too minimal and somewhat vague to fully evaluate the PR. Please expand the Description to list the key changes (files modified, added props/types) and the rationale, add Test Scenarios with steps and expected outcomes to show how the change was verified, and include References to the related issue or design notes; also confirm the appropriate Type of Change checkbox.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title "[WIKI-632] chore: add extended document editor props" succinctly and accurately summarizes the primary change (adding extended document editor props and related type updates) and follows the repo's conventional-commit and ticketing style, so it is clear and relevant to the changeset.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Poem

I hop a prop from page to hook,
Soft trailing types in every nook.
No logic stirred, just gentle threads,
A rabbit’s nudge where typing treads. 🐇✨

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.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

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 details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ac964a5 and a995861.

📒 Files selected for processing (1)
  • packages/editor/src/core/components/editors/document/collaborative-editor.tsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/editor/src/core/components/editors/document/collaborative-editor.tsx
⏰ 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)
  • GitHub Check: Build and lint web apps
  • GitHub Check: Analyze (javascript)
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/extended-props

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@1akhanBaheti 1akhanBaheti self-assigned this Sep 12, 2025
@1akhanBaheti 1akhanBaheti changed the title chore: add extended document editor props [WIKI-632] chore: add extended document editor props Sep 12, 2025
@makeplane
Copy link

makeplane bot commented Sep 12, 2025

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

@1akhanBaheti 1akhanBaheti marked this pull request as ready for review September 12, 2025 07:43
Copilot AI review requested due to automatic review settings September 12, 2025 07:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 extendedDocumentEditorProps property 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 prop extendedDocumentEditorProps

Declared 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

📥 Commits

Reviewing files that changed from the base of the PR and between 9ffc30f and ac964a5.

📒 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.

@pushya22 pushya22 merged commit d5c3c0c into preview Sep 18, 2025
6 of 7 checks passed
@pushya22 pushya22 deleted the chore/extended-props branch September 18, 2025 14:41
yarikoptic pushed a commit to yarikoptic/plane that referenced this pull request Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants