refactor: expose aux timer names via runtime store, index in automations

Addresses review feedback on the aux timer naming feature:

- Automation action labels now reference the timers by index
  ("Aux timer 1: start") rather than the custom names, keeping the
  automation config stable regardless of naming.
- Expose the custom names through the consumer-facing runtime interface:
  the aux timer objects broadcast over the websocket now carry a `name`
  field. Names are seeded from the persisted settings at bootstrap and
  kept in sync whenever the settings change, so every consumer (views and
  integrations) reads them from the same runtime data.
- The client control and view consumers now read the name from the
  runtime store instead of querying settings directly; the settings form
  remains the persisted editing source.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WCZejVTzuAY3tHTE6nB3JH
This commit is contained in:
Claude
2026-07-25 08:49:51 +00:00
parent 2f7909ccc3
commit 2f29060fa4
17 changed files with 145 additions and 46 deletions
@@ -24,6 +24,20 @@ export class AuxTimerService {
this.getTime = getTime;
}
/**
* Applies custom names to the aux timers and broadcasts the change.
* Names are indexed by aux timer position (0 -> aux1, 1 -> aux2, 2 -> aux3).
* Used to seed the names at bootstrap and to keep them in sync with the settings.
*/
loadNames(names: string[]) {
const patch: AuxTimerStateUpdate = {
auxtimer1: this.aux1.setName(names[0] ?? ''),
auxtimer2: this.aux2.setName(names[1] ?? ''),
auxtimer3: this.aux3.setName(names[2] ?? ''),
};
this.emit(patch);
}
/**
* Whether any of the aux timers are currently running
*/