-
Notifications
You must be signed in to change notification settings - Fork 53
fix(web): EnrichedText textAlignment rendering #689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
hejsztynx
merged 4 commits into
main
from
@ksienkiewicz/fix-web-list-markers-in-text-alignment
Jul 10, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-13 Bytes
(99%)
.playwright/screenshots/enriched-text-checkbox-list-checked.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-13 Bytes
(100%)
.playwright/screenshots/enriched-text-checkbox-list-empty-items.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-36 Bytes
(97%)
.playwright/screenshots/enriched-text-checkbox-list-unchecked.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2 Bytes
(100%)
.playwright/screenshots/enriched-text-checkbox-list-wrapped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-48 Bytes
(98%)
.playwright/screenshots/images-checkbox-list-placeholder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-28 Bytes
(99%)
.playwright/screenshots/list-keyboard-backspace-after-lift-checkbox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-7 Bytes
(100%)
.playwright/screenshots/list-keyboard-backspace-after-merge-checkbox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-158 Bytes
(85%)
.playwright/screenshots/list-keyboard-enter-causes-scrolling-checkbox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1 Byte
(100%)
.playwright/screenshots/paragraph-styles-visual-checkbox-list-wrapped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-43 Bytes
(97%)
.playwright/screenshots/paragraph-styles-visual-checkbox-list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
139 changes: 139 additions & 0 deletions
139
.playwright/tests/enrichedTextTextAlignmentVisual.spec.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,139 @@ | ||
| import { test, expect, type Locator, type Page } from '@playwright/test'; | ||
|
|
||
| test.setTimeout(90_000); | ||
|
|
||
| const sel = { | ||
| root: '[data-testid="test-enriched-text-root"]', | ||
| htmlInput: '[data-testid="test-enriched-text-html-input"]', | ||
| setValueButton: '[data-testid="test-enriched-text-set-value-button"]', | ||
| toggleWidthButton: '[data-testid="test-enriched-text-toggle-width-button"]', | ||
| valueOutput: '[data-testid="test-enriched-text-value-output"]', | ||
| display: '[data-testid="test-enriched-text-display"]', | ||
| displayInner: '[data-testid="test-enriched-text-display"] .et-view', | ||
| } as const; | ||
|
|
||
| function displayLocator(page: Page): Locator { | ||
| return page.locator(sel.display); | ||
| } | ||
|
|
||
| async function gotoTestEnrichedText(page: Page): Promise<void> { | ||
| await page.goto('/test-enriched-text'); | ||
| await page.waitForSelector(sel.displayInner); | ||
| await page.click(sel.toggleWidthButton); | ||
| } | ||
|
|
||
| async function setEnrichedTextValue(page: Page, html: string): Promise<void> { | ||
| await page.fill(sel.htmlInput, html); | ||
| await page.click(sel.setValueButton); | ||
|
|
||
| await expect | ||
| .poll(async () => (await page.locator(sel.valueOutput).textContent()) ?? '') | ||
| .toBe(html); | ||
| } | ||
|
|
||
| test.describe('visual: alignments for typography and blocks', () => { | ||
| const cases = [ | ||
| { | ||
| name: 'paragraphs with mixed alignments', | ||
| snapshot: 'display-alignment-paragraphs.png', | ||
| html: [ | ||
| '<html>', | ||
| '<p style="text-align: left">Left aligned (default)</p>', | ||
| '<p style="text-align: center">Center aligned</p>', | ||
| '<p style="text-align: right">Right aligned</p>', | ||
| '<p style="text-align: justify">Justified alignment. This needs a bit more text to properly visualize the justification spreading across the entire width of the container, ensuring both the left and right edges are perfectly flush against the margins.</p>', | ||
| '</html>', | ||
| ].join(''), | ||
| }, | ||
| { | ||
| name: 'headings with mixed alignments', | ||
| snapshot: 'display-alignment-headings.png', | ||
| html: [ | ||
| '<html>', | ||
| '<h2 style="text-align: center">H2 Center</h2>', | ||
| '<h4 style="text-align: right">H4 Right</h4>', | ||
| '<h6 style="text-align: left">H6 Left</h6>', | ||
| '</html>', | ||
| ].join(''), | ||
| }, | ||
| { | ||
| name: 'blockquotes with independent alignments', | ||
| snapshot: 'display-alignment-blockquotes.png', | ||
| html: [ | ||
| '<html>', | ||
| '<blockquote>', | ||
| '<p style="text-align: left">Quote left</p>', | ||
| '<p style="text-align: center">Quote center</p>', | ||
| '<p style="text-align: right">Quote right</p>', | ||
| '</blockquote>', | ||
| '</html>', | ||
| ].join(''), | ||
| }, | ||
| ]; | ||
|
|
||
| for (const c of cases) { | ||
| test(c.name, async ({ page }) => { | ||
| await gotoTestEnrichedText(page); | ||
| await setEnrichedTextValue(page, c.html); | ||
| await expect(displayLocator(page)).toHaveScreenshot(c.snapshot); | ||
| }); | ||
| } | ||
| }); | ||
|
|
||
| test.describe('visual: alignments for all list types', () => { | ||
| const cases = [ | ||
| { | ||
| name: 'unordered lists: left, center, right', | ||
| snapshot: 'display-alignment-ul.png', | ||
| html: [ | ||
| '<html>', | ||
| '<ul style="text-align: left"><li>Left unordered 1</li><li>Left unordered 2</li></ul>', | ||
| '<ul style="text-align: center"><li>Center unordered 1</li><li>Center unordered 2</li></ul>', | ||
| '<ul style="text-align: right"><li>Right unordered 1</li><li>Right unordered 2</li></ul>', | ||
| '</html>', | ||
| ].join(''), | ||
| }, | ||
| { | ||
| name: 'ordered lists: left, center, right', | ||
| snapshot: 'display-alignment-ol.png', | ||
| html: [ | ||
| '<html>', | ||
| '<ol style="text-align: left"><li>Left ordered 1</li><li>Left ordered 2</li></ol>', | ||
| '<ol style="text-align: center"><li>Center ordered 1</li><li>Center ordered 2</li></ol>', | ||
| '<ol style="text-align: right"><li>Right ordered 1</li><li>Right ordered 2</li></ol>', | ||
| '</html>', | ||
| ].join(''), | ||
| }, | ||
| { | ||
| name: 'checkbox lists: left, center, right', | ||
| snapshot: 'display-alignment-checkbox.png', | ||
| html: [ | ||
| '<html>', | ||
| '<ul data-type="checkbox" style="text-align: left"><li checked>Left task 1</li><li>Left task 2</li></ul>', | ||
| '<ul data-type="checkbox" style="text-align: center"><li checked>Center task 1</li><li>Center task 2</li></ul>', | ||
| '<ul data-type="checkbox" style="text-align: right"><li checked>Right task 1</li><li>Right task 2</li></ul>', | ||
| '</html>', | ||
| ].join(''), | ||
| }, | ||
| { | ||
| name: 'complex mixed lists and layouts', | ||
| snapshot: 'display-alignment-mixed-lists.png', | ||
| html: [ | ||
| '<html>', | ||
| '<p style="text-align: center">A centered paragraph before lists</p>', | ||
| '<ol style="text-align: right"><li>Right ordered</li></ol>', | ||
| '<ul style="text-align: center"><li>Center bullet</li></ul>', | ||
| '<ul data-type="checkbox" style="text-align: right"><li checked>Right checkbox</li></ul>', | ||
| '</html>', | ||
| ].join(''), | ||
| }, | ||
| ]; | ||
|
|
||
| for (const c of cases) { | ||
| test(c.name, async ({ page }) => { | ||
| await gotoTestEnrichedText(page); | ||
| await setEnrichedTextValue(page, c.html); | ||
| await expect(displayLocator(page)).toHaveScreenshot(c.snapshot); | ||
| }); | ||
| } | ||
| }); |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.