authorgravatar for 73941998+UtkarshUsername@users.noreply.github.comUtkarsh Patil <73941998+UtkarshUsername@users.noreply.github.com> 2026-10-07 01:02:09+05:30
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-10-06 14:32:09-05:00
log8c61e254fd07249b8c420c44d62e8ecd72a78a20
treed05be9d0e3abed6a5b8b44379971f7154bde5f71
parentb83d731cabbfd32c7479bb2db7e6afbfb2085ff2
signature Signed by PGP key B5690EEEBB952194

fix(web): stop wide ordered list markers from clipping (#16523)


1 files changed, 2 insertions(+), 2 deletions(-)

apps/web/src/components/ChatMarkdown.tsx+2-2
...@@ -378,7 +378,7 @@ function findTaskListMarkerOffset(markdown: string, listItemStart: number): numb...@@ -378,7 +378,7 @@ function findTaskListMarkerOffset(markdown: string, listItemStart: number): numb
378 * The default `1.25rem` marker gutter (`.chat-markdown ol`) fits one-character378 * The default `1.25rem` marker gutter (`.chat-markdown ol`) fits one-character
379 * markers. Wider markers can extend past it and get clipped by a collapsed379 * markers. Wider markers can extend past it and get clipped by a collapsed
380 * message's overflow. Widen the gutter to fit the widest marker, including a380 * message's overflow. Widen the gutter to fit the widest marker, including a
381 * negative marker's minus sign.381 * negative marker's minus sign, the period, and the trailing space.
382 */382 */
383function orderedListGutterStyle(383function orderedListGutterStyle(
384 itemCount: number,384 itemCount: number,
...@@ -389,7 +389,7 @@ function orderedListGutterStyle(...@@ -389,7 +389,7 @@ function orderedListGutterStyle(
389 const lastNumber = firstNumber + Math.max(itemCount - 1, 0);389 const lastNumber = firstNumber + Math.max(itemCount - 1, 0);
390 const markerWidth = Math.max(String(firstNumber).length, String(lastNumber).length);390 const markerWidth = Math.max(String(firstNumber).length, String(lastNumber).length);
391 if (markerWidth <= 1) return undefined;391 if (markerWidth <= 1) return undefined;
392 return { "--list-gutter": `${markerWidth + 1}ch` };392 return { "--list-gutter": `${markerWidth + 2}ch` };
393}393}
394394
395type MarkdownImageHastNode = {395type MarkdownImageHastNode = {