Skip to content

Instantly share code, notes, and snippets.

@alexlazarian
Created May 4, 2026 16:38
Show Gist options
  • Select an option

  • Save alexlazarian/a524370f146af981c821a09c1557879d to your computer and use it in GitHub Desktop.

Select an option

Save alexlazarian/a524370f146af981c821a09c1557879d to your computer and use it in GitHub Desktop.
JUS-1204 Select Editor Migration — Status (2026-05-01)

JUS-1204 — Select editor migration: checkpoint 1

Date: 2026-05-01 Branch: alexlazarian/JUS-1204-followup-select (off main) Status: 5 of 15 surfaces migrated. Launchpad fully done at code level. Ready for browser verification.

What landed

Three commits on the branch:

  1. JUS-1204: add Select editor migration scope doc — full per-surface scope, risk, and migration order.
  2. JUS-1204(jb-ui): underlineAsSpan + re-export Editor type — shared editor enhancement (opt-in) plus type re-export so domains don't need direct @tiptap/react deps.
  3. JUS-1204(launchpad): migrate 5 surfaces to shared RichTextEditor — FAQ topic content, AI Prompt system instructions, Organization description, Attorney overview/pro_bono, Attorney notable records.

A new shared component LaunchpadRichTextField covers four of the five launchpad surfaces; FAQ keeps a bespoke FaqContentField because of the fade-to-card-on-blur autosave pattern.

Where to verify (Launchpad)

Launchpad runs at https://launchpad.localhost:3443. After login:

  • FAQ topic content → FAQ manage page → click into a topic content card to enter edit mode.
  • AI Prompt system_instructions/ai/prompts/<id> (or new prompt page).
  • Organization description/organizations/<uid> General Info tab.
  • Attorney overview / pro_bono / notable records/organizations/<uid>/attorneys/new or any existing attorney edit page.

Things to watch for on each surface:

  • Bold / italic / underline / lists / link / table all save and re-render correctly.
  • Underline survives a save round-trip (it's the highest-risk format — backend sanitizers strip <u>, so the editor now emits <span style="text-decoration: underline">).
  • Counter updates as you type; matches Yup validation cap (5000 / 10000 / 3000 / 2000-1000 / 500 respectively).
  • For FAQ specifically: clicking outside the editor fades the card back to read-only.

Risky areas (in priority order)

  1. Underline round-trip across all sanitizers. Decision was to keep underline as a <span style> so the existing Rails allow-lists let it through — but this is a new code path with new tests in jb-ui. Worth a manual check on each surface that bolds/italicizes/underlines a word, saves, reloads the page, and confirms the underline is still there.

  2. Rate Review portal regression. The shared RichTextEditor got two new optional props (underlineAsSpan, RichTextEditorInstance type re-export). Defaults are unchanged; Rate Review opts out by simply not passing the new prop. But the Tiptap underline mark code path runs slightly differently when opted-in — Rate Review should be smoke-checked once for any change.

  3. FAQ fade-back-to-card timing. The new FaqContentField listens to Tiptap editor.on('blur', …) to drive the fade-back-to-read-only behaviour. The original code wired this via <TinymceEditor onBlur=…>. Different event source — needs a manual click-out test.

  4. Notable records FieldArray performance. Surface 11 mounts N Tiptap editors (one per notable record) on the attorney form. Tiptap's per-editor cost is higher than TinyMCE inline mode. Plan flagged a perf check at ~20 instances. Not yet tested.

  5. Bid + messaging surfaces are NOT migrated yet. Anyone touching bid/setup/pages/InformationRequest, Award/UnsuccessfulEmail, Participation/Invitation, bidder_workflow text answers, messaging_connector gem MessageForm, or messaging app MessageForm should know that those still use TinyMCE and migration to Tiptap is upcoming.

Not yet done

  • 7 bid surfaces (scorecard description, question title/body, summary body, invitation, award email, unsuccessful email, bidder text answer).
  • 2 messaging surfaces (gem + app).
  • Cleanup commit dropping tinymce / @tinymce/tinymce-react from 4 package.json files and deleting the legacy wrappers (EditorField, TinymceField, TinymceEditor × 4 copies).
  • Browser verification on the 5 launchpad surfaces above.

Open questions still in flight

  • Sanitizer-vs-Tiptap-table allow-list audit (Surface 3 — Bid question body). Not blocking the launchpad work but blocks the bid migration.
  • Tiptap multi-instance perf at scale on Notable Records.
  • text.coffee vs Text.jsx — confirmed both paths exist live in Bid for different bidder flows; text.coffee migration still required (it's the rich-text path).

How to revert

Each surface migration is one or two files. Revert by git revert of the surface's commit. The shared editor change (underlineAsSpan prop) is non-breaking; reverting it would require re-baselining surfaces, so it's the foundation that stays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment