Skip to content

fix: resolve the issue of having an additional image label when copying images directly from the editor to the clipboard#462

Merged
kagol merged 2 commits intodevfrom
wyp/position-0319
Mar 26, 2026
Merged

fix: resolve the issue of having an additional image label when copying images directly from the editor to the clipboard#462
kagol merged 2 commits intodevfrom
wyp/position-0319

Conversation

@wuyiping0628
Copy link
Copy Markdown
Collaborator

@wuyiping0628 wuyiping0628 commented Mar 23, 2026

…ing images directly from the editor to the clipboard

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #402

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • Bug Fixes

    • Fixed clipboard image handling so pasted images reliably produce usable URLs without unintended upload side-effects.
  • Chores

    • Enhanced internal clipboard processing to improve stability and predictability when inserting images.

…ing images directly from the editor to the clipboard
@github-actions github-actions bot added the bug Something isn't working label Mar 23, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7615bed4-24dc-4bb5-8bd2-56bae7a76161

📥 Commits

Reviewing files that changed from the base of the PR and between d1e74ee and 4acda04.

📒 Files selected for processing (1)
  • packages/fluent-editor/src/modules/custom-clipboard.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/fluent-editor/src/modules/custom-clipboard.ts

Walkthrough

Reworked clipboard image handling in the fluent-editor custom clipboard module: files2urls now awaits this.quill.uploader.getFileUrls([imageFile], range) and returns urls[0] || undefined for each file, replacing the prior call to this.quill.uploader.upload() that caused an upload side-effect.

Changes

Cohort / File(s) Summary
Custom Clipboard Module
packages/fluent-editor/src/modules/custom-clipboard.ts
Refactored files2urls to call and await this.quill.uploader.getFileUrls([imageFile], range) and return the first URL or undefined per image, removing the previous upload() side-effect.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰
Tiny paws tap keys in the night,
I swapped uploads for URLs just right,
Async carrots gleam in a row,
Paste and the images quietly glow.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing an issue with extra image labels appearing when copying images from the editor to clipboard, which aligns with the code change replacing upload() with getFileUrls() to prevent unwanted side effects.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch wyp/position-0319

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.

Copy link
Copy Markdown

@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: 1

🤖 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/fluent-editor/src/modules/custom-clipboard.ts`:
- Line 26: Remove the temporary debug console.log calls (e.g. console.log(1111,
'prepareMatching'), and the other debug lines with 2222 and 333) from
custom-clipboard code; replace them with appropriate logging (console.warn/error
or the project logger) only if needed to preserve runtime warnings, or simply
delete them to satisfy the no-console ESLint rule and clean up the code; look
for the 'prepareMatching' debug message and other console.log(...) occurrences
and remove or convert them accordingly.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1a6ee70b-f8a4-47c5-8771-40ff31765df7

📥 Commits

Reviewing files that changed from the base of the PR and between 270a8cd and d1e74ee.

📒 Files selected for processing (1)
  • packages/fluent-editor/src/modules/custom-clipboard.ts

@kagol kagol merged commit 4a3ccb5 into dev Mar 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants