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

docs(tree): split shared tree doc into more specialized pages #23380

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jenn-le
Copy link
Contributor

@jenn-le jenn-le commented Dec 19, 2024

  • moves node type, schema definition, and reading/editing info out of main shared tree doc
  • updates some headers and links

note: the "other" section is meant to be reorganized in future PRs but is created to make it a smooth transition

@Copilot Copilot bot review requested due to automatic review settings December 19, 2024 21:09

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 5 changed files in this pull request and generated no comments.

Files not reviewed (4)
  • docs/docs/data-structures/tree/node-types.mdx: Language not supported
  • docs/docs/data-structures/tree/reading-and-editing.mdx: Language not supported
  • docs/docs/data-structures/tree/schema-definition.mdx: Language not supported
  • docs/docs/start/tree-start.mdx: Language not supported
@github-actions github-actions bot added area: website base: main PRs targeted against main branch labels Dec 19, 2024

Array nodes have three methods that move items within an array or from one array node to another. When moving from one array node to another, these methods must be called from the destination array node. Note that in all of the following, the `T` can be any type that is derived from an object that is returned by a call of `SchemaFactory.array()`, such as the `Notes` and `Items` classes in the sticky notes example.
- Defining a schema for the `SharedTree`. As you build out from prototype to full production application, you can add to this schema and create additional schemas for additional `ShareTree`s.
Copy link
Contributor

@yann-achard-MS yann-achard-MS Dec 20, 2024

Choose a reason for hiding this comment

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

"additional ShareTrees" sounds like separate ST instance. While that is indeed possible, that's not something we want to encourage so it probably best not to mention it in such a prominent place. We don't want to give the impression that having multiple STs is a common/standard thing.

I don't think this second sentence is adding value here, so I recommend removing it.

```typescript
moveToStart(sourceStartIndex: number, sourceEndIndex: number, source?: T)
```
### Usage
Copy link
Contributor

Choose a reason for hiding this comment

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

"Usage" seems like an odd name for a section that just provides more links.
I don't think this needs to be a separate section.

```
- [Node Types](./node-types.mdx): outlines the types that are stored by a `SharedTree`
- [Schema Definition](./schema-definition.mdx): how the structure of a `SharedTree` is defined
- [Reading and Editing](./reading-and-editing.mdx): how a `SharedTree` is read and edited through the APIs provided on the different node types
Copy link
Contributor

Choose a reason for hiding this comment

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

Something wen wrong with the indentation here.


###### Move methods
To get started working with `SharedTree` in your application, read this [quick start guide](../../start/tree-start.mdx).
The major programming tasks for using `SharedTree`s that are described in this doc are:
Copy link
Contributor

Choose a reason for hiding this comment

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

I really like the approach of organizing information in terms of activities that the user might engage in, but this page doesn't actually cover these programming tasks anymore. It's just linking to pages that do, so that seems confusing/misleading and is just taking up space since the list of links below already comes with descriptions.

```typescript
moveToIndex(index: number, sourceStartIndex: number, sourceEndIndex: number, source?: T)
```
### TreeView Object
Copy link
Contributor

Choose a reason for hiding this comment

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

If this page is going to be a TOC, then we should move the rest of the content in an appropriate sub-page.


An array node is an indexed sequence of zero or more values like a JavaScript array. In principle, values can be any of the node types, but the schema that your code defines will specify what subset of those types can be the values of any given array item.

## Type Guard
Copy link
Contributor

Choose a reason for hiding this comment

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

Type guards are not an internal node type, so I'm guessing this ended up here by mistake.

sidebar_position: 2
---

The following leaf node types are available:
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a very abrupt start. Readers will need some context, which I see was not really provided in the original.
How about:

Suggested change
The following leaf node types are available:
A SharedTree's data is organized into a tree of nodes.
A leaf node represents an atomic value, while an interior node represent an object or collection.
## Leaf Nodes
The following leaf node types are available:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: website base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants