fix(web): handle wide ordered-list marker edge cases - #7856
Conversation
Ordered-list gutter sizing now compares the first and last marker, counts negative signs, and coerces raw HTML start values. Footnote lists retain the computed gutter, while tabular numerals keep decimal markers aligned. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
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 |
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Self-contained UI bug fix for ordered-list marker width edge cases in markdown rendering. Changes include test coverage and are limited to visual rendering logic with no sensitive areas affected. You can add or adjust custom eligibility rules. Learn more. |
What changed
startvalues are coerced before sizing the gutter.1.25rem.Why
#6527 landed the core dynamic-gutter fix while #5163 was open, which left the older PR conflicting with
main. This replacement keeps the current implementation and carries forward the edge cases and marker alignment that are still missing.UI changes
The original before/after evidence is preserved in #5163. The replacement is limited to cases not covered by the implementation that has since landed on
main.Before
After
Verification
pnpm exec vp fmt --check apps/web/src/components/ChatMarkdown.tsx apps/web/src/components/ChatMarkdown.test.tsx apps/web/src/index.csspnpm exec vp lint --report-unused-disable-directives apps/web/src/components/ChatMarkdown.tsx apps/web/src/components/ChatMarkdown.test.tsxcd apps/web && pnpm exec vp test run --passWithNoTests --project unit src/components/ChatMarkdown.test.tsxpnpm exec vp run --filter @t3tools/web typecheckSupersedes #5163.
Note
Fix ordered-list gutter sizing for wide and negative markers in
ChatMarkdownorderedListGutterStylenow parsesstartviaNumber.parseInton stringified input (defaulting to 1 on NaN) and sizes the gutter from the widest of the first and last markers, including the minus sign for negative startsfont-variant-numeric: tabular-nums, and footnote ordered lists inherit padding from.chat-markdown olso widened gutters apply instead of the prior fixed1.25remorderedListGutterStylewidens fromnumber | undefinedtounknown; non-numeric inputs are now parsed rather than ignored. Footnote list padding-left no longer hardcodes1.25rem.Macroscope summarized 2bd7d91.
Note
Low Risk
UI-only markdown list styling with unit tests; no auth, data, or security impact.
Overview
Fixes remaining ordered-list marker clipping in chat markdown after the dynamic-gutter work.
orderedListGutterStylenow parses HTMLstart(including string values) and sizes--list-gutterfrom the widest of the first and last markers, counting a negative start’s minus sign. Footnote lists no longer forcepadding-left: 1.25rem, so a widened gutter can apply. Decimal markers usetabular-numsso digits align.Reviewed by Cursor Bugbot for commit 2bd7d91. Bugbot is set up for automated code reviews on this repo. Configure here.