mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 12:53:32 +00:00
feat(timer): allow swapping the secondary source into the main timer slot
The timer view lets operators show an aux timer or the secondary message
as a smaller secondary timer under the main event timer. This adds a
placement control so that selected source can be promoted into the main
slot, swapping positions with the event timer.
The swap is deliberate: the event timer is demoted to the secondary slot
rather than removed, so the show-critical countdown (and its phase colour)
is never lost from screen.
- add `SecondaryPlacement` ('below' | 'main') to the timer message, with
server validation and a store default
- expose the aux timer direction to the timer view and honour it when
formatting a promoted aux (previously hard-coded to count-down)
- add a `getTimerSlots` helper that assigns the event timer and secondary
content to the main/secondary slots, routing phase colour, paused/finished
styling and font sizing to whichever slot holds the event timer
- add a Placement radio control to the timer view panel (disabled until a
secondary source is active) and reflect the swap in the control preview
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MbgWVAXTJUX7E5pAmv6Rs7
This commit is contained in:
@@ -1,11 +1,19 @@
|
||||
export type SecondarySource = 'aux1' | 'aux2' | 'aux3' | 'secondary' | null;
|
||||
|
||||
/**
|
||||
* Where the selected secondary source is displayed in the timer view
|
||||
* - below: shown as a smaller timer under the main timer (default)
|
||||
* - main: swapped into the main slot, demoting the event timer to the secondary slot
|
||||
*/
|
||||
export type SecondaryPlacement = 'below' | 'main';
|
||||
|
||||
export type TimerMessage = {
|
||||
text: string;
|
||||
visible: boolean;
|
||||
blink: boolean;
|
||||
blackout: boolean;
|
||||
secondarySource: SecondarySource;
|
||||
secondaryPlacement: SecondaryPlacement;
|
||||
};
|
||||
|
||||
export type MessageState = {
|
||||
|
||||
@@ -24,6 +24,7 @@ export const runtimeStorePlaceholder: Readonly<RuntimeStore> = {
|
||||
blink: false,
|
||||
blackout: false,
|
||||
secondarySource: null,
|
||||
secondaryPlacement: 'below',
|
||||
},
|
||||
secondary: '',
|
||||
},
|
||||
|
||||
@@ -108,7 +108,12 @@ export type { ApiAction, ApiActionTag, ApiResponse } from './api/websocket/api.t
|
||||
export { type Log, LogLevel, type LogMessage, LogOrigin } from './definitions/runtime/Logger.type.js';
|
||||
export { Playback } from './definitions/runtime/Playback.type.js';
|
||||
export { TimerLifeCycle, timerLifecycleValues } from './definitions/core/TimerLifecycle.type.js';
|
||||
export type { TimerMessage, MessageState, SecondarySource } from './definitions/runtime/MessageControl.type.js';
|
||||
export type {
|
||||
TimerMessage,
|
||||
MessageState,
|
||||
SecondarySource,
|
||||
SecondaryPlacement,
|
||||
} from './definitions/runtime/MessageControl.type.js';
|
||||
|
||||
export type { RundownState } from './definitions/runtime/RundownState.type.js';
|
||||
export type { Offset } from './definitions/runtime/Offset.type.js';
|
||||
|
||||
Reference in New Issue
Block a user