Back to Plate

split-rich-text-viewer-pages

docs/plans/2026-05-28-split-rich-text-viewer-pages.md

53.0.86.4 KB
Original Source

split-rich-text-viewer-pages

Objective: Split the generated Evidence Kit rich-text viewer into two pages: a comparison page for apples-to-apples editor rows and a Slate v2 internals page for diagnostic rows that should not pretend to compare against other editors.

Goal plan: docs/plans/2026-05-28-split-rich-text-viewer-pages.md

Completion threshold: The split is complete when benchmarks/render-rich-text-viewer.mjs emits rich-text.html / rich-text-data.json for comparison rows and slate-v2-internals.html / slate-v2-internals-data.json for v2-only rows, generated checks pass, npm run check passes in benchmarks/editor, both served HTML routes return HTTP 200, served JSON proves there are no internal category leaks on the comparison page, and this plan passes the autogoal completion check.

Verification surface:

  • Generator: /Users/zbeyens/git/plate-2/benchmarks/editor/benchmarks/render-rich-text-viewer.mjs
  • Comparison output: /Users/zbeyens/git/plate-2/benchmarks/editor/docs/perf/rich-text.html
  • Comparison data: /Users/zbeyens/git/plate-2/benchmarks/editor/docs/perf/rich-text-data.json
  • Internals output: /Users/zbeyens/git/plate-2/benchmarks/editor/docs/perf/slate-v2-internals.html
  • Internals data: /Users/zbeyens/git/plate-2/benchmarks/editor/docs/perf/slate-v2-internals-data.json
  • Served routes: http://127.0.0.1:8765/rich-text.html and http://127.0.0.1:8765/slate-v2-internals.html

Constraints:

  • Keep the intentionally ugly js-framework-benchmark-style table.
  • Do not hide missing adapters on the comparison page.
  • Move only categories that are truly Slate v2 internal proof rows.
  • Keep one generator command so docs:perf and docs:perf:check stay simple.

Boundaries:

  • Source of truth: current Evidence Kit result benchmarks/results/rich-text-editors-latest.json.
  • Allowed edit scope: viewer generator, generated perf docs/data, and this plan.
  • External sources: N/A; local generated benchmark data settles the split.
  • Browser surface: static generated pages served from docs/perf on port 8765.
  • Tracker sync: N/A; no issue or PR requested.
  • Non-goals: adding new benchmark artifacts, changing the visual design, or renaming underlying benchmark categories.

Blocked condition: Work would stop only if generated rows could not be deterministically split, the generator could not check both page/data pairs, or the static server could not serve both routes. None of those happened.

Phase / pass table:

PhaseStatusEvidence
Source mapcompleteIdentified 16 Slate v2-only internal categories and comparison workload fixtures.
Generator splitcompleterender-rich-text-viewer.mjs now emits comparison and internals page/data pairs.
Generated docscompletedocs:rich-text wrote all four generated files.
Package verificationcompletenpm run check passed in benchmarks/editor.
Served proofcompleteBoth HTML routes returned HTTP 200 and both JSON routes had expected row/category counts.
ClosurecompleteThis file records evidence and passes check-complete.

Start Gates:

GateAppliesEvidence
Active goal checked or createdyesAutogoal created for the viewer split.
Source of truth read before editsyesRead current viewer generator, package scripts, and generated benchmark data shape.
Edit scope selectedyesOnly viewer generator, generated docs/data, and this plan changed for this task.
Browser route selectedyesrich-text.html and slate-v2-internals.html under the existing static server.
Browser tool decision recordedyesBrowser MCP was not exposed; HTTP served-route proof used against the same local target.

Work Checklist:

  • Objective includes outcome, completion threshold, verification surface, constraints, boundaries, and blocked condition.
  • Source data shape is mapped before editing.
  • Comparison rows and Slate v2 internals rows have explicit filters.
  • Generator emits both HTML and data JSON files in normal and check modes.
  • Generated docs are refreshed.
  • Package checks are green.
  • Served-route proof covers both pages and both data files.
  • Browser caveat is recorded.

Completion Gates:

GateAppliesRequired actionEvidence
Comparison page generatedyesGenerate rich-text.html and rich-text-data.jsonComparison JSON has 542 rows, 11 groups, and zero internal category leaks.
Internals page generatedyesGenerate slate-v2-internals.html and slate-v2-internals-data.jsonInternals JSON has 326 rows, 16 groups, and all expected internal categories.
Docs checkyesRun generated docs checknpm run docs:rich-text:check checked both page/data pairs.
Package checkyesRun package gatenpm run check passed in benchmarks/editor.
Served HTML proofyesHit both served HTML routesBoth returned HTTP 200.
Served JSON proofyesHit both served data routesJSON smoke proof returned expected split counts.
Goal plan completeyesRun autogoal completion checkcheck-complete passed.

Verification evidence:

  • cd benchmarks/editor && npm run docs:rich-text wrote rich-text.html, rich-text-data.json, slate-v2-internals.html, and slate-v2-internals-data.json.
  • Local generated-data proof: comparison page has 542 rows, 11 groups, and no internal category leaks.
  • Local generated-data proof: internals page has 326 rows, 16 groups, and all expected internal categories.
  • cd benchmarks/editor && npm run docs:rich-text:check passed and checked both page/data pairs.
  • cd benchmarks/editor && npm run check passed.
  • Served proof: curl -I --max-time 2 http://127.0.0.1:8765/rich-text.html returned HTTP 200.
  • Served proof: curl -I --max-time 2 http://127.0.0.1:8765/slate-v2-internals.html returned HTTP 200.
  • Served JSON proof: comparison data returned 542 rows, 11 groups, and internalLeaks: [].
  • Served JSON proof: internals data returned 326 rows, 16 groups, and missingExpectedInternalCategories: [].

Reboot status: Complete. rich-text.html is the comparison page; slate-v2-internals.html is the v2-only proof page. Both are generated by npm run docs:rich-text.

Open risks: The category split is manually curated in the generator. If new Slate v2-only categories are added later, they must be added to the internal category set or they will appear on the comparison page.