fix(files): stop markdown reflow on open by matching placeholder wrapping to the editor - #6285
Merged
Merged
Conversation
…ping to the editor
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryCursor Bugbot is generating a summary for commit 47ee107. Configure here. |
Contributor
Greptile SummaryThis PR adds the
Confidence Score: 5/5The PR appears safe to merge with no actionable defects identified. The placeholder receives the intended ProseMirror text-layout styles while the hidden live editor continues to seed normally, and no current selector or interaction path is disrupted by the additional class.
|
| Filename | Overview |
|---|---|
| apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/rich-markdown-editor.tsx | Adds the live editor’s base ProseMirror styling class to the temporary read-only placeholder; no actionable regression was identified. |
Reviews (1): Last reviewed commit: "fix(files): stop markdown reflow on open..." | Re-trigger Greptile
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.
Summary
placeholderHtmlwhile the Yjs doc seeds, then swap to the live TipTap editor. The placeholder was.rich-markdown-proseonly (browser-defaultwhite-space: normal), but the live editable is.ProseMirror.rich-markdown-prose, andprosemirror-viewsetswhite-space: break-spacesand disables ligatures on.ProseMirror. Different wrapping model → identical text wraps at a different point → the visible re-wrap on the swap.ProseMirrorclass as the live editable, so both share the exact base text layout and wrap identically. One class added; no width/scrollbar/font changes.Type of Change
Testing
prosemirror-view/style/prosemirror.csssetswhite-space: break-spaces+font-variant-ligatures: noneon.ProseMirror, and the placeholder lacked both. Both render sites already share width (max-w-[48rem] px-8), ruling out container width; ruled out scrollbar (macOS overlay scrollbars take no layout width) and font-swap (the bug repros on refresh with the font cached).Checklist