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

Implement merge feature in Tree.Edit #681

Merged
merged 1 commit into from
Nov 3, 2023
Merged

Implement merge feature in Tree.Edit #681

merged 1 commit into from
Nov 3, 2023

Conversation

hackerwins
Copy link
Member

@hackerwins hackerwins commented Nov 2, 2023

What this PR does / why we need it?

Implement merge feature in Tree.Edit

In a text-based editor, when you have a selection that spans two paragraphs, if you press the delete key, removes the second paragraph and merges its children into the first paragraph.

For example:

  • Before: <p>a|b</p><p>c|d</p>
  • After: <p>ad</p>

This commit implements the merge to Tree.Edit.

Any background context you want to provide?

// TODO(hackerwins): Define more clearly mergeable rules between fromParent
// and toParent. For now, if fromParent and toParent are the same
// type, then we can merge them.

What are the relevant tickets?

Address yorkie-team/yorkie#662

Checklist

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

Copy link

codecov bot commented Nov 2, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (dd9be29) 67.92% compared to head (e571547) 67.86%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #681      +/-   ##
==========================================
- Coverage   67.92%   67.86%   -0.07%     
==========================================
  Files          58       58              
  Lines        8737     8747      +10     
  Branches      785      788       +3     
==========================================
+ Hits         5935     5936       +1     
- Misses       2545     2551       +6     
- Partials      257      260       +3     
Files Coverage Δ
src/document/crdt/tree.ts 84.58% <81.81%> (-0.17%) ⬇️

... and 1 file with indirect coverage changes

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

@hackerwins hackerwins force-pushed the tree-merge-split branch 5 times, most recently from d7a4b9e to f8ac3cf Compare November 2, 2023 11:01
@hackerwins hackerwins marked this pull request as ready for review November 2, 2023 11:01
@hackerwins hackerwins merged commit 462e3d5 into main Nov 3, 2023
2 checks passed
@hackerwins hackerwins deleted the tree-merge-split branch November 3, 2023 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant