Skip to content

Stop clipping two-digit ordered list markers - #1759

Merged
SawyerHood merged 1 commit into
get-bb:mainfrom
smsunarto:bb/thr_x8taxdm8ya
Aug 18, 2026
Merged

SawyerHood merged 1 commit into
get-bb:mainfrom
smsunarto:bb/thr_x8taxdm8ya

Conversation

@smsunarto

Copy link
Copy Markdown
Contributor

Ordered lists in rendered markdown indent 20px (pl-5), but a 10. marker at text-sm is ~21px wide and paints outside the content box. Every message body that has not been expanded carries overflow-hidden (it also holds the 15-line clamp), and that box has no padding of its own, so its edge sits on the bubble content edge and cuts the marker: 10. renders as l0., 11. as l1..

Widen ordered lists to 28px (pl-7). Bullet lists are unchanged — disc markers are narrow and never overflowed.

Reproduction

Measured from a report screenshot: the clip sits 18.5 CSS px from the bubble border, matching 1px border + 16px padding. The 1 glyph loses its flag and the left half of its foot serif on the same vertical line, which is a clip rather than a font problem. Reproduced in the UserMessageMarkdown story in its default, non-expanded state, and confirmed fixed at pl-7. Both a short list starting at 7 and the pre-existing long collapsible "Migration rollout" story hit it.

The composer (ComposerEditorSlot) uses the same pl-5 but does not clip: its scroll container has 16px of padding, so the overhang has room. Verified live with rich-text editing on; left unchanged.

Verification

  • pnpm exec turbo run typecheck --filter=@bb/app — clean
  • pnpm exec turbo run test --filter=@bb/app — 2807 passed

AGENT GENERATED: by Claude Opus 5

Ordered lists indent 20px (pl-5), but a "10." marker at text-sm is ~21px wide and paints outside the content box. Every non-expanded message body carries overflow-hidden (it also holds the 15-line clamp), and its padding box starts at the content edge, so the marker's leading digit was cut: "10." rendered as "l0.". Widen ordered lists to 28px (pl-7).
@SawyerHood
SawyerHood merged commit 9e102e0 into get-bb:main Aug 18, 2026
9 checks passed
SawyerHood added a commit that referenced this pull request Aug 18, 2026
This reverts commit 9e102e0 (#1759).

## Tests

- Clean `git revert` of a one-line change. No new tests.

> AGENT GENERATED: by Claude Opus 5
@smsunarto
smsunarto deleted the bb/thr_x8taxdm8ya branch August 22, 2026 22:47
ymichael added a commit that referenced this pull request Oct 7, 2026
## Human comments

## What was wrong

The shared markdown renderer reserved 20px for outside ordered-list markers.
Two-digit markers exceeded the gutter and were clipped in collapsed user
bubbles. The earlier fixed 28px fix in 9e102e0 (#1759) was explicitly
reverted to 20px by 16ceb3a (#1765), without a regression test. A fixed
wider gutter also shifts single-digit lists unnecessarily.

## What changed

Count direct items in each ordered list and calculate its widest marker from
its start and final number. Expose the digit count as a CSS variable and
add one ch per extra digit to the existing 20px padding-inline-start.
Single-digit lists keep their geometry; nested lists compute independently.
User and assistant markdown use the shared renderer. Unordered lists are
unchanged. Queued previews flatten lists into inline spans without markers.

Add focused Ladle story cases for both message roles: 1–9, 10–12,
98–101, and nested 7–11. These expose the geometry for the story smoke
and visual checks.

## How you verified

- A temporary Chromium geometry check failed with the original gutter: "1280px user:
  marker 10. needs 20.56px, but the computed gutter is 20px".
- With the fix, the geometry check passed for both user and assistant
  messages at 1280px and 390px: single-digit gutters remain 20px, larger
  gutters grow only by the extra digits, start values are preserved, and
  all markers fit, including independently measured nested lists.
- Reviewed before/after Ladle screenshots at 1280px and 390px. Capture-only
  browser changes stack story labels above messages and hide unrelated
  rows; production message styles are unchanged.
- pnpm exec turbo run typecheck lint --filter=@bb/app passed; lint reported
  250 existing warnings and no errors.
- The focused existing ordered-list start test passed through Turbo.
- git diff --check passed.

> AGENT GENERATED
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants