fix(history): Align the system editing history group transforms for composition case #9

Closed
Matrixbirds wants to merge 1 commit from bugfix/fix-ime-input-prodecure into master
Matrixbirds commented 2023-07-13 08:06:24 +02:00 (Migrated from github.com)

Support composition case when typing with IME Pinyin case. it will save history in group by composition end

Support composition case when typing with IME Pinyin case. it will save history in group by composition end
marijnh commented 2023-07-13 09:11:33 +02:00 (Migrated from github.com)

Using mutable globals in state update logic is not okay. Could you describe the logic you're trying to implement and the problem you're trying to solve a bit more clearly?

Using mutable globals in state update logic is not okay. Could you describe the logic you're trying to implement and the problem you're trying to solve a bit more clearly?
Matrixbirds commented 2023-07-14 07:09:36 +02:00 (Migrated from github.com)

I am working on fixing a scenario related to Sougou Pinyin Chinese input integration. When using prosemirror-history with its default time-based grouping, as I type each character in Pinyin, the undo operation rolls back to the previous Pinyin letter state after confirming the candidate word. This behavior is inconsistent with the system editor's native behavior. Therefore, I need to introduce a temporary variable internally to generate a new group at the first "compositionstart" event and another new group at the first input event after the "compositionend" event. This way, the Pinyin input process can be combined into a single group for the Chinese characters output by the IME, and thus aligns with the system editor's behavior.

We can see the default editor behaviour in this video.

https://github.com/ProseMirror/prosemirror-history/assets/9990676/9e35b37a-7c98-469c-b0b8-fcd6ebba51eb

The system editor behaviour will ignore pinyin procedure by composition end, the expected undo operation is revert to empty content not revert to pinyin characters

I am working on fixing a scenario related to Sougou Pinyin Chinese input integration. When using prosemirror-history with its default time-based grouping, as I type each character in Pinyin, the undo operation rolls back to the previous Pinyin letter state after confirming the candidate word. This behavior is inconsistent with the system editor's native behavior. Therefore, I need to introduce a temporary variable internally to generate a new group at the first "compositionstart" event and another new group at the first input event after the "compositionend" event. This way, the Pinyin input process can be combined into a single group for the Chinese characters output by the IME, and thus aligns with the system editor's behavior. We can see the default editor behaviour in this video. https://github.com/ProseMirror/prosemirror-history/assets/9990676/9e35b37a-7c98-469c-b0b8-fcd6ebba51eb The system editor behaviour will ignore pinyin procedure by composition end, the expected undo operation is revert to empty content not revert to pinyin characters
marijnh commented 2023-07-17 12:01:56 +02:00 (Migrated from github.com)

Attached patch fixes the actual issue that was causing this.

Attached patch fixes the actual issue that was causing this.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
prosemirror/prosemirror-history!9
No description provided.