Skip to content

feat(Markdown): add document presentation - #6664

Closed
ernestt wants to merge 1 commit into
markdown-upgrade/08-table-scroll-ownerfrom
markdown-upgrade/09-document-presentation
Closed

ernestt wants to merge 1 commit into
markdown-upgrade/08-table-scroll-ownerfrom
markdown-upgrade/09-document-presentation

Conversation

@ernestt

@ernestt ernestt commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

User need

Long-form Markdown can opt into readable document typography, centered measure, heading scroll clearance, and grid table dividers without changing parsing.

Problem and solution fit

The default presentation is intentionally neutral and composition-friendly, but long-form documents need a coherent reading treatment. A presentation-only variant supplies that treatment without inventing syntax or overriding explicit layout props.

Current specification

The Markdown component contract's opt-in document-presentation clause. Pinned source.

Public delta and caller burden

Add block-only variant="document"; explicit width, alignment, density, and heading-level settings continue to win, and omission preserves released output.

Design and alternatives

The capability is explicit and opt-in where it changes syntax, rendering, or package weight. Existing defaults and replacement seams remain compatible; broader alternatives stay outside this PR.

Evidence

Real-browser evidence

Document presentation before and after at desktop width

Document presentation before and after at narrow width

Focused behavior and compatibility coverage ships with the implementation.

Scope

  • One capability is added.
  • Unrelated fixes and policy changes were split into adjacent stack entries.
  • Consumer docs and focused tests ship with the feature.
  • Public text and artifacts contain no internal context.

Testing

  • Focused: Public types, default/opt-in rendering, explicit overrides, inline rejection, table/heading treatment, and Storybook coverage.
  • Stack head: pnpm exec vitest run packages/core/src/Markdown packages/core/src/CodeBlock — 37 files, 760 tests.
  • Stack head: pnpm --filter @astryxdesign/core typecheck.
  • Repository checks: pnpm check:repo.

Stack

Previous: #6663 · Next: #6665 · Each PR is intentionally one commit and one primary intent.

@vercel

vercel Bot commented Sep 26, 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 Sep 26, 2026 3:09pm UTC

Request Review

@ernestt ernestt mentioned this pull request Sep 26, 2026
4 tasks done
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 26, 2026
@ernestt ernestt mentioned this pull request Sep 26, 2026
4 tasks done
@astracat-bot

astracat-bot Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
📝 Draft — not reviewed automatically (for maintainers only) Sep 28, 2026, 6:47 PM UTC

@ernestt

ernestt commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

@cixzhang — I’d appreciate your feedback on this draft.

Focus: Long-form Markdown can opt into readable document typography, centered measure, heading scroll clearance, and grid table dividers without changing parsing.

This is PR 9/20 in the linked Markdown stack. It is intentionally one commit and one primary intent; the description includes matched before/after screenshots and previous/next links, so you can review just this PR’s delta.

@humbertovirtudes humbertovirtudes 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.

This introduces a new exported Markdown variant, but its only contract admission is FR29 added in the same PR. Please land the owner-approved authority decision first and rebase the implementation. Also make the block-only combination unrepresentable in TypeScript, preserve the released default-path handling of contentWidth={0} unless separately authorised, move stylex.createTheme into a .stylex.ts module, and add browser evidence for typography, geometry, scroll clearance, and grid dividers.

@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

Preview availability: Storybook and Sandbox are not both ready on the exact-head Vercel preview. CI concluded failure.

Modified Components

Outline (@astryxdesign/core)
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 717 -
Complexity N/A High (28) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.9KB 1.2KB

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

2 of 420 shot(s) changed. View the report

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
Markdown Default probe dark 29,661
Markdown Default probe light 29,652
Markdown — Default — probe dark
BeforeAfterDiff
Before visual regression frame After visual regression frame Pixel difference frame
Markdown — Default — probe light
BeforeAfterDiff
Before visual regression frame After visual regression frame Pixel difference frame

Generated by PR Enrichment workflow | View full report

@github-actions
github-actions Bot deleted the branch markdown-upgrade/08-table-scroll-owner October 6, 2026 06:25
@ernestt ernestt closed this Oct 9, 2026
@github-actions
github-actions Bot deleted the markdown-upgrade/09-document-presentation branch October 10, 2026 06:22

This branch was successfully deployed

1 active deployment
Preview — d9353ba6 Deployed Sep 26, 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:spec-owner-review Current knowledge records await owner approval

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants