feat(composer): align images in the editor and in sent messages - #13509
Open
kesselb wants to merge 1 commit into
Open
feat(composer): align images in the editor and in sent messages#13509kesselb wants to merge 1 commit into
kesselb wants to merge 1 commit into
Conversation
kesselb
requested review from
GVodyanov and
odzhychko
and
a lite review from Copilot
August 18, 2026 15:53
Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
kesselb
force-pushed
the
ckeditor-image-alignment
branch
from
August 18, 2026 15:54
de4b4ef to
f237fb7
Compare
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
This PR updates the CKEditor composer configuration and downcast behavior so image alignment (left/center/right) is consistent between the editor view and the HTML that gets sent (and later reopened).
Changes:
- Enable image style + image toolbar in the editor and expose alignment actions.
- Inline alignment styles during downcast so email clients render alignment consistently.
- Add/update unit tests to cover alignment toolbar config and downcasted alignment styles.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/components/TextEditor.vue | Enables CKEditor image style/toolbar and aligns editor CSS with downcast defaults. |
| src/ckeditor/image/ImageDowncastPlugin.ts | Adds alignment inlining logic based on image style classes during downcast. |
| src/tests/unit/components/TextEditor.spec.js | Updates test to assert alignment toolbar configuration is present. |
| src/tests/unit/ckeditor/image/ImageDowncastPlugin.spec.js | Extends downcast tests to cover center/right/default-left alignment behavior. |
馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
67
to
69
| if ((item.is('element', 'figure') && item.hasClass('image')) || item.is('element', 'img')) { | ||
| this._inlineAlignment(writer, item) | ||
| this._mirrorResizedWidth(writer, item) |
Comment on lines
+83
to
+89
| _inlineAlignment(writer: UpcastWriter, figure: ViewElement): void { | ||
| // Without an alignment class the figure keeps the client's own margins. | ||
| const className = Object.keys(ALIGNMENTS).find((candidate) => figure.hasClass(candidate)) | ||
| ?? 'image-style-block-align-left' | ||
|
|
||
| writer.setStyle(ALIGNMENTS[className], figure) | ||
| } |
| * @param writer view writer of the data view | ||
| * @param figure the figure to align | ||
| */ | ||
| _inlineAlignment(writer: UpcastWriter, figure: ViewElement): void { |
GVodyanov
reviewed
Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Fix #11131
Fix #9350
STR:
Main: Image not aligned
Here: Image aligned
馃 AI (if applicable)