Skip to content

fix(Markdown): keep bulleted and numbered lists inside their column - #12290

Closed
josephfarina wants to merge 5 commits into
mainfrom
rl10-markdown-list-column
Closed

josephfarina wants to merge 5 commits into
mainfrom
rl10-markdown-list-column

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

User impact

A Markdown bulleted or numbered list reached 8px past both edges of its column. (Task-only lists take a separate path; #12295 fixes those.) When Markdown filled a phone screen (for example a cited answer in a full-width column at 390px), the list made the page 398px wide, so the page scrolled sideways and list text sat partly off screen.

Problem and solution fit

  • Why does it occur? Markdown cancelled List's row inset with a negative inline margin on the list (-spacing-2 on both sides), so the list box was 16px wider than its column.
  • Why does it harm the task? The extra width is real layout overflow: at the viewport edge it widens the document.
  • Why does that matter? Sideways scroll on a phone breaks reading and makes the page look broken.

List already has the treatment for this: edge="flush" drops the row inset, so row content meets the list's edges. Markdown's lists now use it, and the negative margins go away. The numbered-list gutter (a second negative start margin plus matching padding) goes too: with flush rows it nets to nothing, and it pushed the list box past the start edge, which is the right edge in RTL. Pure task lists (the CheckboxList path) keep their current offset; CheckboxList has no edge choice, so that path is unchanged here.

Expected behavior and authority

  • component:List FR3: flush resolves the row inset to zero and "works anywhere; suits static rows".
  • spec:AST-061 FR5/FR11: Markdown text starts and nested insets stay the same, so renderer parity holds.

Smallest restoration

One style change in Markdown.tsx: lists pass edge="flush", blockIndent drops its negative margin, and the numbered gutter style goes away. The task-list container keeps its old margin through a named style (#12295 removes it). No API or theme change.

Evidence

  • Reproduction before the change: Markdown in a full-width column at 375/390px, light and dark. The page is 383/398px wide; the list box spans -8 to width+8.
  • Result after the change: the page width equals the viewport; the list box spans 0 to the column width.
  • Representative unchanged path: bulleted and mixed task rows keep their marker and text positions at 375/390/1280px, LTR and RTL. Numbered rows keep their positions in Storybook and in the package build.
  • Regression test: listEdge.test.tsx fails on main (rows are not flush) and passes here. MarkdownListBounds.a11y.chromium.spec.ts checks in Chromium that each list stays inside the paragraph column at 390px, LTR and RTL, and that the page does not scroll sideways.

Scope

Components: Markdown

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • vitest run packages/core/src/Markdown packages/core/src/List packages/core/src/CheckboxList: 64 files, 1799 tests pass; the new unit test adds 3.
  • Real Chromium at 375/390/1280px, light and dark: page width and list geometry measured before and after on built pages.
  • tsc --noEmit in packages/core is clean.
  • The Storybook-based Chromium spec could not run locally (storybook build crashed on the machines used); it relies on CI.

Markdown lists stepped out 8px past both edges of their column to cancel the
row inset, so Markdown that filled a phone screen widened the page. Lists now
use List's flush edge, which drops the row inset, so markers and text keep
their positions and the list box matches the column.
@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 17, 2026 11:19am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 17, 2026
@astracat-bot

astracat-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 17, 2026, 11:43 AM UTC

@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · f9315ae

Storybook · Sandbox · built from this PR's head

Current run: The current CI run concluded cancelled. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

… RichText

With flush rows the gutter's start padding moved numbered rows 16px in.
Without it, numbered and bulleted rows start on the column line, as
RichText's outside markers do. The bounds spec reads the paragraph's
block box as the column.
The removed gutter comment was Markdown.tsx's citation of AST-061 FR11; the
component record now links that claim, and the provenance baseline drops it.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 2026

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes. The code fix works: bulleted, numbered and mixed Markdown lists now stay inside their column, and markers and text do not move. The release note, title and description need to match what the change does.

  • The changeset and title say every Markdown list stays inside its column, but a list made only of task items still renders through CheckboxList with the -spacing-2 margin (taskListIndent, Markdown.tsx:650), so it still spans −8 to 398px and widens a 390px page; narrow the wording to bulleted and numbered lists, or fix the task path in this pull request.
  • The description says the published CSS put numbered rows 16px further in and that this change moves them, but in the package build the gutter's margin-inline-start rule already outranks the list's margin-inline, so numbered counters sit on the column line before and after the change (the base and head renders are pixel-identical); replace those two sentences with "numbered rows keep their positions in Storybook and in the package build".

The failing test-node shards stop on the Node suite's leg-time budget, which this change does not feed, so they need a fix on main or a re-run rather than a change here.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim: lists no longer reach 8px past both edges and no longer widen a phone page (changeset, title): false for pure task lists, true for bulleted, numbered and mixed lists (page 398px to 390px at 390px).
  • Claim: markers and text keep their positions (changeset): verified, base and head frames pixel-identical in Storybook and in the package build.
  • Claim: the negative inline margin made each list 16px wider than its column: verified (list box −8 to 398px at 390px).
  • Claim: edge="flush" drops the row inset: verified by listEdge.test.tsx, which fails on the base and passes on the head.
  • Claim: the numbered gutter pushed the list box past the start edge, the right edge in RTL: verified.
  • Claim: Storybook put numbered counters on the column line: verified.
  • Claim: the published CSS put numbered rows 16px further in, and this change moves them: false.
  • Claim: both builds now put counters on the column line: verified.
  • Claim: pure task lists keep their offset: verified.
  • Claim: one style change, no API or theme change: verified, the built API surface is unchanged.
  • Claim: Markdown and RichText text starts and nested insets stay matched: verified in the wide-number-marker parity story.
  • Claim: the Chromium bounds spec checks both directions at 390px: verified, it passes on the head.
  • Claim: the Markdown, List and CheckboxList unit suites pass and typecheck is clean: verified (65 files, 1802 tests; CI typecheck passes).
  • File .changeset/markdown-list-fits-column.md: finding (task lists).
  • File docs/specs/components/Markdown/Markdown.spec.md: clear (adds a link to an existing claim).
  • File internal/eslint-plugin-astryx/no-comment-provenance.baseline.json: clear (its --check passes).
  • File packages/core/src/Markdown/Markdown.tsx: clear in code; its task-list path bounds the changeset finding.
  • File packages/core/src/Markdown/__tests__/MarkdownListBounds.a11y.chromium.spec.ts: clear.
  • File packages/core/src/Markdown/listEdge.test.tsx: clear.

Automated review (maintainer link)

Comment thread .changeset/markdown-list-fits-column.md Resolved
@josephfarina josephfarina changed the title fix(Markdown): keep lists inside their column fix(Markdown): keep bulleted and numbered lists inside their column Nov 17, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. Bulleted, numbered and mixed Markdown lists now stay inside their column, markers and text do not move, and the release note, title and description now match what the change does.

CI is not green at this head for reasons outside this change: every test-node shard stops on the Node suite's leg-time budget, and one AlertDialog motion timing case failed in pr-interaction (4/6) after passing on the previous head with identical code. Those checks need a re-run or a fix on main before this can merge.

Claims and files checked

Review mode: incremental; reason: none

  • Claim: bulleted and numbered lists stay inside their column and no longer reach 8px past both edges (changeset, title): verified, list boxes go from −8…398px (numbered −24…398px) to 0…390px at 390px.
  • Claim: Markdown that fills a phone screen no longer scrolls sideways for those lists (changeset): verified, the page goes from 398px to 390px at 390px and from 383px to 375px at 375px.
  • Claim: markers and text keep their positions (changeset, description): verified, base and head frames are pixel-identical at 375, 390 and 1280px, mixed task and plain lists included.
  • Claim: the negative inline margin made each list 16px wider than its column: verified at the base.
  • Claim: task-only lists take a separate path that a follow-up pull request fixes: verified, they still render through the checkbox list with the old margin, and the follow-up is open.
  • Claim: the flush edge drops the row inset, as List's record requires: verified by the new unit test, which fails on the base and passes on the head; the quoted "works anywhere; suits static rows" comes from List's record summary and its prop docs rather than that rule's own text.
  • Claim: the numbered gutter pushed the list box past the start edge, the right edge in right-to-left: verified (−24px at the start, 414px on the right in an RTL document).
  • Claim: pure task lists keep their offset and the checkbox list has no edge choice: verified.
  • Claim: numbered rows keep their positions in Storybook and in the package build: verified, the built CSS resolves the gutter as Storybook does.
  • Claim: Markdown and RichText text starts and nested insets stay matched: verified, Markdown text starts are unchanged.
  • Claim: one style change in Markdown with no API or theme change: verified, the built API surface is unchanged.
  • Claim: the Chromium bounds spec checks both directions at 390px and no sideways scroll: verified, it passes on the head.
  • Claim: the Markdown, List and CheckboxList unit suites pass and typecheck is clean: verified (65 files, 1802 tests; CI typecheck passes).
  • Claim: no new API, default or interaction, and no internal context in public text: verified.
  • File .changeset/markdown-list-fits-column.md: clear.
  • File docs/specs/components/Markdown/Markdown.spec.md: clear (links an existing claim).
  • File internal/eslint-plugin-astryx/no-comment-provenance.baseline.json: clear (its check passes).
  • File packages/core/src/Markdown/Markdown.tsx: clear.
  • File packages/core/src/Markdown/__tests__/MarkdownListBounds.a11y.chromium.spec.ts: clear.
  • File packages/core/src/Markdown/listEdge.test.tsx: clear.

Automated review (maintainer link)

josephfarina added a commit that referenced this pull request Nov 19, 2026
- #12694 fix(cli): the Order Detail template's discount uses a minus sign held to its amount
  Author: @josephfarina
- #12114 fix(templates): reset, reply, send and go-into icons mirror in right-to-left pages
  Author: @josephfarina
- #12143 refactor(templates): example blocks lay out with HStack and VStack instead of flex wrappers
  Author: @josephfarina
- #12158 fix(core): ChatComposer keeps its send action inside the composer on a narrow screen
  Author: @josephfarina
- #12242 fix(cli): the npm commands the CLI runs for itself use npm's own noproxy setting
  Author: @josephfarina
- #12283 fix(core): dark secondary text meets 4.5:1 on the neutral fill over the page and cards
  Author: @josephfarina
- #12290 fix(Markdown): keep bulleted and numbered lists inside their column
  Author: @josephfarina
- #12372 [fix] Heading: a missing level renders an h2 and warns, instead of crashing
  Author: @josephfarina
- #12447 spec(AST-057): the swipe codemod's paths match it in any lifecycle folder
  Author: @josephfarina
- #12475 fix(templates): on a phone the settings search moves under the title
  Author: @josephfarina
- #12530 fix(cli): the contact-form template fits a phone; its section fills the width up to 800px
  Author: @josephfarina
@josephfarina

Copy link
Copy Markdown
Contributor Author

Landed in #12812.

@github-actions
github-actions Bot deleted the rl10-markdown-list-column branch November 19, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — f9315aeb Deployed Nov 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. needs:design-review Affects visuals — Design should review needs:spec-owner-review Current knowledge records await owner approval

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant