Repository navigation
Revert "Stop clipping two-digit ordered list markers (#1759)" - #1765
Conversation
This reverts commit 9e102e0.
|
🚨 SLOP COP 🚨 · Plain English summary: This pull request restores the prior spacing for numbered lists in Markdown previews. I am the SlopCop. I am reviewing this change for security, code quality, architecture, performance, and real product behavior. |
| <ol | ||
| {...orderedListProps} | ||
| className="mb-2 list-decimal pl-7 text-foreground" | ||
| className="mb-2 list-decimal pl-5 text-foreground" |
There was a problem hiding this comment.
🚨 slopcop/review — This change clips the first digit of two-digit ordered-list markers.
Browser QA at the pull request head measured a 23.84 px 10. marker inside 20 px padding. The nearest overflow-hidden parent starts at the same left edge. It removes the first digit from 10. and 11..
Keep pl-7, or add another layout change that gives the full marker enough space.
There was a problem hiding this comment.
🚨 SLOP COP 🚨 · review
Plain English summary: This pull request restores the old spacing for numbered lists. It also restores a visible clipping defect.
Finding
The first digit in 10. and 11. is clipped in collapsed user messages. At the pull request head, the marker width was 23.84 pixels. The ordered list gives it 20 pixels.
The nearest overflow-hidden parent starts at the same left edge. The parent clips the extra width. Keep pl-7, or give the marker enough space through another layout change.
I would not merge this version. I posted the line-specific finding.
Other review areas
- Security: I found no security issue.
- Performance: I found no performance issue. This change only alters a static padding utility.
- Architecture: I found no useful refactor. The composer has different padding and clip behavior, so a shared value would couple different layouts.
Checks
- Three focused bb subagents reviewed security, quality and architecture, and performance.
- The app typecheck passed.
- The app test suite passed 2,807 tests.
- The targeted Markdown preview suite passed 15 tests.
- Browser QA ran against
183f30d4with an eleven-item user message. - Browser QA reproduced the clipped markers and confirmed the 20-pixel versus 23.84-pixel mismatch.
## 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
This reverts commit 9e102e0 (#1759).
Tests
git revertof a one-line change. No new tests.