fix(dashboard): restrict live view controls to camera device types that support WebRTC#888
Open
lboue wants to merge 4 commits into
Open
fix(dashboard): restrict live view controls to camera device types that support WebRTC#888lboue wants to merge 4 commits into
lboue wants to merge 4 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes the dashboard camera overlay UI so live-view (WebRTC) controls are only shown for Matter camera device types that mandate WebRTCTransportProvider, preventing Snapshot Camera endpoints from offering streaming controls they can’t support.
Changes:
- Added a shared
LIVE_VIEW_DEVICE_TYPE_IDSlist to represent device types that support WebRTC live streaming. - Updated the camera overlay and stream view to hide/adjust live-view UI when unsupported and to clarify the idle state messaging.
- Updated node details to relabel the camera action button to “Snapshot” (with a camera icon) when live view isn’t supported.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/dashboard/src/util/device-icons.ts | Introduces LIVE_VIEW_DEVICE_TYPE_IDS to centralize the live-view-capable device type list. |
| packages/dashboard/src/pages/components/node-details.ts | Reuses shared constant and relabels the action button based on live-view support. |
| packages/dashboard/src/pages/camera-overlay.ts | Gates live-view controls on device type support while keeping snapshot controls available. |
| packages/dashboard/src/components/webrtc-stream-view.ts | Adds liveViewSupported prop and updates placeholder text; adds defensive start behavior. |
| CHANGELOG.md | Adds a WIP changelog entry documenting the fix. |
…at support WebRTC Snapshot Camera (0x0145) doesn't implement WebRTCTransportProvider, so the overlay's Start/resolution/watermark/OSD controls no longer render for it — only Snapshot, which is gated independently on the AVSM SNP feature. The node-details "Live View" button also relabels to "Snapshot" with a camera icon for snapshot-only device types. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…a throw Addresses PR review feedback: start() is called fire-and-forget (void view.start()), so throwing bypassed the method's error handling and risked an unhandled promise rejection instead of a user-visible error state. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
lboue
force-pushed
the
fix/snapshot-camera-no-live-view
branch
from
July 16, 2026 18:58
40ad81d to
8d227b1
Compare
Addresses PR review feedback: the exported array is shared/copied by other modules (node-details.ts spreads it), so accidental mutation by a consumer would silently change live-view gating at runtime. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Type of change
Description
The camera overlay always rendered the live-view controls (resolution selector, Start/Retry button, watermark/OSD toggles) regardless of the endpoint's Matter device type. For a Snapshot Camera (
0x0145) endpoint — which does not implement the mandatoryWebRTCTransportProvidercluster (0x0553) — this let a user click Start and attempt to negotiate a WebRTC session the camera cannot serve.Root cause:
camera-overlay.tsgated the Snapshot button independently on the AVSMSNPfeature bit, but gated nothing on device type — the assumption was that any endpoint opening the overlay (Camera / Video Doorbell / Floodlight Camera / Snapshot Camera) supports live view.Fix:
LIVE_VIEW_DEVICE_TYPE_IDSconstant (device-icons.ts,readonly+Object.freezed): Camera, Video Doorbell, Floodlight Camera — the device types that mandateWebRTCTransportProvider.camera-overlay.ts: new_liveViewSupportedgetter (endpoint device type lookup);canStartnow requires it, hiding the resolution selector / watermark / OSD toggles / Start button for Snapshot Camera. The Snapshot resolution dropdown and Snapshot button stay independently gated on_snapshotSupported, unaffected.webrtc-stream-view.ts: newliveViewSupportedprop; the idle placeholder text changes to "Live view not supported — use Snapshot";start()reports the unsupported case via the existing_fireStateChange("error", …)path (not a throw), consistent with the method's other error handling and safe for fire-and-forget callers (void view.start()).node-details.ts: the node action button relabels from "Live View" to "Snapshot" (camera icon instead of video icon) when the endpoint's device type doesn't support live view; reuses the sharedLIVE_VIEW_DEVICE_TYPE_IDSconstant instead of duplicating the device type list.CHANGELOG.md: added an entry under the work-in-progress placeholder (rebased onto the 1.2.7 release cut after main advanced).Review feedback addressed (Copilot):
_fireStateChange("error", …)instead of throwing fromstart(), since callers invoke it fire-and-forget.LIVE_VIEW_DEVICE_TYPE_IDSimmutable (readonly+Object.freeze) since it's shared/copied by other modules.Backing evidence
Checklist
npm testpasses (PRIMARY_INTERFACE=ens33 MATTER_MDNS_NETWORKINTERFACE=ens33 npm test, full monorepo run, all packages green includingmatter-serverintegration tests: 251/251)npm run format-verifyandnpm run lintpass