fix(editor): preserve image styles when replacing an image#3596
fix(editor): preserve image styles when replacing an image#3596danilowoz wants to merge 1 commit into
Conversation
When replacing a selected image via the uploadImage command, carry over the existing image node's attributes (style/border-radius, width, height, alignment, href, alt) instead of resetting them to defaults. Only the src is overridden with the new blob URL. Paste/drop/slash-insert of a brand-new image (no image selected) is unaffected. Adds a focused upload-flow.spec.ts covering both the replace (attrs preserved) and fresh-insert (no carry-over) paths. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D5NmDNeo9mgSaDCVFzi2a2
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
There was a problem hiding this comment.
No issues found across 2 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Changes affect core editor logic for image upload/replacement, including state management via NodeSelection. A bug here could corrupt user content by incorrectly applying attributes. This requires domain knowledge of the editor's attribute handling and should be reviewed by a human.
Re-trigger cubic
When replacing a selected image via the uploadImage command, carry over the existing image node's attributes (style/border-radius, width, height, alignment, href, alt) instead of resetting them to defaults. Only the src is overridden with the new blob URL. Paste/drop/slash-insert of a brand-new image (no image selected) is unaffected.
Adds a focused upload-flow.spec.ts covering both the replace (attrs preserved) and fresh-insert (no carry-over) paths.
Claude-Session: https://claude.ai/code/session_01D5NmDNeo9mgSaDCVFzi2a2
Summary by cubic
Preserves existing image styling and metadata when replacing a selected image via upload. Only the image source changes; paste/drop/slash-insert of new images is unchanged.
style, width, height, alignment, href, and alt when replacing a selected image; onlysrcis updated (blob → uploaded URL).NodeSelectionand pass its attrs tosetImage.upload-flow.spec.tstests for replace (attrs preserved) and fresh insert (no carry-over).Written for commit 028563e. Summary will update on new commits.