Context
bench-review needs a proper WYSIWYG editor for users (clerks) composing their reviews of judges. Per Chris's 2026-05-06 11:32 PM Discord drop:
"@glenn how we can cook up our own WYSIWYG editor for bench-review" "[stacksjs/ts-medium-editor]: A modern, minimal & performant Medium-like rich text editor" "we can extend this one imo"
So the path is: don't build a new editor from scratch — extend stacksjs/ts-medium-editor.
Why ts-medium-editor as the base
- It's ours — first-party, no foreign-dep cleanup later (per the standing "replace, don't just remove" rule).
- It's minimal + Medium-like, which matches what a long-form review composition surface needs (focused writing, inline formatting, embeds where useful, no kitchen-sink toolbar).
- Performant by design — bench-review is read-heavy with a non-trivial tail of compose sessions, so editor weight matters.
Scope
In scope (compose surface for a review):
- Inline formatting: bold, italic, blockquote, links.
- Block structure: paragraphs, lists (ordered/unordered), headings (h2/h3 only — h1 is the page title).
- Optional inline image / embed (TBD on hosting story — defer if it adds infra weight).
- Autosave drafts to local storage (and eventually server-side once the bench-review backend is ready).
- Mobile-friendly composition (most clerks aren't writing reviews from a desktop).
- Accessible (proper aria roles, keyboard shortcuts for formatting, screen-reader-friendly).
Out of scope (initially):
- Collaborative editing.
- Version history beyond a single draft + published version.
- Comments / inline annotations.
Acceptance
- Editor mounts in the bench-review compose page.
- Save flow round-trips: type a review → leave the page → come back → draft is restored.
- Renders the saved review back as clean, semantically correct HTML when displayed (no
<div>soup, no foreign editor classes leaking into the published view). - Works on iOS Safari + Android Chrome at minimum.
- Any gap surfaced in
ts-medium-editorlands as an upstream PR there, not as a fork in this repo.
Related
stacksjs/ts-medium-editor— the editor library being extended. File any upstream gaps as issues there.- Possible relation to
@stacksjs/components(if a<MediumEditor />stx component lands as part of the integration, it should live in@stacksjs/componentsonce stable).