Skip to content

perf(demos): paint the Skill page demo from its first screen - #504

Merged
harlan-zw merged 2 commits into
mainfrom
perf/skill-demo-poster
Oct 7, 2026
Merged

harlan-zw merged 2 commits into
mainfrom
perf/skill-demo-poster

Conversation

@harlan-zw

Copy link
Copy Markdown
Collaborator

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

On a Skill page with a page demo, the largest paint was the demo's full-page screenshot. It loaded lazily, and it ran up to 6000 pixels tall, though the window shows one screen of it.

  • The recorder keeps a poster. For a page taller than one screen, scripts/record-skill-demo.ts also saves the first screen at viewport height, per viewport. The manifest stores it as shots[].poster.
  • The Skill page paints the poster first. _SkillDemoShot.vue loads it eagerly with fetchpriority="high". The box keeps the whole page's height, so the window scrolls at once, and the first scroll fetches the full shot on top. The twin window for the other screen size resolves to an empty pixel through <picture>, so it downloads nothing.
  • Backfill. The seven page demos taller than one screen were reshot with pnpm demo:record <ref> --reshoot. The six that fit one screen need no poster and stay as they were.

/gh/anthropics/skills/frontend-design, local pnpm build served by wrangler dev, Lighthouse 13.5, cold cache, median of 3 runs:

Form LCP image LCP Score Page weight
Mobile 273 kB lazy → 44 kB eager 7.3 → 6.6 s 54 → 58 864 → 641 kB
Desktop 396 kB lazy → 93 kB eager 1.7 → 1.2 s 92 → 95 985 → 690 kB

Mobile LCP is still mostly render delay behind the stylesheets and scripts that #500 trims.

🤖 AI disclosure: Harlan Agent Kit modified this description. My AI open-source policy.

The Skill page's largest paint was a lazy full-page screenshot, up to 6000 pixels tall. The recorder now keeps a first-screen poster for a taller page. The page loads it eagerly at high priority and fetches the whole page only when the window scrolls.
Retaken with pnpm demo:record --reshoot from each kept output. Demos one screen tall need no poster and stay as they were.
@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. labels Oct 6, 2026
@harlan-github-agent

harlan-github-agent Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🤖 MERGED

Harlan Agent Kit posted this automated review. It is not Harlan's personal review or approval. AI open source policy. Last updated: 2026-10-07 01:10 UTC.

GitHub merged this pull request.

  • Logged (40/100): A pre-hydration scroll of the demo window leaves the full screenshot unloaded until the user scrolls again. View code
    • Ask an agent to verify and fix this finding

f3ee7b6c-3df6-4785-9eef-0ee183210bdb

Selected findings run after merge and open separate pull requests.

@harlan-github-agent harlan-github-agent Bot added harlan-agent-ready The automated Review passed every gate on this head commit. and removed harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. labels Oct 6, 2026

@harlan-github-agent harlan-github-agent 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.

Harlan Agent Kit posted this automated review. AI open source policy.

Automated Review: READY.

Read the Review results

@harlan-zw
harlan-zw merged commit d591cb1 into main Oct 7, 2026
7 checks passed
@harlan-zw
harlan-zw deleted the perf/skill-demo-poster branch October 7, 2026 01:01
@harlan-github-agent harlan-github-agent Bot removed the harlan-agent-ready The automated Review passed every gate on this head commit. label Oct 7, 2026
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.

1 participant