yorkie-js-sdk icon indicating copy to clipboard operation
yorkie-js-sdk copied to clipboard

Update EditReverse operation to support undo and redo on Text.edit

Open hyemmie opened this issue 1 year ago • 1 comments

What this PR does / why we need it?

This PR reflects the changes to implement undo & redo in text.edit. The previous method, implemented in feat/undo-redo-arch focused on local index to create an EditReverse. However, this method has several side effects, so I changed it to generate an EditReverse based on the global NodeID.

Any background context you want to provide?

What are the relevant tickets?

Fixes #

Checklist

  • [x] Added relevant tests or not required
  • [ ] Didn't break anything

hyemmie avatar Sep 15 '23 09:09 hyemmie

Codecov Report

Patch coverage: 36.71% and project coverage change: -2.89% :warning:

Comparison is base (0fcc07f) 89.16% compared to head (9fc9ab8) 86.27%.

:exclamation: Current head 9fc9ab8 differs from pull request most recent head 5716e26. Consider uploading reports for the commit 5716e26 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #649      +/-   ##
==========================================
- Coverage   89.16%   86.27%   -2.89%     
==========================================
  Files          79       80       +1     
  Lines        9318     9732     +414     
  Branches      856      882      +26     
==========================================
+ Hits         8308     8396      +88     
- Misses        697     1013     +316     
- Partials      313      323      +10     
Files Changed Coverage Δ
src/document/presence/presence.ts 100.00% <ø> (ø)
src/api/converter.ts 83.75% <6.12%> (-7.07%) :arrow_down:
test/integration/text_test.ts 62.78% <6.45%> (-36.30%) :arrow_down:
src/document/operation/edit_reverse_operation.ts 43.33% <43.33%> (ø)
src/document/document.ts 80.44% <71.42%> (-0.34%) :arrow_down:
src/document/crdt/rga_tree_split.ts 90.93% <88.37%> (-0.58%) :arrow_down:
src/document/crdt/text.ts 91.17% <100.00%> (+1.17%) :arrow_up:
src/document/json/text.ts 37.87% <100.00%> (ø)
src/document/operation/edit_operation.ts 64.51% <100.00%> (+2.44%) :arrow_up:
test/integration/counter_test.ts 94.51% <100.00%> (+0.03%) :arrow_up:
... and 2 more

... and 1 file with indirect coverage changes

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Sep 25 '23 03:09 codecov[bot]