feat(plugin-tree): add tree / tree-grid object view type (#1885)#1892
Merged
Conversation
Adds a new `tree` view type that renders a self-referencing object as an indented, expand/collapse tree-grid — the right view for arbitrary-depth hierarchies (business unit / org chart, category trees, BOMs, nested comments) that fixed-depth grouping can't express. - packages/plugin-tree: new ObjectTree (tree-grid) renderer + registration (object-tree / tree component types), builds a nested forest from flat records via a single-parent pointer, auto-detects the parent field from the object's `tree`/self-reference field, expand/collapse + depth seeding. - types: ViewType + zod enum gain 'tree'; ObjectTreeSchema added to the ObjectQL component union (interface + zod). - plugin-view: ObjectView dispatches 'tree' -> object-tree; ViewSwitcher icon/label. - plugin-list: ViewSwitcher icon/label. - apps/console: lazy-register object-tree/tree, dep + vite alias + manualChunk. Refs #1885 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… full records The console renders object views via app-shell ObjectView -> plugin-list ListView (not plugin-view ObjectView), so the tree view needs wiring there too: - ListView: add a 'tree' case to the view-component switch (-> object-tree), allow 'tree' as a resolvable/whitelisted viewType, and re-run on tree config. - app-shell ObjectView: pass the view's `tree` config through options.tree so parentField/labelField/fields/defaultExpandedDepth reach the renderer. - ObjectTree: when a live object dataSource is present, fetch the tree's OWN full records instead of the host's column-scoped `data` — the host pre-fetches only display columns, which omit the parent-pointer field and flatten the tree. Verified end-to-end in the showcase console: showcase_business_unit 'Organization Chart' renders a 3-level indented tree-grid with working expand/collapse. Refs #1885 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
❌ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a
tree/ tree-grid object view type — renders a self-referencing object as an indented, expand/collapse tree-grid. The right view for arbitrary-depth hierarchies (business unit / org chart, category trees, BOMs, nested comments) that fixed-depth grouping can't express.Closes #1885. Pairs with framework PR (spec
treetype + showcase example).Changes
packages/plugin-tree(new):ObjectTreetree-grid renderer +object-tree/treeregistration. Builds a nested forest from flat records via a single-parent pointer, auto-detects the parent field from the object'stree/self-reference field, depth-seeded expand/collapse, keeps orphan rows as roots. When a live object dataSource is present it fetches its own full records (the host's column-scoped data omits the parent pointer and would flatten the tree).types:ViewType+ zod enum gaintree;ObjectTreeSchemaadded to the ObjectQL component union (interface + zod).plugin-list/ListView(the console path) andplugin-view/ObjectViewboth routetree→object-tree;app-shell/ObjectViewpasses the view'streeconfig throughoptions.tree. BothViewSwitchers get a tree icon/label.apps/console: lazy-registerobject-tree/tree, dep + vite alias + manualChunk.Testing
plugin-tree(forest building, depth indentation, expand/collapse,defaultExpandedDepth, orphan handling) — all green.plugin-tree+types.showcase_business_unit→ "Organization Chart" renders a 3-level indented tree-grid with working expand/collapse (Acme → Product & Engineering → Platform / Frontend Guild → Design Systems; Go-To-Market → Sales → Enterprise Sales).🤖 Generated with Claude Code