Skip to content

EditableTree: Implement editable fields with new cursor#12621

Merged
CraigMacomber merged 22 commits into
microsoft:mainfrom
sharptrip:editable-sequence
Oct 27, 2022
Merged

EditableTree: Implement editable fields with new cursor#12621
CraigMacomber merged 22 commits into
microsoft:mainfrom
sharptrip:editable-sequence

Conversation

@sharptrip
Copy link
Copy Markdown
Contributor

@sharptrip sharptrip commented Oct 21, 2022

Same as #12488, but using a new cursor API.

Description

This PR implements EditableField as an array-like sequence of nodes (EditableTrees), which

  1. replaces handling of sequence fields with arrays,
  2. allows to access nodes lazily by their indices with and without unwrapping, and
  3. is a required change to implement editing of EditableTree.

Reviewer Guidance

Everything around "root" probably might be considered as a workaround as currently cursor.getPath() and anchors do not support fields.

Also, it seems that "primaryField" property of FieldProxyTarget is redundant, as fieldKey is also there, but it adds clarity, and we might make use of it when implementing editing.

Other information or known dependencies

Step 4 in a series to push code from #12182 to enable editing of EditableTree.

Step 3
Step 2
Step 1

@sharptrip sharptrip requested a review from a team as a code owner October 21, 2022 15:21
@github-actions github-actions Bot added area: dds Issues related to distributed data structures public api change Changes to a public API labels Oct 21, 2022
@sharptrip sharptrip changed the title Implement editable fields with new cursor EditableTree: Implement editable fields with new cursor Oct 21, 2022
@github-actions github-actions Bot added the base: main PRs targeted against main branch label Oct 21, 2022
Comment thread packages/dds/tree/src/feature-libraries/editable-tree/editableTree.ts Outdated
Comment thread packages/dds/tree/src/feature-libraries/editable-tree/editableTree.ts Outdated
@sharptrip sharptrip requested review from a team and msfluid-bot as code owners October 25, 2022 11:00
@github-actions github-actions Bot added area: dds: propertydds area: dds: sharedstring area: dev experience Improving the experience of devs building on top of fluid area: driver Driver related issues area: examples Changes that focus on our examples labels Oct 25, 2022
Comment thread packages/dds/tree/src/feature-libraries/editable-tree/editableTree.ts Outdated
Comment thread packages/dds/tree/src/feature-libraries/editable-tree/editableTree.ts Outdated
@sharptrip
Copy link
Copy Markdown
Contributor Author

sharptrip commented Oct 27, 2022

@CraigMacomber I have adopted the latest ObjectForest changes, however, the tests will fail until this fix is merged.

Comment thread packages/dds/tree/src/feature-libraries/editable-tree/editableTree.ts Outdated
Comment thread packages/dds/tree/src/feature-libraries/editable-tree/editableTree.ts Outdated
Comment thread packages/dds/tree/src/feature-libraries/editable-tree/editableTree.ts Outdated
Comment thread packages/dds/tree/src/feature-libraries/editable-tree/editableTree.ts Outdated
@CraigMacomber CraigMacomber merged commit b2d8ac0 into microsoft:main Oct 27, 2022
sharptrip added a commit to sharptrip/FluidFramework that referenced this pull request Oct 28, 2022
)

Same as
[microsoft#12488](microsoft#12512), but
using a new cursor API.

## Description

This PR implements `EditableField` as an array-like sequence of nodes
(`EditableTrees`), which
1) replaces handling of sequence fields with arrays,
2) allows to access nodes lazily by their indices with and without
unwrapping, and
3) is a required change to implement editing of `EditableTree`.

## Reviewer Guidance

Everything around "root" probably might be considered as a workaround as
currently `cursor.getPath()` and anchors do not support fields.

Also, it seems that "primaryField" property of `FieldProxyTarget` is
redundant, as `fieldKey` is also there, but it adds clarity, and we
might make use of it when implementing editing.

## Other information or known dependencies

**Step 4** in a series to push code from microsoft#12182 to enable editing of
EditableTree.

[Step 3](microsoft#12428)
[Step 2](microsoft#12306)
[Step 1](microsoft#12300)

Co-authored-by: Craig Macomber (Microsoft) <42876482+CraigMacomber@users.noreply.github.com>
alexvy86 pushed a commit to alexvy86/FluidFramework that referenced this pull request Nov 1, 2022
)

Same as
[microsoft#12488](microsoft#12512), but
using a new cursor API.

## Description

This PR implements `EditableField` as an array-like sequence of nodes
(`EditableTrees`), which
1) replaces handling of sequence fields with arrays,
2) allows to access nodes lazily by their indices with and without
unwrapping, and
3) is a required change to implement editing of `EditableTree`.

## Reviewer Guidance

Everything around "root" probably might be considered as a workaround as
currently `cursor.getPath()` and anchors do not support fields.

Also, it seems that "primaryField" property of `FieldProxyTarget` is
redundant, as `fieldKey` is also there, but it adds clarity, and we
might make use of it when implementing editing.

## Other information or known dependencies

**Step 4** in a series to push code from microsoft#12182 to enable editing of
EditableTree.

[Step 3](microsoft#12428)
[Step 2](microsoft#12306)
[Step 1](microsoft#12300)

Co-authored-by: Craig Macomber (Microsoft) <42876482+CraigMacomber@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: dds Issues related to distributed data structures base: main PRs targeted against main branch community-contribution public api change Changes to a public API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants