Skip to content

Feature implementation from commits 193ae9b..322af8c#2

Open
codeOwlAI wants to merge 20 commits intofeature-base-branch-2from
feature-head-branch-2
Open

Feature implementation from commits 193ae9b..322af8c#2
codeOwlAI wants to merge 20 commits intofeature-base-branch-2from
feature-head-branch-2

Conversation

@codeOwlAI
Copy link
Owner

@codeOwlAI codeOwlAI commented Jun 30, 2025

PR Summary

Editor Improvements: Refactoring and File Handling Enhancements

Overview

This PR implements substantial code refactoring across the editor codebase, replacing string literals with constants from CORE_EXTENSIONS for improved maintainability. It also introduces a new UtilityExtension for file operations, enhances type safety, and improves file handling capabilities.

Change Types

Type Description
Refactor Replace string literals with CORE_EXTENSIONS constants throughout the codebase
Enhancement Add UtilityExtension for file handling and WorkItemEmbed functionality
Enhancement Improve file upload, deletion and restoration capabilities
Refactor Improve type safety by replacing 'any' types with specific types
Bugfix Fix error handling in file operations

Affected Modules

Module / File Change Description
editor/src/core/extensions/ Added UtilityExtension, refactored to use constants, updated module exports
editor/src/core/helpers/ Improved file handling, image restoration, error handling
editor/src/core/hooks/ Updated editor hooks to use utility extension for file operations
editor/src/core/plugins/ Added new plugins for file drop, deletion, and restoration
i18n/ Refactored translation file handling
types/ Added new fields to user and project interfaces
core/store/ Enhanced settings management and UI state handling

Notes for Reviewers

  • The refactoring of string literals to constants is extensive and touches many files
  • The new file handling approach centralizes upload status management in the UtilityExtension
  • Type safety improvements should make the codebase more robust

Additional Context

  • URL structure for project settings has changed, with redirects added in Next.js config
  • The editor's preserveWhitespace setting has been standardized to use boolean true instead of string "full"

JayashTripathy and others added 20 commits May 26, 2025 15:22
* pytest bases tests for apiserver

* Trimmed spaces

* Updated .gitignore for pytest local files
Bumps the pip group with 1 update in the /apiserver/requirements directory: [requests](https://github.com/psf/requests).


Updates `requests` from 2.31.0 to 2.32.2
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](psf/requests@v2.31.0...v2.32.2)

---
updated-dependencies:
- dependency-name: requests
  dependency-version: 2.32.2
  dependency-type: direct:production
  dependency-group: pip
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* chore: add ARIA attributes

* chore: add missing translations

* chore: add accessibility translations for multiple languages and configured store according to it

* chore: refactor translation file handling and introduce TranslationFiles enum

* fix: accessibility issues in workspace sidebar

---------

Co-authored-by: JayashTripathy <jayashtripathy371@gmail.com>
Co-authored-by: Prateek Shourya <prateekshourya29@gmail.com>
* refactor: file plugins and types

* refactor: image extension storage types

* chore: update meta tag name

* chore: extension fileset storage key

* fix: build errors

* refactor: utility extension

* refactor: file plugins

* chore: remove standalone plugin extensions

* chore: refactoring out onCreate into a common utility

* refactor: work item embed extension

* chore: use extension enums

* fix: errors and warnings

* refactor: rename extension files

* fix: tsup reloading issue

* fix: image upload types and heading types

* fix: file plugin object reference

* fix: iseditable is hard coded

* fix: image extension names

* fix: collaborative editor editable value

* chore: add constants for editor meta as well

---------

Co-authored-by: Palanikannan M <akashmalinimurugu@gmail.com>
* fix: memoize file upload functions

* chore: update extension name

* chore: update notation

* chore: resolve chokidar package

* fix: spelling mistakes
* fix: handle symbols and space

* chore: refactor
* fix: return project joining date

* fix: added project's joining date

* fix: set created_at as read_only_fields

---------

Co-authored-by: gakshita <akshitagoyal1516@gmail.com>
…ne#7117)

* feat: added a python bg task to crawl work item links for title and description

* fix: return meta_data in the response

* fix: add validation for accessing IP ranges

* fix: remove json.dumps

* fix: handle exception by returning None

* refactor: call find_favicon_url inside fetch_and_encode_favicon function

* chore: type hints

* fix: Handle None

* fix: remove print statementsg

* chore: added favicon and title of links

* fix: return null if no title found

* Update apiserver/plane/bgtasks/work_item_link_task.py

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix: remove exception handling

* fix: reduce timeout seconds

* fix: handle timeout exception

* fix: remove request timeout handling

* feat: add Link icon to issue detail links and update rendering logic

* fix: use logger for exception

---------

Co-authored-by: sangeethailango <sangeethailango21@gmail.com>
Co-authored-by: JayashTripathy <jayashtripathy371@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* chore: return workspace name and logo in profile settings api

* chore: remove unwanted fields

* fix: backend

* feat: workspace settings

* feat: workspce settings + layouting

* feat: profile + workspace settings ui

* chore: project settings + refactoring

* routes

* fix: handled no project

* fix: css + build

* feat: profile settings internal screens upgrade

* fix: workspace settings internal screens

* fix: external scrolling allowed

