fix(web): list styling - #730
Open
hejsztynx wants to merge 11 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves web list layout/styling for unordered, ordered, and checkbox lists by correcting padding calculations, aligning markers more consistently, and dynamically sizing the ordered-list marker column based on the largest counter value.
Changes:
- Fixes
ul/ checkbox list padding math and adjusts marker vertical alignment. - Updates
olmarker layout so the marker column is right-aligned and can expand to fit larger counter values. - Adds runtime digit-count measurement for ordered lists (Tiptap editor plugin + read-only hook) and adds Playwright visual coverage for extended ordered-list margins.
Reviewed changes
Copilot reviewed 7 out of 55 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/web/useOrderedListMarkerWidth.ts | Adds a DOM-based effect to compute/set --et-ol-digits for rendered <ol> elements. |
| src/web/pmPlugins/OrderedListMarkerWidthPlugin.ts | Adds a ProseMirror/Tiptap plugin that decorates ordered lists with --et-ol-digits. |
| src/web/EnrichedTextInput.tsx | Registers the new ordered-list marker width plugin in the editor extension list. |
| src/web/EnrichedText.tsx | Hooks the new ordered-list digit measurement into read-only rendering. |
| src/web/EnrichedText.css | Adjusts list padding/marker positioning and implements an expandable ordered-list marker column. |
| .playwright/tests/paragraphStylesVisual.spec.ts | Adds visual regression coverage for extended ordered-list marker column in the editor. |
| .playwright/tests/enrichedTextVisual.spec.ts | Adds visual regression coverage for extended ordered-list marker column in read-only display. |
Comments suppressed due to low confidence (1)
src/web/EnrichedText.css:348
topusesvar(--et-checkbox-box-size)without a fallback, so if the variable is not set thecalc(...)becomes invalid and checkbox alignment will regress. Add the same fallback used for width/height.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 55 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (3)
src/web/pmPlugins/OrderedListMarkerWidthPlugin.ts:34
state.doc.descendantsstops descending once it finds anorderedListbecause the callback returnsfalse. That means nested ordered lists inside list items won’t get--et-ol-digitsset, so their marker column width may still overflow.
src/web/EnrichedText.css:347- This
topcalculation usesvar(--et-checkbox-box-size)without a fallback, while other uses of the same variable in this file include, 24px. If the CSS variable is missing for any reason, the wholecalc()becomes invalid and the checkbox won’t be vertically aligned.
src/web/useOrderedListMarkerWidth.ts:16 - The
startattribute parsing forcesstartto be > 0. HTML<ol start="0">or negative starts are valid, and using1here can underestimate digit width and reintroduce marker overflow for those cases. Also,Number(null)becomes0, so an absentstartattribute currently gets treated as 0 and then coerced to 1 only because of the> 0check; it’s clearer to explicitly treat a missing attribute as default 1.
hejsztynx
marked this pull request as ready for review
July 28, 2026 12:56
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
Some of the web's list styling was working poorly
unorderedandcheckboxlists was calculated wrong. ThemarginLeft,gapWidthandbulletSize/checkboxSizewere used improperly,olmarks are now aligned to the right of themarginLeftspace (they sit within it), making thegapWidthalways identical,olmarks get additional margin, if their values are too large to fit within the initialmarginLeftTest Plan
Experiment with different values inside
defaultHtmlStyle.tsinsideexample-web/Screenshots / Videos
The
olmarkers overflowing bug:Before:
Screen.Recording.2026-07-28.at.14.16.14.mov
After:
Screen.Recording.2026-07-28.at.14.15.07.mov
Compatibility
Checklist