Просмотр исходного кода

feat(channels): per-SSID colors for own networks; full tonal range in the heat strip (#1263)

Palette colors for own nets; full-range heat strip. #1214
Nacho 2 месяцев назад
Родитель
Сommit
4ea80fe999
2 измененных файлов с 8 добавлено и 3 удалено
  1. 3 1
      app/src/components/channels/ChannelSpectrum.tsx
  2. 5 2
      app/src/pages/ChannelPlan.tsx

+ 3 - 1
app/src/components/channels/ChannelSpectrum.tsx

@@ -431,7 +431,9 @@ export function ChannelSpectrum({
         let loDb = withData.length > 0 ? Math.min(...withData) : DBM_BOTTOM
         const hiDbRaw = withData.length > 0 ? Math.max(...withData) : DBM_BOTTOM
         if (hiDbRaw - loDb < 12) loDb = hiDbRaw - 12
-        const norm = (d: number) => 0.12 + 0.5 * ((d - loDb) / (hiDbRaw - loDb))
+        // Rango tonal COMPLETO (pizarra -> teal -> ambar -> rojo): el
+        // tramo corto 0.12..0.62 dejaba la franja sin matices.
+        const norm = (d: number) => 0.04 + 0.96 * ((d - loDb) / (hiDbRaw - loDb))
         for (let i = 0; i < bandChs.length; i++) {
           const tt = dbs[i]! === -Infinity ? 0 : Math.min(Math.max(norm(dbs[i]!), 0), 1)
           let c1 = stops[0]!

+ 5 - 2
app/src/pages/ChannelPlan.tsx

@@ -293,7 +293,10 @@ export default function ChannelPlan() {
         // fallback cuando el agente viejo/no lo trae.
         widthMhz: s.widthMhz && s.widthMhz > 0 ? s.widthMhz : 20,
         own: s.own ?? false,
-        color: s.own ? themeColor('--accent') : ssidColor(s.ssid || s.bssid),
+        // #1214: color estable por SSID TAMBIEN para las propias - con
+        // todas en el acento del tema la vista perdia los tonos que
+        // tenia la paleta vieja (lila/ámbar/teal).
+        color: ssidColor(s.ssid || s.bssid),
       }
       if (net.own) {
         const k = net.ssid + '|' + net.channel
@@ -926,7 +929,7 @@ export default function ChannelPlan() {
                     <tbody>
                       {sortedScans.map((s) => {
                           const lvl = signalLevel(s.signal)
-                          const color = s.own ? themeColor('--accent') : ssidColor(s.ssid || s.bssid)
+                          const color = ssidColor(s.ssid || s.bssid)
                           const key = s.bssid + s.channel
                           return (
                             <tr