From 219d559de9db6816cf8552fed9028c9e9e38117b Mon Sep 17 00:00:00 2001 From: Mathieu Moran Date: Mon, 10 Aug 2026 00:56:48 -0400 Subject: [PATCH] fix: dashcam mobile shows filename, RPM/fuel/throttle don't append unit when disconnected MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - yaris.css: split mobile rules by list ID — video-list shows thumb+actions, dashcam-file-list shows dash-col-file+actions; thead display:none !important - yaris.js: check data !== '-' before appending rpm/°C/% units so disconnected state shows — instead of '- rpm' Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- static/js/yaris.js | 8 ++++---- static/yaris.css | 23 +++++++++++++++-------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/static/js/yaris.js b/static/js/yaris.js index b2888e7..c6b867f 100644 --- a/static/js/yaris.js +++ b/static/js/yaris.js @@ -161,22 +161,22 @@ socket.on('obd_speed', function (data) { socket.on('obd_rpm', function (data) { const el = document.getElementById('obd-rpm'); - if (el) el.textContent = data != null ? data + ' rpm' : '—'; + if (el) el.textContent = (data != null && data !== '-') ? data + ' rpm' : '—'; }); socket.on('obd_coolant_temp', function (data) { const el = document.getElementById('obd-coolant'); - if (el) el.textContent = data != null ? data + ' °C' : '—'; + if (el) el.textContent = (data != null && data !== '-') ? data + ' °C' : '—'; }); socket.on('obd_fuel_level', function (data) { const el = document.getElementById('obd-fuel'); - if (el) el.textContent = data != null ? data + ' %' : '—'; + if (el) el.textContent = (data != null && data !== '-') ? data + ' %' : '—'; }); socket.on('obd_throttle', function (data) { const el = document.getElementById('obd-throttle'); - if (el) el.textContent = data != null ? data + ' %' : '—'; + if (el) el.textContent = (data != null && data !== '-') ? data + ' %' : '—'; }); socket.on('obd_error', function (data) { diff --git a/static/yaris.css b/static/yaris.css index 4081786..8e31225 100644 --- a/static/yaris.css +++ b/static/yaris.css @@ -280,7 +280,7 @@ body { @media (max-width: 575.98px) { /* Hide table header */ #local-video-list thead, - #dashcam-file-list thead { display: none; } + #dashcam-file-list thead { display: none !important; } /* Row becomes flex */ .dash-row { display: flex !important; align-items: center; gap: .5rem; @@ -289,19 +289,26 @@ body { /* Hide all cells by default */ .dash-row > td { display: none !important; } - /* Show only first cell (thumb or checkbox) and actions */ - .dash-row > td:first-child, - .dash-row > .dash-actions-td { display: flex !important; align-items: center; } + /* local-video-list: show thumb cell + actions */ + #local-video-list .dash-row > td:first-child, + #local-video-list .dash-row > .dash-actions-td { display: flex !important; align-items: center; } + #local-video-list .dash-row > td:first-child { flex: 1; min-width: 0; } - /* First cell takes remaining space, no overflow */ - .dash-row > td:first-child { flex: 1; min-width: 0; } + /* dashcam-file-list: show filename cell + actions (no thumbnail) */ + #dashcam-file-list .dash-row > .dash-col-file, + #dashcam-file-list .dash-row > .dash-actions-td { display: flex !important; align-items: center; } + #dashcam-file-list .dash-row > .dash-col-file { + flex: 1; min-width: 0; + overflow: hidden; text-overflow: ellipsis; white-space: nowrap; + font-size: .8rem; + } /* Actions never shrink */ .dash-row > .dash-actions-td { flex-shrink: 0; } - /* Thumbnail sizing — override any inline style */ + /* Thumbnail sizing */ .dash-thumb-td { width: 5rem !important; padding: 0.2rem !important; } - .local-video-thumbnail { width: 4.5rem !important; } + .local-video-thumbnail { width: 4.5rem !important; height: auto !important; } /* Filename under thumbnail */ .dash-thumb-name { display: block !important; font-size: .7rem; margin-top: .2rem; }