GUI round 12 (#6): fade the locate-light dot in and out
build-test-release / release (push) Successful in 5m59s

The Light column's flashing-light dot now pulses (fades between ~30% and 100%
opacity over a ~1.6 s cycle) instead of sitting static, so a flashing locate
light reads as live.

- A distinct SHAPE_PULSE_DOT sentinel marks the fading dot, so only the locate
  light pulses -- the hashboard health dots stay solid.
- A wxTimer in the bridge advances an animation phase and, each 100 ms tick, emits
  a row change so the custom cell renderer re-runs (a plain Refresh() does not
  re-invoke a custom renderer under wxGTK's cell caching); the renderer blends the
  dot toward its cell background by the phase. The timer runs only while a visible
  row's light is actually flashing -- fill_rows calls set_light_pulse(true/false)
  -- so there is no idle repaint loop.

Verified under Xvfb: with the fixture whose locate light flashes and the Light
column shown, the dot's measured intensity oscillates across frames (strong amber
to a pale tint and back); with no flashing light the timer stays stopped.
Self-test still passes. wx-rs patches 0002/0003 regenerated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh
This commit is contained in:
2026-09-20 00:20:37 -06:00
co-authored by Claude Opus 4.8
parent 1ae3d0c206
commit 631b745435
5 changed files with 192 additions and 14 deletions
+14 -2
View File
@@ -255,6 +255,9 @@ const SHAPE_HASHING: &str = "\u{0004}";
const SHAPE_SLOW: &str = "\u{0005}";
const SHAPE_NOTHASHING: &str = "\u{0006}";
const SHAPE_PAUSED: &str = "\u{0008}";
/// Locate-light dot that fades in and out (round 12 #6); distinct from the static
/// `SHAPE_DOT` so only the flashing light pulses, not the hashboard health dots.
const SHAPE_PULSE_DOT: &str = "\u{000B}";
/// Register every SVG-backed table-cell icon with the bridge (round 12 #9/#11):
/// the access padlocks and the four status KPI icons. Called once at startup;
@@ -325,10 +328,11 @@ fn encode_access_icon(pal: &Palette, write_locked: Option<bool>) -> String {
}
/// Light column: a yellow dot while the miner's locate light is flashing, else
/// blank (round 11 #10).
/// blank (round 11 #10). The dot fades in and out (round 12 #6) via the pulsing
/// sentinel, so a flashing light reads as a live pulse rather than a static dot.
fn encode_light_dot(pal: &Palette, flashing: Option<bool>) -> String {
match flashing {
Some(true) => encode_segments(&[(Some(pal.amber), SHAPE_DOT.to_string())]),
Some(true) => encode_segments(&[(Some(pal.amber), SHAPE_PULSE_DOT.to_string())]),
_ => encode_segments(&[(None, String::new())]),
}
}
@@ -1081,6 +1085,14 @@ impl App {
if !sel.is_empty() {
t.dvlc_select_rows(&sel);
}
// Run the locate-light fade timer only while a visible row's light is
// actually flashing (round 12 #6), so the table isn't repainted on a timer
// when there is nothing to animate.
let any_flashing = self
.view_idx
.iter()
.any(|&ri| self.rows[ri].light_flashing == Some(true));
wx_rs::set_light_pulse(any_flashing);
self.refresh_kpis();
}