fix(files): render the file-viewer placeholder through the live node views - #6379
Conversation
…views
The collaborative markdown viewer painted a static generateHTML placeholder while
the Yjs doc seeded, then swapped to the live editor. generateHTML runs only schema
renderHTML — never the React node views or the ProseMirror decoration plugins — so
every node whose live appearance comes from a node view or a decoration rendered
differently in the placeholder and visibly repainted on the swap: syntax highlighting
popped in, mention-chip icons shifted their labels, mermaid blocks jumped from source
to diagram, and media embeds appeared out of nowhere.
Render the placeholder through a read-only editor that shares the live editor's
extension set instead. It uses the same node views and decoration plugins, so the
placeholder is pixel-identical to the live editor and the swap neither repaints nor
reflows — highlighting, mention icons, images, mermaid (via its existing SVG cache),
and embeds (which already reserve their aspect-ratio box) all render up front. The
placeholder editor carries no Collaboration extension, Y.Doc, or awareness, so it
structurally cannot write to the shared document, preserving the seed-only-on-server
invariant; editable={false} disables every editing affordance.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview While the Yjs doc seeds, content is shown through a new Placeholder state moves from Reviewed by Cursor Bugbot for commit 98ed8bc. Configure here. |
Greptile SummaryThe PR replaces the collaborative markdown file viewer’s static HTML placeholder with a read-only TipTap editor using the live editor’s extensions and shared surface styling.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/rich-markdown-editor.tsx | Replaces static generated placeholder HTML with a non-editable editor and correctly resolves the previous named-props-interface feedback. |
Reviews (2): Last reviewed commit: "fix(files): address review on the placeh..." | Re-trigger Greptile
- Give ReadOnlyPlaceholder a named props interface (repo component convention). - Render the placeholder synchronously (immediatelyRender: true) so it paints instantly like the static HTML it replaced instead of blanking for a frame while the editor mounts — safe because this surface is client-only, never SSR'd. - Hoist the editor reading-column classes into a shared EDITOR_SURFACE_CLASS so the placeholder and live editor stay geometrically identical (drop the now redundant placeholderContent term from the live editor's hidden class).
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 98ed8bc. Configure here.
Summary
generateHTMLplaceholder while the Yjs doc seeded, then swapped to the live editor.generateHTMLruns only schemarenderHTML— never the React node views or decoration plugins — so content repainted on the swap: syntax highlighting popped in, mention-chip icons shifted their labels, mermaid blocks jumped from source to diagram, and media embeds appeared out of nowhere.editable={false}disables every editing affordance.Type of Change
Testing
Checklist