Add splice method to TreeArrayNode#26740
Open
brrichards wants to merge 6 commits intomicrosoft:mainfrom
Open
Conversation
Abe27342
reviewed
Mar 16, 2026
packages/dds/tree/src/simple-tree/node-kinds/array/arrayNode.ts
Outdated
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new splice API to TreeArrayNode to support combined remove/insert operations with Array.prototype.splice-like behavior, including negative start indices and optional deleteCount, and updates the public API surface accordingly.
Changes:
- Adds
TreeArrayNode.spliceto the public interface and implements it inarrayNode.ts(wrapping hydrated edits in a transaction). - Adds unit tests covering several
splicescenarios. - Updates API reports and adds a changeset entry documenting the new API.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/dds/tree/src/test/simple-tree/node-kinds/arrayNode.spec.ts | Adds new splice test cases for array nodes |
| packages/dds/tree/src/simple-tree/node-kinds/array/arrayNode.ts | Adds splice to the interface and implements the method |
| packages/dds/tree/api-report/tree.public.api.md | Updates public API report to include splice |
| packages/dds/tree/api-report/tree.legacy.public.api.md | Updates legacy public API report to include splice |
| packages/dds/tree/api-report/tree.legacy.beta.api.md | Updates legacy beta API report to include splice |
| packages/dds/tree/api-report/tree.beta.api.md | Updates beta API report to include splice |
| packages/dds/tree/api-report/tree.alpha.api.md | Updates alpha API report to include splice |
| .changeset/plain-tires-melt.md | Adds a minor changeset describing the new splice method and usage |
packages/dds/tree/src/test/simple-tree/node-kinds/arrayNode.spec.ts
Outdated
Show resolved
Hide resolved
packages/dds/tree/src/test/simple-tree/node-kinds/arrayNode.spec.ts
Outdated
Show resolved
Hide resolved
brrichards
commented
Mar 16, 2026
5839e19 to
f5e0b9d
Compare
Contributor
|
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
splicemethod toTreeArrayNodethat followsArray.prototype.splicesemantics. Supports removing and inserting items in a single opertaion, with optionaldeleteCountand negativestartindices. Wraps remove + insert in a transaction for hydrated nodes to enable atomic undo/redo.