Tree: Increase child page size to 100 - #23585
Conversation
Add a property-less "Empty Page" document type and a generated page tree dataset to the kitchen-sink mocks. This wires a deep, wide document hierarchy into the mock document data so tree pagination and deep expansion scenarios can be exercised more realistically.
Replaced the dedicated tree-item entity action manager with a direct, lazy observable in `UmbTreeItemApiContextBase` and marked `hasActions` as deprecated (scheduled for removal in v19). The default tree item card now always renders `<umb-entity-actions-bundle>` so action visibility is decided by resolved permissions/conditions instead of a pre-check that only verified registered manifests.
|
Claude finished @madsrasmussen's task in 10m 12s —— View job PR ReviewTarget: Increases tree child page size from 50 to 100, adds a 16,001-document Kitchen Sink fixture, and removes several categories of per-item work: a dedicated
Suggestions
Approved with Suggestions for improvementGood to go. The reactive chain — |
There was a problem hiding this comment.
Pull request overview
This PR adjusts the backoffice tree UI to load more children per page (50 → 100) and reduces per-item runtime work during tree rendering, supported by a new large Kitchen Sink mock fixture to exercise pagination and deep expansion scenarios.
Changes:
- Increased default tree child pagination size to 100 across relevant tree contexts/managers.
- Reduced per-item overhead in tree rendering (stable
repeat()keys, identity guards, movenavigationendhandling to a tree-scoped active manager, remove per-item entity-action subscription). - Added a large Kitchen Sink mock dataset (16,001 documents) and a minimal “Empty Page” document type to test tree behavior at scale.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Umbraco.Web.UI.Client/src/packages/core/tree/view/classic/classic-tree-view.element.ts | Uses stable Lit repeat() keys for root item rendering. |
| src/Umbraco.Web.UI.Client/src/packages/core/tree/tree-item/tree-item-entity-action.manager.ts | Removed per-item entity-action manager (eliminates per-item registry observation). |
| src/Umbraco.Web.UI.Client/src/packages/core/tree/tree-item/tree-item-children.manager.ts | Increases default take size to 100. |
| src/Umbraco.Web.UI.Client/src/packages/core/tree/tree-item/tree-item-base/tree-item-element-base.ts | Adds identity guard for item setter and uses stable repeat() keys for child items. |
| src/Umbraco.Web.UI.Client/src/packages/core/tree/tree-item/tree-item-base/tree-item-element-base.test.ts | Adds tests covering item identity guard and stable keyed rendering behavior. |
| src/Umbraco.Web.UI.Client/src/packages/core/tree/tree-item/tree-item-base/tree-item-context-base.ts | Updates tree item context to set take size to 100. |
| src/Umbraco.Web.UI.Client/src/packages/core/tree/tree-item-card/default/default-tree-item-card.element.ts | Removes reliance on deprecated hasActions; always renders <umb-entity-actions-bundle> (which self-hides when empty). |
| src/Umbraco.Web.UI.Client/src/packages/core/tree/tree-item-api/tree-item-api.interface.ts | Marks hasActions as deprecated (v17 → remove in v19). |
| src/Umbraco.Web.UI.Client/src/packages/core/tree/tree-item-api/tree-item-api-context-base.ts | Reworks active-state tracking to use the tree active manager’s location observable; deprecates hasActions access with guidance. |
| src/Umbraco.Web.UI.Client/src/packages/core/tree/default/default-tree.context.ts | Updates default tree context to set take size to 100. |
| src/Umbraco.Web.UI.Client/src/packages/core/tree/active-manager/tree-active-manager.ts | Introduces tree-scoped navigationend listener + isCurrentLocation(); renames “active” concept to activeTrail with deprecated shims. |
| src/Umbraco.Web.UI.Client/src/packages/core/tree/active-manager/tree-active-manager.test.ts | Adds coverage for isCurrentLocation() and listener lifecycle; updates tests for renamed API. |
| src/Umbraco.Web.UI.Client/mocks/data/sets/kitchen-sink/page-tree.data.ts | Adds large generated document tree fixture for scale testing. |
| src/Umbraco.Web.UI.Client/mocks/data/sets/kitchen-sink/document.data.ts | Includes the new page-tree fixture in the Kitchen Sink document dataset. |
| src/Umbraco.Web.UI.Client/mocks/data/sets/kitchen-sink/document-type.data.ts | Adds “Empty Page” document type used by the large fixture. |
Updated Lit `repeat` key generation in both classic tree view and tree item base to use `${entityType}:${unique}` instead of direct string concatenation. This prevents accidental key collisions when different values could produce the same concatenated key and improves stable rendering behavior.
# Conflicts: # src/Umbraco.Web.UI.Client/src/packages/core/tree/tree-item-card/default/default-tree-item-card.element.ts
|



Resume
This PR increases the tree's child page size from 50 to 100. It also adds a large fixture to the Kitchen Sink mock set. Loading it revealed several performance issues in tree rendering. This PR addresses some low-hanging fruit, but unfortunately, the main problem of having too many DOM nodes will need to be addressed later.
The PR consists of three things:
1. Page size 50 → 100
2. Mock fixture to test at scale
New Empty Page document type (no properties, allowed at root, allows itself as a child) plus a generated page tree in page-tree.data.ts: Page 1 in the content root with 1,000 children, and along the first branch the first ten children of each page get 500 children of their own, down to level 5 — 16,001 documents.
3. Per-item work removed
navigationendlistener per tree instead of one per item.repeat()keysWhat this does not fix
When loading 500–1000 tree items, you will start to notice staggered rendering, and it gets worse as more items are loaded.
Here are a few numbers from a Claude performance test in the mocked back office:
Our JavaScript accounts for ~0% of that span (0.0–0.4 ms per 100 items, zero long tasks). The cost is per-item DOM and browser work that scales with list size — at 900 items the tree is 20,910 elements, about 23 per row. Expanding several branches at once also serializes: five branches with all data back in ~102 ms, but the fifth branch's first item appeared 14 seconds after the click.
How to test
npm run dev:mockNotice: The "sort children" functionality hasn’t been implemented in the mocked back office, so it needs to be tested in a real project.