mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-19 06:04:05 +00:00
refactor: address review feedback on aux timer naming
- Revert the automation action labels back to "Aux N: action" (no functional reason to change this wording). - Simplify the aux timers header in the playback control: the flex container now only handles layout, and the label text reuses the same font-size/color as the per-timer labels below it, instead of a bespoke style block duplicating those values. - Replace the generic, length-driven normaliser with an explicit sanitiseAuxTimerNames() that always deals with exactly three timers, and rename it away from "normalise" (which didn't convey that it trims, caps length and fills in missing entries). Static defaults now use a plain ['', '', ''] literal instead of calling the sanitiser with no input to sanitise. - Settings.type.ts and AuxTimerSettings.tsx no longer generate their three fields from a loop; the form mirrors the same explicit, one-field-per-row style already used by GeneralSettings.tsx. - Trim comments that only restated what the following line already says, keeping the ones that explain non-obvious behaviour (why AuxTimerService needs to be resynced separately from the data provider, why SimpleTimer.reset() preserves the name). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WCZejVTzuAY3tHTE6nB3JH
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { RuntimeStore, SimpleDirection, SimplePlayback } from 'ontime-types';
|
||||
import { normaliseAuxTimerNames } from 'ontime-utils';
|
||||
import { sanitiseAuxTimerNames } from 'ontime-utils';
|
||||
|
||||
import { SimpleTimer } from '../../classes/simple-timer/SimpleTimer.js';
|
||||
import { timerConfig } from '../../setup/config.js';
|
||||
@@ -26,13 +26,11 @@ export class AuxTimerService {
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies custom names to the aux timers and broadcasts the change.
|
||||
* Names are given in aux timer order (index 0 is aux timer 1).
|
||||
* Used to seed the names at bootstrap and to keep them in sync
|
||||
* with the settings of the loaded project.
|
||||
* Called at bootstrap and whenever the loaded project's settings change,
|
||||
* so the running timers reflect the current project's aux timer names.
|
||||
*/
|
||||
loadNames(names?: string[]) {
|
||||
const [name1, name2, name3] = normaliseAuxTimerNames(names);
|
||||
const [name1, name2, name3] = sanitiseAuxTimerNames(names);
|
||||
const patch: AuxTimerStateUpdate = {
|
||||
auxtimer1: this.aux1.setName(name1),
|
||||
auxtimer2: this.aux2.setName(name2),
|
||||
|
||||
Reference in New Issue
Block a user