Problem
Hierarchical, self-referencing objects (business unit / org chart, category trees, menu trees, BOM, nested comments) have no native view type to render them with indentation + expand/collapse. Today they can only be shown flat in a Grid, reading the parent field manually — the hierarchy is invisible.
The data layer and a generic UI component already exist; what's missing is the object-view integration that ties them together.
What already exists (foundation)
tree field type (self-reference) — data layer supports { type: 'tree', reference: '<self>' }, i.e. a single-parent pointer. Unambiguous, unlike Airtable's many-to-many links (which is why Airtable has no tree view; we don't have that blocker). See packages/app-shell/src/views/metadata-admin/previews/field-types.ts:36.
- Generic
TreeViewSchema component — expand/collapse tree renderer, but it consumes TreeNode[] and is not bound to object record data (more like a folder browser). packages/components/src/renderers/data-display/tree-view.tsx.
What's missing (the gap)
The 10 object view types (list / grid / kanban / calendar / timeline / map / gallery / gantt / chart / detail, see packages/types/src/views.ts:28) do not include tree. The view-type → component dispatch switch at packages/plugin-view/src/ObjectView.tsx:685 has no case 'tree', and there is no plugin-tree package.
Why not just use Grouping (à la Airtable)?
Grouping handles fixed-depth hierarchies (dept → team → person). It cannot express an arbitrary-depth self-referencing tree (A's parent is B, B's parent is C, …unbounded). That is precisely the business-unit / org-chart case and the reason we need a real tree view, not grouping.
| Scenario |
Use |
| Fixed, known levels |
Grid + Grouping (no new view needed) |
| Self-referencing, unbounded depth (business unit, menu, BOM, nested comments) |
tree-grid (this issue) |
Proposed scope
Start with tree-grid (a tree table — columns, with the first column indented/expandable), since it subsumes a plain tree.
- Add
'tree' to the ViewType union — packages/types/src/views.ts.
- New
plugin-tree package (mirror plugin-kanban / plugin-gantt structure). Core work: transform flat records with a self-referencing parent field into a nested structure, feed into the existing TreeViewSchema / a tree-grid renderer.
- Register
case 'tree' in the dispatch switch — packages/plugin-view/src/ObjectView.tsx.
- Add tree icon + label to
ViewSwitcher (plugin-list).
Open questions
- Config surface: which field is the parent pointer (auto-detect the
tree/self-reference field, or explicit tree.parentField?), root filter, default expand depth, lazy-load vs. fetch-all.
- Server-side: fetch the whole subtree at once vs. lazy children fetch per node (perf for large trees).
- Drag-to-reparent — in scope for v1 or a follow-up?
Acceptance (v1)
- A self-referencing object renders as an indented, expand/collapse tree-grid with columns.
- Parent field auto-detected from the object's
tree field; configurable override.
- Reads via the generic data API (no bespoke endpoint).
Problem
Hierarchical, self-referencing objects (business unit / org chart, category trees, menu trees, BOM, nested comments) have no native view type to render them with indentation + expand/collapse. Today they can only be shown flat in a Grid, reading the
parentfield manually — the hierarchy is invisible.The data layer and a generic UI component already exist; what's missing is the object-view integration that ties them together.
What already exists (foundation)
treefield type (self-reference) — data layer supports{ type: 'tree', reference: '<self>' }, i.e. a single-parent pointer. Unambiguous, unlike Airtable's many-to-many links (which is why Airtable has no tree view; we don't have that blocker). Seepackages/app-shell/src/views/metadata-admin/previews/field-types.ts:36.TreeViewSchemacomponent — expand/collapse tree renderer, but it consumesTreeNode[]and is not bound to object record data (more like a folder browser).packages/components/src/renderers/data-display/tree-view.tsx.What's missing (the gap)
The 10 object view types (
list / grid / kanban / calendar / timeline / map / gallery / gantt / chart / detail, seepackages/types/src/views.ts:28) do not includetree. The view-type → component dispatch switch atpackages/plugin-view/src/ObjectView.tsx:685has nocase 'tree', and there is noplugin-treepackage.Why not just use Grouping (à la Airtable)?
Grouping handles fixed-depth hierarchies (dept → team → person). It cannot express an arbitrary-depth self-referencing tree (A's parent is B, B's parent is C, …unbounded). That is precisely the business-unit / org-chart case and the reason we need a real tree view, not grouping.
Proposed scope
Start with tree-grid (a tree table — columns, with the first column indented/expandable), since it subsumes a plain tree.
'tree'to theViewTypeunion —packages/types/src/views.ts.plugin-treepackage (mirrorplugin-kanban/plugin-ganttstructure). Core work: transform flat records with a self-referencingparentfield into a nested structure, feed into the existingTreeViewSchema/ a tree-grid renderer.case 'tree'in the dispatch switch —packages/plugin-view/src/ObjectView.tsx.ViewSwitcher(plugin-list).Open questions
tree/self-referencefield, or explicittree.parentField?), root filter, default expand depth, lazy-load vs. fetch-all.Acceptance (v1)
treefield; configurable override.