Skip to content

Add a Component Tree panel to workspace - #330

Open
dustinwhuang wants to merge 27 commits into
a2ui-project:mainfrom
dustinwhuang:component-tree
Open

dustinwhuang wants to merge 27 commits into
a2ui-project:mainfrom
dustinwhuang:component-tree

Conversation

@dustinwhuang

Copy link
Copy Markdown
Contributor

Description

Screenshot From 2026-11-13 16-24-24
  • Add buildComponentTrees (component-tree-builder.ts) to expand A2UI v0.9 surface messages into a hierarchical component tree from the root component using ComponentId and ChildList $ref definitions from the active catalog schema (with fallback to child/children).
  • Detect and surface missing component references (missing), ancestor reference loops (cycle), multiply-referenced components (shared), data-bound template children (each <path>), and components unreachable from root.
  • Add the standalone ComponentTree Angular component (component-tree.ts, component-tree.ng.html, component-tree.scss) with collapsible tree nodes, status badges, and diagnostic tooltips.
  • Register ComposerPanelId.ComponentTree in ComposerDockview and mount the Component Tree tab alongside Rendered A2UI Preview and A2UI JSON Editor in the default workspace layout.

Pre-launch Checklist

  • I signed the [CLA].
  • I read the [Contributors Guide].
  • I read the [Style Guide].
  • I have added updates to the [CHANGELOG].
  • I updated/added relevant documentation.
  • My code changes (if any) have tests.
  • If my branch is on fork, I have verified that scripts/e2e_test.sh passes.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new 'Component Tree' debug panel to visualize A2UI surface hierarchies and refactors the property editor into a standalone, reusable component, significantly cleaning up the gallery implementation. Feedback on these changes suggests adding a guard clause in the property editor template to safely handle undefined values when formatting JSON, and adding aria-level attributes to the component tree template to improve accessibility for screen readers.

@dustinwhuang
dustinwhuang marked this pull request as ready for review November 14, 2026 03:00
@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

⚡ A2UI Composer PR Preview

Your automated preview is successfully live (commit 606c9bd):
👉 Launch PR Preview

Note: This environment will be wiped automatically when the PR is merged or closed.

@jgindin
jgindin self-requested a review November 16, 2026 20:14

@jgindin jgindin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The component tree builder and status badges (missing, cycle, each <path>, shared) are a great addition to the workspace. Left inline comments covering:

  • A2UI v1.0 support ($defs/Child single-child slots, inline createSurface.components, and mergedActiveCatalog())
  • Restored DOCKVIEW_LAYOUT migration for existing users, cross-surface collapsed key collisions, and WAI-ARIA role="tree" / keyboard accessibility
  • Repo conventions (DRY draft parsing & component collection, Object.hasOwn $defs guard, ReferenceSchema caching)
  • Missing test coverage per .agents/rules/testing_and_qa_workflow.md (ComponentTree has no component-tree.spec.ts or CDK ComponentHarness in this PR, missing MAX_NODES truncation & layout-migration unit tests, and missing Playwright E2E journey)

(Stack note: this PR targets main so #329's commits appear in the diff, and #331 branched from d4183aa4 prior to b706cecd — stacking base branches or rebasing #331 onto #330 will avoid duplicate diffs and a conflict in component-tree.ng.html.)

@jgindin

jgindin commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

When a component is selected in the Component Tree, is there any way we could highlight that component in the Rendered view?

@dustinwhuang

Copy link
Copy Markdown
Contributor Author

When a component is selected in the Component Tree, is there any way we could highlight that component in the Rendered view?

Will address highlighting in a follow up since it involves renderer changes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants