Skip to content

Add inline NodeLabel editing to Node detail view#681

Merged
Apollon77 merged 4 commits into
matter-js:mainfrom
rspier:bug369
Jun 1, 2026
Merged

Add inline NodeLabel editing to Node detail view#681
Apollon77 merged 4 commits into
matter-js:mainfrom
rspier:bug369

Conversation

@rspier

@rspier rspier commented May 26, 2026

Copy link
Copy Markdown
Contributor

Fixes #369.

@Apollon77

Copy link
Copy Markdown
Collaborator

Thanks. I will check next week when back from vacation.

@Apollon77 Apollon77 self-assigned this May 26, 2026
@rspier

rspier commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

4d12e1b fixes the formatting issue. (imports were out of order)

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

This PR addresses issue #369 by making the Matter Node Label editable directly from the initial Node detail view in the dashboard, reducing the need to navigate deep into endpoint/cluster attribute views.

Changes:

  • Add a pencil icon next to the node label in the Node detail header to open label editing.
  • Introduce a dedicated node-label-dialog component that writes the BasicInformation/NodeLabel attribute via the WS client.
  • Add a showNodeLabelDialog helper to lazy-load and attach the dialog to the dashboard app root.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/dashboard/src/pages/components/node-details.ts Adds an inline edit affordance (pencil icon) for Node Label in the node header.
packages/dashboard/src/components/dialogs/node-label-dialog/show-node-label-dialog.ts Adds a helper to lazy-load and render the node-label dialog.
packages/dashboard/src/components/dialogs/node-label-dialog/node-label-dialog.ts Implements the dialog UI and saves Node Label by writing the BasicInformation attribute.

Comment thread packages/dashboard/src/pages/components/node-details.ts Outdated
Apollon77 and others added 2 commits May 31, 2026 19:08
- add accessible label and title to edit node button
- statically import showAlertDialog in node-label-dialog
@rspier

rspier commented May 31, 2026

Copy link
Copy Markdown
Contributor Author

I've dealt with Copilot's comments.

npm run test and npm run format-verify are both passing on my desktop.

Do you want me to rebase this against main and push again?

@Apollon77

Copy link
Copy Markdown
Collaborator

@rspier strange that it passes. try to do a fresh "npm i" in the local checkout ... maybe some deps are outdated leading to the issue?

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 3 out of 3 changed files in this pull request and generated no new comments.

@Apollon77

Copy link
Copy Markdown
Collaborator

I will merge and do some adjustments locally, thanks!

@Apollon77
Apollon77 merged commit 85912eb into matter-js:main Jun 1, 2026
17 checks passed
Apollon77 added a commit that referenced this pull request Jun 1, 2026
)

* feat(dashboard): Thread role badges + shared NodeLabel write logic

Network graph (Thread):
- Mark Thread RoutingRole (attr 0/53/1) on commissioned nodes with a corner
  role-rank badge overlaid on the device icon: crown=Leader, two-arrows=Router,
  dot=End Device/REED, sleep=Sleepy End Device. Device identity is preserved
  rather than replaced.
- Mark the primary Backbone Border Router with a star badge on BR nodes. The
  central crown remains the mesh-Leader marker (MeshCoP bitmap). Leader and
  primary-BBR are orthogonal roles and render independently; a BR that is both
  shows both. Note the two leader encodings differ: MeshCoP bitmap role 3 vs
  ThreadNetworkDiagnostics RoutingRole 6.
- Add theme-aware colors for router/end-device/primary-BBR in light and dark.

NodeLabel editing (follow-up to #681):
- Extract shared constants and writeNodeLabel() into util/node-label.ts; both
  the node-label dialog and the BasicInformation cluster panel use it. The
  helper trims, matching what MatterNode.nodeLabel reads back.
- Drop the redundant attribute fallback that re-introduced the null-padded
  value the nodeLabel getter intentionally rejects.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(dashboard): address PR review comments

- basic-information: sync the text field to the trimmed value after a
  successful save so the UI no longer shows the pre-trimmed string.
- device-icons: document the new optional `badge` param on createIconDataUrl.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(dashboard): type-only import for MatterClient/MatterNode in node-label-dialog

Used only in type positions; value import pulled them into the bundle.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

Move NodeLabel Text input option to the starting Node detail view.

3 participants