Skip to content

feat(dashboard): show endpoint parent/child hierarchy as a tree - #900

Merged
Apollon77 merged 6 commits into
matter-js:mainfrom
lboue:feature/endpoint-hierarchy-tree
Jul 22, 2026
Merged

feat(dashboard): show endpoint parent/child hierarchy as a tree#900
Apollon77 merged 6 commits into
matter-js:mainfrom
lboue:feature/endpoint-hierarchy-tree

Conversation

@lboue

@lboue lboue commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Type of change

  • 🐛 Fix — corrects a defect or wrong behavior
  • Feature — adds new functionality or capability

Description

The node endpoint list in the dashboard was a flat list sorted only by endpoint number, with no visual indication that some endpoints are children of another (e.g. ClosurePanel endpoints bridged under a Closure/Bridged Node endpoint, or sensor endpoints under an aggregator).

This adds getEndpointTree() (packages/dashboard/src/util/endpoints.ts), which derives parent/child relationships from each endpoint's Descriptor cluster PartsList attribute (29/3). Since an ancestor's PartsList also includes indirect descendants, the function keeps only the closest parent for each endpoint (transitive reduction) so the result is a proper tree, not a flat superset.

matter-node-view.ts renders endpoints in parent-first tree order (a parent immediately followed by its children) instead of pure numeric order, with children indented under their parent (--md-list-item-leading-space scaled by depth) to make the hierarchy visually clear.

Backing evidence

N/A — this is a feature (new capability), not a fix for a defect. No log file applies.

  • Related issue: #
  • This fix/change is backed by a complete log file — attached here or in the linked issue (not just a few quoted lines).

Checklist

  • Tests added or updated to cover the change
  • npm test passes
  • npm run format-verify and npm run lint pass
  • CHANGELOG updated (if applicable)

🤖 Generated with Claude Code

@lboue

lboue commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator Author

Test
image

The node endpoint list was a flat numeric sort with no indication that
some endpoints (e.g. ClosurePanel endpoints under a Bridged Node) are
children of another endpoint. Derive parent/child relationships from
each endpoint's Descriptor PartsList (29/3) and render children
indented directly under their parent instead of interleaved by number.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@lboue
lboue force-pushed the feature/endpoint-hierarchy-tree branch from 91783c3 to fdafba7 Compare July 19, 2026 20:23
@lboue
lboue marked this pull request as ready for review July 19, 2026 20:24
Copilot AI review requested due to automatic review settings July 19, 2026 20:24

Copilot AI 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.

Pull request overview

Adds endpoint hierarchy rendering to the dashboard node view by deriving a parent/child tree from each endpoint’s Descriptor cluster PartsList (29/3), and updates the UI to render endpoints in parent-first order with indentation to reflect depth.

Changes:

  • Added getEndpointTree() utility to compute a parent/child endpoint ordering from Descriptor PartsList.
  • Updated matter-node-view to render endpoints in tree order with depth-based indentation.
  • Added unit tests for the new endpoint tree utility and documented the feature in the changelog.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/dashboard/test/EndpointsUtilTest.ts Adds unit tests validating endpoint tree ordering and nesting behavior.
packages/dashboard/src/util/endpoints.ts Introduces getEndpointTree() to compute endpoint hierarchy from PartsList.
packages/dashboard/src/pages/matter-node-view.ts Uses getEndpointTree() to render an indented, parent-first endpoint list.
CHANGELOG.md Documents the new dashboard endpoint tree feature.

Comment thread packages/dashboard/src/util/endpoints.ts
lboue added 2 commits July 21, 2026 15:54
Malformed Descriptor PartsList data (self-references or cycles between
endpoints) could previously make endpoints vanish from the list (every
endpoint ends up in hasParent, so roots is empty) or recurse forever.
Add a visited guard and a fallback pass so every endpoint is always
emitted exactly once.

Copilot AI 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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 22, 2026 07:59

Copilot AI 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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread packages/dashboard/src/util/endpoints.ts
Copilot AI review requested due to automatic review settings July 22, 2026 09:34

Copilot AI 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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

…non-array

Replace the array .includes() in the transitive-reduction step with a
per-endpoint Set, lowering the worst case from O(n^3) to O(n^2) on large
Full-Family bridges. Guard a non-array PartsList (Array.isArray) so
malformed device data can't throw and blank the node view.

Add tests for the Tree-pattern (direct-child-only) convention, an
out-of-set parent surfacing children as roots, and a diamond graph.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 22, 2026 09:46

Copilot AI 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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@Apollon77
Apollon77 merged commit 6cdb004 into matter-js:main Jul 22, 2026
19 checks passed
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