Skip to content

[WIKI-539] regression: editor build errors#7503

Merged
pushya22 merged 1 commit intopreviewfrom
fix/space-build
Jul 29, 2025
Merged

[WIKI-539] regression: editor build errors#7503
pushya22 merged 1 commit intopreviewfrom
fix/space-build

Conversation

@aaryan610
Copy link
Member

@aaryan610 aaryan610 commented Jul 29, 2025

Description

This PR fixes build errors related to editor.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Summary by CodeRabbit

  • Refactor
    • Unified editor file handler logic for a more streamlined file management experience in the editor.
    • Updated the notification sidebar to use a single editor component in read-only mode for consistent display of comment content.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 29, 2025

Walkthrough

This update consolidates editor file handler logic in the backend by merging separate read-only and full handler functions into a single, unified handler function. On the frontend, the notification sidebar now uses a consistent editor component in read-only mode by switching to LiteTextEditor with the appropriate prop.

Changes

Cohort / File(s) Change Summary
Editor File Handler Consolidation
apps/space/helpers/editor.helper.ts
Merged getReadOnlyEditorFileHandlers and getEditorFileHandlers into a single getEditorFileHandlers function that returns a complete handler, simplifying logic and removing the read-only variant.
Notification Card Editor Component Update
apps/web/core/components/workspace-notifications/sidebar/notification-card/content.tsx
Replaced LiteTextReadOnlyEditor with LiteTextEditor (set to editable={false}), updating both the import and the JSX usage to standardize editor rendering in read-only mode.

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant EditorHelper

    Caller->>EditorHelper: getEditorFileHandlers(args)
    EditorHelper-->>Caller: Returns unified TFileHandler object
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Suggested labels

🐛bug, ✍️editor, ready to merge

Suggested reviewers

  • prateekshourya29
  • sriramveeraghanta

Poem

In the warren where editors dwell,
A handler merged—now all is well!
Notifications read with style anew,
One function, one editor—less to review.
With every hop and every code fix,
The rabbit’s joy in logic mix!
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 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 e0fa655 and 631eddb.

📒 Files selected for processing (2)
  • apps/space/helpers/editor.helper.ts (4 hunks)
  • apps/web/core/components/workspace-notifications/sidebar/notification-card/content.tsx (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
apps/space/helpers/editor.helper.ts (2)

Learnt from: vamsikrishnamathala
PR: #7061
File: web/core/components/workspace-notifications/root.tsx:18-18
Timestamp: 2025-05-14T13:16:23.323Z
Learning: In the Plane project codebase, the path alias @/plane-web resolves to the ce directory, making imports like @/plane-web/hooks/use-notification-preview correctly resolve to files in web/ce/hooks/.

Learnt from: SatishGandham
PR: #5864
File: packages/editor/src/core/extensions/custom-image/read-only-custom-image.ts:60-60
Timestamp: 2024-10-22T08:03:04.373Z
Learning: In packages/editor/src/core/extensions/custom-image/read-only-custom-image.ts, the getImageSource command returns a string directly, not a function.

🧬 Code Graph Analysis (1)
apps/space/helpers/editor.helper.ts (1)
packages/editor/src/core/types/config.ts (1)
  • TFileHandler (4-20)
🔇 Additional comments (5)
apps/space/helpers/editor.helper.ts (3)

25-28: LGTM! Function consolidation properly addresses build errors.

The consolidation of separate read-only and full editor handlers into a single getEditorFileHandlers function is well-implemented and aligns with the PR objective of fixing editor build errors.


54-60: LGTM! Restore method implementation follows consistent pattern.

The restore method correctly mirrors the delete method's logic by distinguishing between old HTTP-based assets and new anchor-based assets. The conditional handling ensures compatibility with both asset service approaches.


42-42: Empty assetsUploadStatus initialization is safe

Initializing assetsUploadStatus as {} aligns with the rest of the editor’s handling of upload progress:

  • The utility extension falls back to {} when no statuses exist (packages/editor/src/core/extensions/utility.ts:76), matching this handler’s default.
  • The use-editor hook listens for changes on fileHandler.assetsUploadStatus and pushes updates into the editor (packages/editor/src/core/hooks/use-editor.ts:102–104).
  • The web‐store implementation also starts with an empty object and uses MobX’s set to populate progress (apps/web/core/store/editor/asset.store.ts).

No further changes are required here.

apps/web/core/components/workspace-notifications/sidebar/notification-card/content.tsx (2)

11-11: LGTM! Import change aligns with editor consolidation.

The import change from LiteTextReadOnlyEditor to LiteTextEditor is consistent with the unified editor approach and helps resolve the build errors.


102-103: LGTM! Component migration maintains read-only functionality.

The migration from LiteTextReadOnlyEditor to LiteTextEditor with editable={false} is well-executed. This approach consolidates editor components while preserving the intended read-only behavior through the editable prop.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/space-build

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@makeplane
Copy link

makeplane bot commented Jul 29, 2025

Pull Request Linked with Plane Work Items

Comment Automatically Generated by Plane

@pushya22 pushya22 merged commit e0b0aaf into preview Jul 29, 2025
4 of 8 checks passed
@pushya22 pushya22 deleted the fix/space-build branch July 29, 2025 13:40
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.

2 participants