Playground Updates#935
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e420a59a70
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| {viewMode === 'normal' ? ( | ||
| <EditorProvider editor={editor}>{fileDiff}</EditorProvider> | ||
| ) : viewMode === 'virtualizer' ? ( |
There was a problem hiding this comment.
Gate edit-mode retries to the normal view
When a user loads or shares a URL like /playground?view=virtualizer&edit=edit (the UI can create this by switching views while already in Edit), this branch never mounts the EditorProvider/FileDiff, but contentEditable remains true. The marker effect above then calls editor.setMarkers(...), catches Text document is not initialized, and schedules another requestAnimationFrame forever because the editor will never attach in Virtualizer/CodeView modes. Gate contentEditable/the marker retry on viewMode === 'normal' or reset edit mode when leaving Normal.
Useful? React with 👍 / 👎.
b364841 to
e3cf910
Compare
Also adds a test for it
It's important to test both versions
e3cf910 to
812a8c0
Compare
Working through adding modes for Virtualizer and CodeView in the Playground.