Skip to content

T-I630-md-ui-playground-e2e-perf

State: closed/done · Impact: high · Complexity: medium

The playground ships with smoke specs and a single proof-of-harness perf case; the performance budgets — a critical feature of the program — are otherwise unenforced, and nothing checks that every layer component keeps a story. This task lands the per-component e2e specs, the full perf budget matrix, the bundle-size gate, and a stories-coverage gate.

LocationRole today
packages/ts/ui/playwright.config.tsChromium + WebKit project shape the playground config copies
packages/ts/obsidian-md/test/fixtures/every-feature.mdFeature-complete fixture the vault pages reuse

The playground, its fixtures (vault/, large/lines-2000.md, large/lines-10000.md, large/bytes-600k.md), the perf harness (measure, collectLongTasks, heapUsed, withTrace), the smoke specs and the one-case perf.e2e.ts come from T-J92O-md-test-apps. Component pages and stories come from T-A0HT-md-ui-layer-skeleton, T-98EU-md-ui-toolbar-insert-frontmatter, T-8ZHI-md-ui-overlays-bubble-link-table and T-RJVA-md-ui-find-outline-hover-lifts.

Per-component e2e under packages/ts/markdown-ui/playground/tests/:

SpecCovers
surface.e2e.tsMode cycle via mod+shift+m (cursor and scroll preserved), mod+s emits save, / opens the slash list and applies a command, `
overlays.e2e.tsBubble on selection (and gone on collapse), link popover edit/apply, table menu row insert and alignment
find-bar.e2e.tsmd-find-* bar in read and live modes: query, count, next/prev, close

perf.e2e.ts grows from the one T-J92O case to the full budget matrix, one named test per row:

BudgetCase
Keystroke → paint p95 < 16 ms; viewport decoration rebuild < 8 msType 200 characters into large/lines-10000.md in live mode; p95 over the marks; trace saved via withTrace
Open large/bytes-600k.md in source mode < 500 msNavigation → first paint measure
Open large/lines-2000.md in live mode < 300 ms to first paintKept from [[T-J92O-md-test-apps
Mode switch (live ↔ source ↔ read) < 100 ms on large/lines-2000.mdEach direction measured
MdViewer render of large/lines-2000.md < 200 msShiki excluded (highlight off)
No long task > 50 ms during typingcollectLongTasks over the typing case
No memory growth across 100 note opensheapUsed after cycle 100 at most 1.2× the value after cycle 10

Bundle gate tests/bundle.test.ts behind a moon analyze task: builds the playground with rollup stats and asserts the layer + engines add less than 150 KB gzip to the entry chunk, and that mermaid, katex and shiki appear only in lazy chunks, never in the entry chunk.

Stories gate packages/ts/markdown-ui/tests/stories-coverage.test.ts: every packages/ts/markdown-ui/app/components/Md*.vue has a sibling .stories.ts, and bun run storybook:build stays green.

Budgets are starting points; tightening them as baselines land is expected and needs no new task.

  1. Write the four component specs against the existing pages; add page affordances (test ids, fixture selectors) where a spec needs them.
  2. Grow perf.e2e.ts to the matrix: one named test per budget row, each using the harness (measure, collectLongTasks, heapUsed, withTrace) and failing over budget; save the typing-case trace as an artifact.
  3. Add the analyze moon task and bundle.test.ts over the build stats.
  4. Add stories-coverage.test.ts in the layer.
  5. Run moon run markdown-ui-playground:e2e markdown-ui-playground:perf and the analyze task locally; record the measured values in the PR description alongside the budgets.
LocationKindChange
packages/ts/markdown-ui/playground/tests/surface.e2e.tsnewSurface, slash and completion spec
packages/ts/markdown-ui/playground/tests/toolbar.e2e.tsnewToolbar spec
packages/ts/markdown-ui/playground/tests/overlays.e2e.tsnewBubble, link popover, table menu spec
packages/ts/markdown-ui/playground/tests/find-bar.e2e.tsnewFind bar spec
packages/ts/markdown-ui/playground/tests/perf.e2e.tsnewCreated by T-J92O-md-test-apps; grows to the full budget matrix
packages/ts/markdown-ui/playground/tests/bundle.test.tsnewEntry-chunk gzip delta and lazy-chunk assertions
packages/ts/markdown-ui/playground/moon.ymlnewCreated by T-J92O-md-test-apps; gains the analyze task
packages/ts/markdown-ui/tests/stories-coverage.test.tsnewEvery Md*.vue has a story
  • AC-1: moon run markdown-ui-playground:e2e passes with the four specs named in the Proposed spec table.
  • AC-2: moon run markdown-ui-playground:perf runs one named test per row of the budget table above, and each fails when its measure exceeds its budget (thresholds asserted in the spec, not logged).
  • AC-3: the typing case saves a Chromium trace under the playground’s test-results/traces/.
  • AC-4: the long-task test records zero longtask entries over 50 ms while typing 200 characters, and the heap test holds heapUsed(100 cycles) <= 1.2 × heapUsed(10 cycles).
  • AC-5: bundle.test.ts asserts the entry-chunk gzip delta is under 150 KB and that mermaid, katex and shiki are absent from the entry chunk while present as lazy chunks.
  • AC-6: bun test packages/ts/markdown-ui/tests/stories-coverage.test.ts passes and fails when a Md*.vue story file is removed (negative case asserted with a temp fixture list).
  • AC-7: bun run storybook:build in the layer succeeds.

Member of milestone M-931L; the performance-budgets and test-apps sections of decision D-K3EM-markdown-editor-chrome-and-plugin-environment.

T-J92O-md-test-apps


← Back to Tasks