Fix target metrics showing --- by scoping querySelector to targets panel

The dashboard panel appears before the targets panel in the DOM and both
use data-target-id. document.querySelector was finding the dashboard
element (which has no data-tm children) instead of the target card.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-26 00:49:44 +03:00
parent 3bfa9062f9
commit cbbaa852ed

View File

@@ -736,7 +736,9 @@ function _buildLedTimingHTML(state) {
}
function _patchTargetMetrics(target) {
const card = document.querySelector(`[data-target-id="${target.id}"]`);
const container = document.getElementById('targets-panel-content');
if (!container) return;
const card = container.querySelector(`[data-target-id="${target.id}"]`);
if (!card) return;
const state = target.state || {};
const metrics = target.metrics || {};