Skip to content

Commit ecbd71b

Browse files
committed
docs(plugin-tree): state the expansion seed vs. user-override rule
`defaultExpandedDepth` was documented as "Initial expansion depth" and nothing said what happens to it when the record set changes. It now seeds a set derived during render, and a node the user opened or closed keeps the user's answer across a re-seed while it is still in the forest -- which is the observable half of the change and belongs in the README next to the key it qualifies. Part of #8666 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
1 parent c410340 commit ecbd71b

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

‎packages/plugin-tree/README.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,20 @@ const schema: ObjectQLComponentSchema = {
4343
Records whose parent is missing (or points outside the result set) are kept as
4444
roots, so nothing is silently dropped.
4545

46+
### Expansion: the seed and the user's answer
47+
48+
`defaultExpandedDepth` **seeds** expansion; it does not own it. The seeded set is
49+
derived from the forest during render rather than mirrored into component state,
50+
so a tree that expands by default is painted expanded in the first commit that
51+
has rows — there is no frame in which the forest is drawn collapsed
52+
(objectui#8666).
53+
54+
When the record set changes — a refetch, a filter, a host that reallocates the
55+
rows — the seed is recomputed for the new forest. A node the user opened or
56+
closed by clicking its chevron, **and which is still in the forest**, keeps the
57+
user's answer; every other node, a genuinely new one included, takes the seed.
58+
Expansion is per-mount session state: it is not addressable and is not persisted.
59+
4660
### The `tree` view type is host composition, not authoring
4761

4862
`tree` is **not** an authorable view type. Neither `ObjectViewSchema.defaultViewType`

0 commit comments

Comments
 (0)