Skip to content

[docs-infra] Demo Screenshots as OpenGraph Images#1301

Draft
dav-is wants to merge 5 commits intodocs-infra/improve-live-editingfrom
docs-infra/demo-screenshots
Draft

[docs-infra] Demo Screenshots as OpenGraph Images#1301
dav-is wants to merge 5 commits intodocs-infra/improve-live-editingfrom
docs-infra/demo-screenshots

Conversation

@dav-is
Copy link
Copy Markdown
Member

@dav-is dav-is commented Apr 10, 2026

Note

Based on #1232

Update screenshots using pnpm docs:screenshot.

See in GitHub

Uses regular playwright test format added to docs/app/docs-infra/components/code-highlighter/demos/demo-variants/test.ts:

test('code highlighter with multiple variants', async ({ page }) => {
  await page.goto(route);
  await page.waitForLoadState('networkidle');

  // open the variant selector
  await page.getByRole('combobox').click();

  await page
    .locator('.demo')
    .first()
    /* file://./../../../../../../public/docs-infra/components/code-highlighter/demos/demo-variants.png */
    .screenshot({ path: `public/${route}.png` });
});

By adding the file:// in a comment, Ctrl+Clicking to open the image works in VS Code.

Then add the screenshot as the OpenGraph image at the bottom of the page:

export const metadata =
  /** @type {import('@mui/internal-docs-infra/createSitemap/types').NextMetadata} */ ({
    openGraph: {
      images: [
        {
          /* file://./../../../../public/docs-infra/components/code-highlighter/demos/demo-variants.png */
          url: '/docs-infra/components/code-highlighter/demos/demo-variants.png',
          alt: 'Highlighted Code with Variants',
        },
      ],
    },
  });

Displayed in Pages Index:

image

Renders nicely on GitHub:

image

Renders in rich diff mode:

image

@dav-is dav-is added type: new feature Expand the scope of the product to solve a new problem. scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305). labels Apr 10, 2026
@code-infra-dashboard
Copy link
Copy Markdown

code-infra-dashboard Bot commented Apr 10, 2026

Deploy preview

Bundle size

Bundle Parsed size Gzip size
@base-ui/react 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)

Details of bundle changes

Performance

Total duration: 15.47 ms ▼-1.18 ms(-7.1%) | Renders: 4 (+0) | Paint: 65.80 ms ▼-7.22 ms(-9.9%)

Test Duration Renders
DataGrid mount with paint timing 2.09 ms ▼-0.58 ms(-21.8%) 1 (+0)
HeavyList mount 9.21 ms ▼-0.56 ms(-5.8%) 1 (+0)
Counter click 4.17 ms ▼-0.04 ms(-0.9%) 2 (+0)

Details of benchmark changes


Check out the code infra dashboard for more information about this PR.

@dav-is dav-is changed the base branch from docs-infra/improve-live-editing to master April 10, 2026 21:43
@dav-is dav-is changed the base branch from master to docs-infra/improve-live-editing April 10, 2026 21:46
@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Apr 16, 2026
@github-actions github-actions Bot added PR: out-of-date The pull request has merge conflicts and can't be merged. and removed PR: out-of-date The pull request has merge conflicts and can't be merged. labels Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: out-of-date The pull request has merge conflicts and can't be merged. scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305). type: new feature Expand the scope of the product to solve a new problem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant