Skip to content

Commit 472c7fc

Browse files
committed
Refactor connection status display for improved clarity and consistency
1 parent 3dd978a commit 472c7fc

2 files changed

Lines changed: 7 additions & 14 deletions

File tree

content/wardrive.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ function setConnStatus(text, color) {
769769

770770
// Format based on connection state
771771
if (text === "Connected") {
772-
// Show: 🟢 DeviceName 🔊 NoiseFloor
772+
// Show: 🟢 DeviceName 🔊 NoiseFloor (device/noise in slate, indicator green)
773773
const deviceName = state.deviceName || "[No device]";
774774
let noiseText = "-";
775775
if (state.lastNoiseFloor === null) {
@@ -780,16 +780,17 @@ function setConnStatus(text, color) {
780780
noiseText = `${state.lastNoiseFloor}dBm`;
781781
}
782782
connectionStatusEl.textContent = `${deviceName} 🔊 ${noiseText}`;
783+
connectionStatusEl.className = 'font-medium text-slate-300';
783784
} else if (text === "Disconnected") {
784785
// Show: 🔴 Disconnected
785786
connectionStatusEl.textContent = text;
787+
connectionStatusEl.className = `font-medium ${color}`;
786788
} else {
787789
// Connecting, Disconnecting - show as-is
788790
connectionStatusEl.textContent = text;
791+
connectionStatusEl.className = `font-medium ${color}`;
789792
}
790793

791-
connectionStatusEl.className = `font-medium ${color}`;
792-
793794
// Update status indicator dot color to match
794795
if (statusIndicatorEl) {
795796
statusIndicatorEl.className = `text-lg ${color}`;

index.html

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,9 @@ <h1 class="flex items-center gap-2 text-lg sm:text-xl font-semibold truncate min
4747
<div>
4848
<!-- Connection Status Bar -->
4949
<div id="connectionBar" class="bg-slate-800/80 border border-slate-700 rounded-t-xl rounded-b-none px-4 py-0.5 flex items-center justify-between">
50-
<div class="flex items-center gap-4 text-sm">
51-
<div class="flex items-center gap-2">
52-
<span id="statusIndicator" class="text-base"></span>
53-
<span id="connectionStatus" class="font-medium text-red-300">Disconnected</span>
54-
</div>
55-
<div class="flex items-center gap-2 text-xs">
56-
<span class="text-slate-400">Device:</span>
57-
<span id="deviceName" class="text-slate-300">-</span>
58-
<span class="text-slate-400">Noise:</span>
59-
<span id="deviceInfo" class="text-slate-300">-</span>
60-
</div>
50+
<div class="flex items-center gap-2 text-sm">
51+
<span id="statusIndicator" class="text-base"></span>
52+
<span id="connectionStatus" class="font-medium text-red-300">Disconnected</span>
6153
</div>
6254
<button id="settingsGearBtn" class="p-0 text-slate-400 hover:text-slate-200 transition-colors" aria-label="Toggle settings">
6355
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">

0 commit comments

Comments
 (0)