docs/slate-browser/api-reference-deep-research.md
Specialist testing/proof doc. For current queue and roadmap truth, see master-roadmap.md.
Proposed API research only. This file does not define the current shipped
slate-browsersurface.
This doc compares slate-browser against the local reference repos in
editor-architecture-candidates.md,
with the specific goal of improving the public testing API.
This is not a stack-ranking doc.
It is a focused API and test-lane design read:
Current public slate-browser shape in .tmp/slate-v2:
slate-browser/coreslate-browser/browserslate-browser/playwrightStrengths:
Weak spots:
openExample(...) is still too thin compared with the best reference setupsFiles read:
Best steals:
initialize(...)
assertHTML(...)
assertSelection(...)
withExclusiveClipboardAccess(...)
Important take:
slate-browser is not more helpersFiles read:
Best steals:
getEditablegetTextgetSelectiongetSelectedRectImportant take:
slate-browser should grow a get namespaceFiles read:
Best steals:
Important take:
slate-browser ever expands into native text surfaces or deeper IME
compensation, this is the right inspirationFiles read:
Best steals:
Important take:
slate-browser/browser crisp and narrowFiles read:
Best steals:
Important take:
slate-browser should eventually have an explicit accuracy/perf laneFiles read:
Best steals:
accuracy-checkbenchmark-checkImportant take:
slate-browser gets a perf/accuracy lane later, Pretext is the best
naming and command inspirationFiles read:
playwright/integration/examplesBest steals:
Important take:
openExample(...) centralFiles read:
Best steals:
updateinsertmovegetStateImportant take:
slate-browser could use a small imperative getter surface inspired by
getStateFiles read:
Take:
Files read:
Best steals:
Important take:
slate-browser command naming is already moving the right waytest:slate-browser:crosstest:slate-browser:perftest:slate-browser:accuracyFiles read:
Take:
Current gap:
slate-browser is too assertion-heavyBest next API:
await editor.get.text();
await editor.get.html();
await editor.get.selection();
await editor.get.domSelection();
Why:
Current gap:
editor.assert.html(...) is too ambiguousBest next API:
await editor.assert.htmlContains("<code>");
await editor.assert.htmlEquals(expectedHtml);
Why:
assertHTML(...) is stricter and better than our current
“contains” defaultCurrent gap:
Best next API:
await editor.clipboard.assert.text("hello");
await editor.clipboard.assert.htmlContains("<p>");
await editor.clipboard.assert.types(["text/plain", "text/html"]);
Current gap:
Best next API/utility:
withExclusiveClipboardAccess(...)This is likely the single highest-value improvement from the research pass.
openExample(...) a little smarterCurrent gap:
goto + immediate harness is a bit thinBest next shape:
const editor = await openExample(page, "placeholder", {
waitForPlaceholder: true,
});
Not a giant initializer blob. Just enough to guarantee readiness intentionally.
Current gap:
editor.selectAll() is useful but lonelyBest next shape:
await editor.selection.selectAll();
await editor.selection.get();
await editor.selection.rect();
No giant initialize(...) kitchen sink.
Lexical’s setup is powerful, but too broad to copy directly.
No fake fixture lane. Still not worth it.
No synthetic paste fallback as the public API. We now have a real browser path.
No cross-browser IME abstraction theater yet. Chromium-first is still the honest move.
After the deeper pass, the strongest improvements are:
openExample(...) readinessThe best parts of the reference field are:
Everything else is secondary.