[diffs] Editable CodeView - #821
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
| // I assume once you merge the unified support, this won't be a requirement anymore | ||
| diffStyle: diffStyle === 'unified' ? 'split' : diffStyle, | ||
| useTokenTransformer: true, | ||
| expandUnchanged: true, |
There was a problem hiding this comment.
Do we HAVE to force expandUnchanged true?
There was a problem hiding this comment.
the page may jitter when editing with expand unchanged option. we can support this in the future?
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b310cf995b
ℹ️ 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".
| enableLineSelection: false, | ||
| enableGutterUtility: false, | ||
| // I assume once you merge the unified support, this won't be a requirement anymore | ||
| diffStyle: diffStyle === 'unified' ? 'split' : diffStyle, |
| enableGutterUtility: false, | ||
| // I assume once you merge the unified support, this won't be a requirement anymore | ||
| diffStyle: diffStyle === 'unified' ? 'split' : diffStyle, | ||
| useTokenTransformer: true, |
There was a problem hiding this comment.
How come this is necessary?
There was a problem hiding this comment.
the editor depends on the data-char attr for selection rendering
There was a problem hiding this comment.
and this only is required with worker pool
| lineHoverHighlight: 'disabled', | ||
| enableLineSelection: false, | ||
| enableGutterUtility: false, |
There was a problem hiding this comment.
I'd prefer not to toggle this globally for CodeView just to support editing, is there a way we can like let these options be whatever, but then disable the functionality while editing?
There was a problem hiding this comment.
yes, the editor will update the options and rerender if the option is not supported. you don't have to add these options.
b310cf9 to
b7d35f2
Compare
b7d35f2 to
08661be
Compare
| enableGutterUtility: false, | ||
| // I assume once you merge the unified support, this won't be a requirement anymore | ||
| diffStyle: diffStyle === 'unified' ? 'split' : diffStyle, | ||
| useTokenTransformer: true, |
There was a problem hiding this comment.
the editor depends on the data-char attr for selection rendering
| // I assume once you merge the unified support, this won't be a requirement anymore | ||
| diffStyle: diffStyle === 'unified' ? 'split' : diffStyle, | ||
| useTokenTransformer: true, | ||
| expandUnchanged: true, |
There was a problem hiding this comment.
the page may jitter when editing with expand unchanged option. we can support this in the future?
| lineHoverHighlight: 'disabled', | ||
| enableLineSelection: false, | ||
| enableGutterUtility: false, |
There was a problem hiding this comment.
yes, the editor will update the options and rerender if the option is not supported. you don't have to add these options.
| enableGutterUtility: false, | ||
| // I assume once you merge the unified support, this won't be a requirement anymore | ||
| diffStyle: diffStyle === 'unified' ? 'split' : diffStyle, | ||
| useTokenTransformer: true, |
There was a problem hiding this comment.
and this only is required with worker pool
| codeView.options = { | ||
| ...codeView.options, | ||
| // Ideally we don't do this... | ||
| diffStyle: diffStyle === 'unified' ? 'split' : diffStyle, |
94717e0 to
da2129f
Compare
08661be to
7530252
Compare
7530252 to
9d11eb9
Compare
9d11eb9 to
e7b982c
Compare
|
Closing this PR because I actually want to make the editing configuration a first class citizen, so this hack to get it working is not really relevant and should never merge. |
@ije this PR quickly adds an editable toggle to the CodeView demo and hooks it up. It kinda works but if you scroll down things stop working.
I think there's also a higher level API type question we need to resolve -- CodeView uses a shared options interface, so the way we are forcing options to be a certain configuration is not ideal in a CodeView environment and we might want to think about how to handle this.