[feat](trx-rs): refine overview strip and logging

Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-02-28 00:57:15 +01:00
parent 8d4a729d7c
commit 4c4d14b705
3 changed files with 34 additions and 14 deletions
@@ -625,14 +625,24 @@ function drawOverviewSignalHistory(ctx, w, h, isLight) {
const toX = (t) => ((t - windowStart) / HEADER_SIG_WINDOW_MS) * w;
const toY = (v) => h - (Math.max(0, Math.min(maxVal, v)) / maxVal) * (h - 3) - 1.5;
const gridMarkers = [
{ val: 0, label: "S0" },
{ val: 9, label: "S9" },
{ val: 18, label: "S9+" },
];
ctx.strokeStyle = isLight ? "rgba(71, 85, 105, 0.14)" : "rgba(148, 163, 184, 0.12)";
ctx.lineWidth = 1;
for (const val of [0, 9, 18]) {
const y = toY(val);
ctx.font = "11px sans-serif";
ctx.fillStyle = isLight ? "rgba(51, 65, 85, 0.72)" : "rgba(203, 213, 225, 0.72)";
ctx.textAlign = "left";
ctx.textBaseline = "middle";
for (const marker of gridMarkers) {
const y = toY(marker.val);
ctx.beginPath();
ctx.moveTo(0, y);
ctx.lineTo(w, y);
ctx.stroke();
ctx.fillText(marker.label, 6, Math.max(8, Math.min(h - 8, y)));
}
ctx.beginPath();
@@ -62,12 +62,13 @@
body {
font-family: sans-serif;
margin: 0;
height: 100vh;
min-height: 100vh;
box-sizing: border-box;
display: block;
background: var(--bg);
color: var(--text);
overflow: hidden;
overflow-x: hidden;
overflow-y: auto;
}
.card {
width: min(100%, 1280px);
@@ -75,10 +76,10 @@ body {
padding: 0.85rem 1.25rem 1.5rem;
background: transparent;
box-sizing: border-box;
height: 100vh;
min-height: 100vh;
display: flex;
flex-direction: column;
overflow: hidden;
overflow: visible;
}
.label { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 6px; display: block; }
#tab-main .label > span {
@@ -389,6 +390,12 @@ small { color: var(--text-muted); }
width: auto;
min-width: 0;
flex: 1 1 auto;
padding: 0.35rem 0.65rem 0.4rem;
border-radius: 0.8rem;
background: color-mix(in srgb, var(--card-bg) 56%, transparent);
backdrop-filter: blur(12px) saturate(125%);
-webkit-backdrop-filter: blur(12px) saturate(125%);
box-shadow: inset 0 1px 0 color-mix(in srgb, #ffffff 10%, transparent);
}
.title { font-size: 1.4rem; font-weight: 700; display: inline-flex; align-items: center; gap: 0.35rem; }
.overview-strip {
@@ -433,7 +440,7 @@ small { color: var(--text-muted); }
}
#overview-canvas {
width: 100%;
height: clamp(4.2rem, 11vh, 6.25rem);
height: calc(clamp(4.2rem, 11vh, 6.25rem) + var(--header-waterfall-overlap));
display: block;
}
.header-left {
@@ -490,8 +497,8 @@ small { color: var(--text-muted); }
.meter-bar { flex: 1 1 auto; height: 12px; border-radius: 999px; background: var(--btn-bg); border: 1px solid var(--border-light); overflow: hidden; }
.meter-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent-green), var(--accent-yellow), var(--accent-red)); transition: width 150ms ease; }
.meter-value { font-size: 0.95rem; color: var(--text-heading); min-width: 64px; text-align: right; }
#content { display: flex; flex-direction: column; gap: 1.1rem; min-height: 0; overflow: hidden; }
.tab-panel { flex: 1 1 auto; min-height: 0; overflow: hidden; }
#content { display: flex; flex-direction: column; gap: 1.1rem; min-height: 0; overflow: visible; }
.tab-panel { flex: 1 1 auto; min-height: 0; overflow: visible; }
.tab-bar {
display: flex;
align-items: center;
+8 -5
View File
@@ -318,6 +318,7 @@ pub async fn run_rig_task(
// Process each request
while let Some(RigRequest { cmd, respond_to }) = batch.pop() {
let cmd_label = format!("{:?}", cmd);
let log_command = !matches!(&cmd, RigCommand::GetSpectrum);
let started = Instant::now();
let mut cmd_ctx = CommandExecContext {
@@ -335,11 +336,13 @@ pub async fn run_rig_task(
let _ = respond_to.send(result);
let elapsed = started.elapsed();
if elapsed > Duration::from_millis(500) {
warn!("Rig command {} took {:?}", cmd_label, elapsed);
} else {
debug!("Rig command {} completed in {:?}", cmd_label, elapsed);
if log_command {
let elapsed = started.elapsed();
if elapsed > Duration::from_millis(500) {
warn!("Rig command {} took {:?}", cmd_label, elapsed);
} else {
debug!("Rig command {} completed in {:?}", cmd_label, elapsed);
}
}
}
},