Repository navigation
perf(editor): mount TipTap editors after the navigation paint - #58
Open
bhackett1024 wants to merge 1 commit into
Open
bhackett1024 wants to merge 1 commit into
bhackett1024 wants to merge 1 commit into
Conversation
Opening an issue mounted two TipTap editors (description and comment composer) inside the navigation commit. Editor creation costs ~20ms of synchronous main-thread work per instance, so the detail page could not paint for ~53ms — about three dropped frames — on every issue open (bug-mupr5tsb-7yuz). Editors now wait for the navigation frame to actually paint (double rAF) before mounting. While deferred, the shell renders a static preview of the same chrome: a toolbar skeleton reserving its exact height, and the description HTML (or TipTap's empty-placeholder paragraph markup) so the swap is pixel-identical. The change is confined to the editor impl chunk so it stays independent of the in-flight chunk-splitting work (#57). Co-authored-by: Brian Hackett <bhackett@replay.io>
bhackett1024
marked this pull request as ready for review
October 1, 2026 17:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Opening an issue stuttered: navigating from the Issues list to the detail page delivered one synchronous 52.6ms commit (~3 dropped frames), 83.8% of it from mounting two TipTap/ProseMirror editors — the description editor and the comment composer — whose
useEditorinitialization costs ~20ms of synchronous main-thread work per instance. PR #56 moved the editor download off the critical path, but with the chunk cached every issue open still paid the mount cost inside the navigation frame. Report: bug-mupr5tsb-7yuz.What
Editors now wait for the navigation frame to actually paint (double
requestAnimationFrame) before mounting, insideRichTextEditorImpl. While deferred, the shell renders a static preview of the same chrome:dangerouslySetInnerHTML— the same trust model as the editor itself and ActivityFeed's comment rendering — or, for an empty document, TipTap's own placeholder paragraph markup (p.is-editor-empty[data-placeholder]) so the placeholder text is present during the swap.Trade-off: the interactive editor arrives 1–2 frames after the page paints, instead of the page waiting ~3 frames to paint at all. Alternatives rejected: wrapping the navigation state in a transition (does not remove the synchronous editor-effect cost from the commit) and click-to-edit descriptions (changes product behavior).
How to Review
src/components/ui/RichTextEditorImpl.tsx— deliberately zero overlap with PR perf(bundle): code-split the Tiptap editor stack out of the eager bundle #57's in-flight chunk-splitting refactor (wrapper + consumer files).immediatelyRender: falseand its destroy-timer rationale (bug-mun3jox6-810l) are preserved; the deferral gates mounting the component, not the editor creation race.className, and the dialog does not autofocus the editor.Verification
npm run lintandnpm run build(tsc -b + vite) green locally; the editor impl still builds as its own lazy chunk.Human author: Brian Hackett (bhackett@replay.io)
🔗 Obvious Project · 🧵 Obvious Thread · 🔀 Obvious PR Artifact