Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce basic architecture to support undo and redo #650

Merged
merged 32 commits into from
Sep 23, 2023
Merged

Conversation

hyemmie
Copy link
Contributor

@hyemmie hyemmie commented Sep 20, 2023

What this PR does / why we need it?

This is a new branch created by splitting commits related to only the basic architecture from PR #635.
It's the initial version of multi-user undo/redo implementation. For now, it's focusing on implementing an architecture to support undo/redo using liveblocks as a reference.

This PR contains these actions:

  • Document.History.Undo / Document.History.Redo
  • Add reverse operation of Presence.Set
  • Add reverse operation of Counter.Increase

The following tasks should be:

  • Implement the reverse operations of other datatypes such as Object.Set, Text.Edit and so on

Any background context you want to provide?

Additional information about multi-user undo/redo is at yorkie-team/yorkie#49.

What are the relevant tickets?

Address yorkie-team/yorkie#652

Checklist

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

@hyemmie hyemmie added the enhancement 🌟 New feature or request label Sep 20, 2023
@hyemmie hyemmie requested a review from hackerwins September 20, 2023 02:33
@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

Patch coverage: 97.36% and project coverage change: +0.31% 🎉

Comparison is base (52ffdbd) 88.88% compared to head (67a407b) 89.19%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #650      +/-   ##
==========================================
+ Coverage   88.88%   89.19%   +0.31%     
==========================================
  Files          80       79       -1     
  Lines        8958     9318     +360     
  Branches      825      856      +31     
==========================================
+ Hits         7962     8311     +349     
- Misses        688      694       +6     
- Partials      308      313       +5     
Files Changed Coverage Δ
test/unit/document/crdt/tree_test.ts 42.66% <ø> (ø)
src/document/operation/operation.ts 85.71% <75.00%> (-14.29%) ⬇️
src/document/history.ts 85.00% <85.00%> (ø)
src/document/document.ts 80.13% <91.30%> (+3.52%) ⬆️
src/document/change/change.ts 89.28% <100.00%> (+1.28%) ⬆️
src/document/change/context.ts 100.00% <100.00%> (ø)
src/document/operation/add_operation.ts 72.22% <100.00%> (ø)
src/document/operation/edit_operation.ts 62.06% <100.00%> (ø)
src/document/operation/increase_operation.ts 76.19% <100.00%> (+16.19%) ⬆️
src/document/operation/move_operation.ts 66.66% <100.00%> (ø)
... and 12 more

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hackerwins hackerwins marked this pull request as ready for review September 20, 2023 02:38
@hackerwins hackerwins force-pushed the undo-redo-basic branch 2 times, most recently from 7917aad to 2e87b88 Compare September 22, 2023 01:26
Copy link
Member

@hackerwins hackerwins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🌟 New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants