-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes --- There are a lot of changes! Replacing just draft.js was not too difficult but it involved a couple of larger changes: - Store and render comments at JSON. We're currently storing comments as markdown. The tiptap docs have [quite a bit to say about that](https://tiptap.dev/guide/output#not-an-option-markdown). The TL;DR is that tiptap will only output in JSON or HTML. JSON makes much more sense to me, since it's easier to do parsing/traversing and validation. Hopefully, we'll never have to manually do that, but if we ever *did*, I would much rather do it over JSON than HTML. - Because we are now storing and displaying comments as JSON, we *always* render comments in the editor, even if they are not currently editable. This involves swapping around quite a lot of stuff inside of Transcript, but I think overall it's gotten easier to read/manage. Other Changes --- - Our types for comments are super interesting. I've changed things up a bit, pulling out an interface that Reply and Comment have in common, which I've called `Remark`. It's not used that often, but it's nice to have a shorthand. - `PendingComment` and `PendingReply` are now just type aliases to `Partial<Comment>` and `Partial<Reply>`. I think this makes sense? So all fields are valid, but all of them also might not be there. - Sort comments first by their video time, but then by the time they were created. When you have multiple comments at the same pause, replying to them can cause their order to change in the UI. This is a bit of an edge case but adding a stable tie-break to the sort avoids it. - Add `tiptap` and some extensions. I have not added mention support completely, although I did POC it locally and it was good, though needed some design help. - Remove all `Draft.js` code. - Try to reduce the complexity in `Transcript` rendering. I am 95% sure that I could have taken this further, but this has been a quagmire of a change for two tricky reasons which I'll mention below, so I'm leaving this for another time. Places I Got Stuck --- - This is a silly one, but it was really hard to get `tiptap` to submit on hitting `Enter`. The docs about [overriding shortcuts](https://tiptap.dev/guide/output#not-an-option-markdown) did not work at all for me, nor did the answer to this [issue](ueberdosis/tiptap#207) which has a bunch of thumbsups. This makes me think that something changed in tiptap recently, because I had to do this: ``` Extension.create({ name: "myCustomPlugin", addKeyboardShortcuts() { return { Enter: ({ editor }) => { //override code goes here return true; }, }; }, }), ``` This is *similar* to the docs, and to that issue answer, but it's just a *bit* different, and for some reason this works and the others did not \*shrug\*. - Apollo optimistic updates failed silently. I have still not totally traced down the cause of this, but I'm *fairly* sure that it was caused by the `update` entry of a mutation that was writing an object to the Apollo cache without correctly setting all of the required fields and `__typename`. Again, maybe with more time I could get a more satisfying explanation, but for now I would rather just get this out. --- Closes https://github.com/RecordReplay/devtools/issues/3735
- Loading branch information
Showing
23 changed files
with
1,323 additions
and
1,414 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
78b27d8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: