fix(web): long lists no longer clip their numbers - #5163
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d631f89a10
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ApprovabilityVerdict: Approved 5b60b87 This is a self-contained UI bug fix for list marker clipping, implemented via a well-tested pure utility function and corresponding CSS changes. The unresolved review comment appears to reference code that was actually removed in this PR. You can customize Macroscope's approvability policy. Learn more. |
d631f89 to
7bfe548
Compare
What Changed
Ordered lists in chat markdown now widen their left padding to fit the marker digits, and markers use tabular numerals. A small tested helper computes the padding.
Why
The old padding was fixed at two digits wide. Item numbers past 99 spilled out and got clipped, so
187.displayed as87.. Uneven digit widths also made some numbers sit misaligned. In the odd case that there is aolin aulbullet items that start with a long number would render through the marker.UI Changes
Before:
(Fable really struggled to follow directions for this test, see the PS below for more
fable fumbles)After:
Checklist
PS: Open to see fable struggling to follow directions lol, found that haikus lack of brain really helped test this.
Note
Low Risk
Scoped to chat markdown list presentation and CSS; no auth, data, or API changes.
Overview
Fixes ordered list number clipping in chat markdown when markers exceed two digits (e.g.
187.showing as87.) or when lists use a highstartvalue.Adds
orderedListMarkerExtraDigitsto compute how many digits past two the widest marker needs (fromstart, item count, and negative starts).ChatMarkdownwires a customolrenderer that sets--chat-markdown-ol-marker-extraon each list.CSS replaces fixed
1.25remleft padding withcalc(1.25rem + var(...) * 1ch)and appliestabular-numson::markerso multi-digit labels align cleanly. Footnote ordered lists drop redundant padding so they inherit the same behavior. Unit tests cover the helper.Reviewed by Cursor Bugbot for commit 5b60b87. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix ordered list number clipping in chat markdown for long lists
orderedListMarkerExtraDigitsutility that computes extra digits beyond two in the widest list marker, accounting for negative start values.olrenderer inChatMarkdownsets a--chat-markdown-ol-marker-extraCSS variable based on item count and start index.index.cssusescalc(1.25rem + var(--chat-markdown-ol-marker-extra, 0) * 1ch)forpadding-leftand addsfont-variant-numeric: tabular-numsto list markers for consistent alignment.padding-leftoverride and will inherit the dynamic padding.Macroscope summarized 5b60b87.