feat!: Tree component rework#783
Conversation
|
Minor nits — solid rework, and it moves the API in the right direction. Nothing blocking. Good direction worth calling out:
Nits:
Note this is a full breaking change to Tree's public API. Pre-v1 that's allowed (P13 isn't on yet), but it deserves a changelog line. |
|
/barista review |
|
Re-reviewing per @shahzeelahmed. Looks good — prior nits are addressed and the API moves the right way. Resolved since last pass:
Slots are all canonical ( Two small nits, nothing blocking:
Still a full breaking change to Tree's public API — fine pre-v1, but it deserves a changelog line. |
|
/barista review |
|
Re-reviewing per @shariquerik. Minor nits — the API is in good shape (canonical
The move-index off-by-one fix ( Still a full breaking change to Tree's public API — fine pre-v1 (P13 not on yet), but it deserves a changelog line. |
|
/barista review |
|
Re-reviewing per @shahzeelahmed. Minor nits — API still in good shape (canonical
Still a full breaking change to Tree's public API — fine pre-v1 (P13 not on yet), but it deserves a changelog line. |
|
Concerns — the per-row slots use top-level names for a per-item concept.
Other items:
Good direction: dropping the |
…defaultExpanded seeding
|
/barista review |
|
Re-reviewing per @shahzeelahmed. Looks good — every open concern from the last pass is addressed, and the API moved the right way. Resolved since last review:
Two non-blocking things:
|
Coverage: 57.42% (+0.32% vs
main)Docs preview: https://ui.frappe.io/pr-preview/pr-783/docs/components/tree
The Tree was rebuilt from a single recursive
noderenderer into a stateful forest. It takes anodesarray, drives expansion throughv-model:expanded, and scopes its per-row slots as#item-*. Theoptionsblob and the per-node internal collapse state are gone and sizing moves to CSS variables. Keyboard navigation,role="tree"ARIA, and opt-in drag-and-drop are new.:node="root"(single root object):nodes="[root]"(array of roots)v-model:expanded(array of keys):options="{ rowHeight, indentWidth }"--tree-row-height/--tree-indentCSS vars:options="{ showIndentationGuides }"guides="connectors" | "lines" | "none":options="{ defaultCollapsed: true }"defaultExpanded(inverted)#node="{ node, isCollapsed, toggleCollapsed }"#item="{ node, expanded, toggle, … }"#label#item-label#icon#itemDrag-and-drop is opt-in: set
draggable, gate drops with:move="({ node, target, position }) => …", and persist from@drag-end="(info) => …"—infois{ node, from, to, position, oldIndex, newIndex }, ornullwhen the drag is cancelled.