From daef13e8b7cde6458acaba3766e15ec3f7eb2a6b Mon Sep 17 00:00:00 2001 From: Jared Pereira Date: Sat, 13 Sep 2025 00:47:08 +0900 Subject: [PATCH] add undo/redo to commentbox --- .../[rkey]/Interactions/Comments/CommentBox.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/lish/[did]/[publication]/[rkey]/Interactions/Comments/CommentBox.tsx b/app/lish/[did]/[publication]/[rkey]/Interactions/Comments/CommentBox.tsx index f44a61ea..055a3853 100644 --- a/app/lish/[did]/[publication]/[rkey]/Interactions/Comments/CommentBox.tsx +++ b/app/lish/[did]/[publication]/[rkey]/Interactions/Comments/CommentBox.tsx @@ -7,6 +7,7 @@ import { keymap } from "prosemirror-keymap"; import { Mark, MarkType, Node } from "prosemirror-model"; import { EditorState, TextSelection } from "prosemirror-state"; import { EditorView } from "prosemirror-view"; +import { history, redo, undo } from "prosemirror-history"; import { MutableRefObject, RefObject, @@ -54,6 +55,9 @@ export function CommentBox(props: { "Meta-i": toggleMark(multiBlockSchema.marks.em), "Ctrl-i": toggleMark(multiBlockSchema.marks.em), "Ctrl-Meta-x": toggleMark(multiBlockSchema.marks.strikethrough), + "Mod-z": undo, + "Mod-y": redo, + "Shift-Mod-z": redo, }), keymap(baseKeymap), autolink({ @@ -61,6 +65,7 @@ export function CommentBox(props: { shouldAutoLink: () => true, defaultProtocol: "https", }), + history(), ], }), ); -- 2.54.0