-
Notifications
You must be signed in to change notification settings - Fork 535
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
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
|
||
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"additional ShareTree
s" 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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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:
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: |
note: the "other" section is meant to be reorganized in future PRs but is created to make it a smooth transition