* fix: css

* fix: css

* fix: css

* fix: preferences settings

* fix: css

* fix: mobile interface

* fix: profile redirections

* fix: dark theme

* fix: css

* fix: css

* feat: scroll

* fix: refactor

* fix: bug fixes

* fix: refactor

* fix: css

* fix: routes

* fix: first day of the week

* fix: scrolling

* fix: refactoring

* fix: project -> projects

* fix: refactoring

* fix: refactor

* fix: no authorized view consistency

* fix: folder structure

* fix: revert

* fix: handled redirections

* fix: scroll

* fix: deleted old routes

* fix: empty states

* fix: headings

* fix: settings description

* fix: build

---------

Co-authored-by: gakshita <akshitagoyal1516@gmail.com>
Co-authored-by: Akshita Goyal <36129505+gakshita@users.noreply.github.com>
Comment on lines +164 to +166
const { editor, filesList, pos, type, uploader } = args;
const filesArray = Array.from(filesList);
if (filesArray.length === 0) {
Copy link

Choose a reason for hiding this comment

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

🔒 Security Issue

Security: File Validation Removed.

All file validation logic (MIME type and size checks) has been removed, allowing any file type to be uploaded which creates a security vulnerability.

Current Code (Diff):

-   const { editor, filesList, pos, type, uploader } = args;
-   const filesArray = Array.from(filesList);
-   if (filesArray.length === 0) {
+   const { editor, filesList, pos, type, uploader } = args;
+   const filesArray = [];
+   for (let i = 0; i < filesList.length; i += 1) {
+     const file = filesList.item(i);
+     if (file) {
+       filesArray.push(file);
+     }
+   }
+   if (filesArray.length === 0) {
📝 Committable suggestion

‼️ IMPORTANT
Trust, but verify! 🕵️ Please review this suggestion with the care of a code archaeologist - check that it perfectly replaces the highlighted code, preserves all lines, maintains proper indentation, and won't break anything in production. Your future self will thank you! 🚀

Suggested change
const { editor, filesList, pos, type, uploader } = args;
const filesArray = Array.from(filesList);
if (filesArray.length === 0) {
const { editor, filesList, pos, type, uploader } = args;
const filesArray = [];
for (let i = 0; i < filesList.length; i += 1) {
const file = filesList.item(i);
if (file) {
filesArray.push(file);
}
}
if (filesArray.length === 0) {

🔄 Dependencies Affected

packages/editor/src/core/hooks/use-file-upload.ts

Function: useDropZone

Issue: The useDropZone hook calls uploadFirstFileAndInsertRemaining without validation parameters, expecting validation to happen inside the function

Suggestion: Add validation parameters to the uploadFirstFileAndInsertRemaining call or implement validation before calling it


editor,
files: acceptedFiles,
initialPos: pos,
event: "drop",
Copy link

Choose a reason for hiding this comment

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

🐛 Correctness Issue

Incorrect event type in paste handler.

The handlePaste function uses 'drop' as the event type instead of 'paste', which will cause incorrect tracking and processing of pasted files.

Current Code (Diff):

-               event: "drop",
+               event: "paste",
📝 Committable suggestion

‼️ IMPORTANT
Trust, but verify! 🕵️ Please review this suggestion with the care of a code archaeologist - check that it perfectly replaces the highlighted code, preserves all lines, maintains proper indentation, and won't break anything in production. Your future self will thank you! 🚀

Suggested change
event: "drop",
event: "paste",

🔄 Dependencies Affected

packages/editor/src/core/extensions/custom-image/custom-image.ts

Function: insertImageComponent

Issue: The insertImageComponent function uses the event parameter for tracking files, so using an incorrect event type will cause improper tracking

Suggestion: Update the event parameter to 'paste' to ensure proper file tracking


Comment on lines +109 to +110
} else if (fileType === "attachment") {
}
Copy link

Choose a reason for hiding this comment

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

🐛 Correctness Issue

Empty attachment file handler.

The code detects attachment files but has an empty implementation for handling them, causing a silent failure where users can drop attachments but nothing happens.

Current Code (Diff):

-      } else if (fileType === "attachment") {
+      } else if (fileType === "attachment") {
+        // TODO: Implement attachment handling
+        console.error("Attachment handling not implemented yet");
📝 Committable suggestion

‼️ IMPORTANT
Trust, but verify! 🕵️ Please review this suggestion with the care of a code archaeologist - check that it perfectly replaces the highlighted code, preserves all lines, maintains proper indentation, and won't break anything in production. Your future self will thank you! 🚀

Suggested change
} else if (fileType === "attachment") {
}
} else if (fileType === "attachment") {
// TODO: Implement attachment handling
console.error("Attachment handling not implemented yet");
}

@@ -141,7 +141,7 @@ export class IssueLinkStore implements IIssueLinkStore {
set(this.linkMap, [linkId, key], initialData[key as keyof TIssueLink]);
});
});
return initialData;
throw error;
Copy link

Choose a reason for hiding this comment

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

🐛 Correctness Issue

Breaking API Change: Error Propagation.

This change modifies error handling to throw errors instead of returning initial data, which could cause application crashes if callers aren't prepared to handle these exceptions.

Current Code (Diff):

-       return initialData;
+       throw error;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants