chore: rename projected > expected

This commit is contained in:
Carlos Valente
2025-08-06 05:53:25 +02:00
committed by Carlos Valente
parent b4aaa8966f
commit dddeefd544
12 changed files with 51 additions and 51 deletions
+2 -2
View File
@@ -7,8 +7,8 @@ export const langDe: TranslationObject = {
'common.next': 'Nächste', 'common.next': 'Nächste',
'common.scheduled_start': 'Geplanter beginn', 'common.scheduled_start': 'Geplanter beginn',
'common.scheduled_end': 'Geplantes ende', 'common.scheduled_end': 'Geplantes ende',
'common.projected_start': 'Erwartetes beginn', 'common.expected_start': 'Erwartetes beginn',
'common.projected_end': 'Erwartetes ende', 'common.expected_end': 'Erwartetes ende',
'common.stage_timer': 'Bühnen-Timer', 'common.stage_timer': 'Bühnen-Timer',
'common.started_at': 'Gestartet am', 'common.started_at': 'Gestartet am',
'common.time_now': 'Aktuelle Zeit', 'common.time_now': 'Aktuelle Zeit',
+2 -2
View File
@@ -5,8 +5,8 @@ export const langEn = {
'common.next': 'Next', 'common.next': 'Next',
'common.scheduled_start': 'Scheduled start', 'common.scheduled_start': 'Scheduled start',
'common.scheduled_end': 'Scheduled end', 'common.scheduled_end': 'Scheduled end',
'common.projected_start': 'Projected start', 'common.expected_start': 'Expected start',
'common.projected_end': 'Projected end', 'common.expected_end': 'Expected end',
'common.stage_timer': 'Stage Timer', 'common.stage_timer': 'Stage Timer',
'common.started_at': 'Started At', 'common.started_at': 'Started At',
'common.time_now': 'Time now', 'common.time_now': 'Time now',
+2 -2
View File
@@ -7,8 +7,8 @@ export const langEs: TranslationObject = {
'common.next': 'Siguiente', 'common.next': 'Siguiente',
'common.scheduled_start': 'Inicio programado', 'common.scheduled_start': 'Inicio programado',
'common.scheduled_end': 'Fin programado', 'common.scheduled_end': 'Fin programado',
'common.projected_start': 'Inicio previsto', 'common.expected_start': 'Inicio previsto',
'common.projected_end': 'Fin previsto', 'common.expected_end': 'Fin previsto',
'common.stage_timer': 'Temporizador de presentador', 'common.stage_timer': 'Temporizador de presentador',
'common.started_at': 'Iniciado en', 'common.started_at': 'Iniciado en',
'common.time_now': 'Ahora', 'common.time_now': 'Ahora',
+2 -2
View File
@@ -7,8 +7,8 @@ export const langFr: TranslationObject = {
'common.next': 'A suivre', 'common.next': 'A suivre',
'common.scheduled_start': 'Début prévu', 'common.scheduled_start': 'Début prévu',
'common.scheduled_end': 'Fin prévue', 'common.scheduled_end': 'Fin prévue',
'common.projected_start': 'Début projeté', 'common.expected_start': 'Début projeté',
'common.projected_end': 'Fin projetée', 'common.expected_end': 'Fin projetée',
'common.stage_timer': 'Minuteur de scène', 'common.stage_timer': 'Minuteur de scène',
'common.started_at': 'Commencé à', 'common.started_at': 'Commencé à',
'common.time_now': 'Heure', 'common.time_now': 'Heure',
+2 -2
View File
@@ -7,8 +7,8 @@ export const langIt: TranslationObject = {
'common.next': 'Prossimo', 'common.next': 'Prossimo',
'common.scheduled_start': 'Inizio programmato', 'common.scheduled_start': 'Inizio programmato',
'common.scheduled_end': 'Fine programmata', 'common.scheduled_end': 'Fine programmata',
'common.projected_start': 'Inizio previsto', 'common.expected_start': 'Inizio previsto',
'common.projected_end': 'Fine prevista', 'common.expected_end': 'Fine prevista',
'common.stage_timer': 'Orologio Palco', 'common.stage_timer': 'Orologio Palco',
'common.started_at': 'Iniziato Alle', 'common.started_at': 'Iniziato Alle',
'common.time_now': 'Ora attuale', 'common.time_now': 'Ora attuale',
+2 -2
View File
@@ -7,8 +7,8 @@ export const langPt: TranslationObject = {
'common.next': 'Próximo', 'common.next': 'Próximo',
'common.scheduled_start': 'Início programado', 'common.scheduled_start': 'Início programado',
'common.scheduled_end': 'Fim programado', 'common.scheduled_end': 'Fim programado',
'common.projected_start': 'Início previsto', 'common.expected_start': 'Início previsto',
'common.projected_end': 'Fim previsto', 'common.expected_end': 'Fim previsto',
'common.stage_timer': 'Temporizador do presentador', 'common.stage_timer': 'Temporizador do presentador',
'common.started_at': 'Iniciado em', 'common.started_at': 'Iniciado em',
'common.time_now': 'Hora atual', 'common.time_now': 'Hora atual',
@@ -24,11 +24,11 @@ interface ScheduleItemProps {
export default function ScheduleItem(props: ScheduleItemProps) { export default function ScheduleItem(props: ScheduleItemProps) {
const { timeStart, timeEnd, title, colour, skip, delay } = props; const { timeStart, timeEnd, title, colour, skip, delay } = props;
const { showProjected } = useScheduleOptions(); const { showExpected } = useScheduleOptions();
if (showProjected) { if (showExpected) {
return ( return (
<ProjectedScheduleItem <ExpectedScheduleItem
timeStart={timeStart} timeStart={timeStart}
timeEnd={timeEnd} timeEnd={timeEnd}
title={title} title={title}
@@ -95,34 +95,34 @@ function DelayedScheduleItem(props: ScheduleItemProps) {
); );
} }
function ProjectedScheduleItem(props: ScheduleItemProps) { function ExpectedScheduleItem(props: ScheduleItemProps) {
const { timeStart, timeEnd, title, colour, skip, delay } = props; const { timeStart, timeEnd, title, colour, skip, delay } = props;
return ( return (
<li className={cx(['entry', skip && 'entry--skip'])}> <li className={cx(['entry', skip && 'entry--skip'])}>
<div className='entry-times'> <div className='entry-times'>
<span className='entry-colour' style={{ backgroundColor: colour }} /> <span className='entry-colour' style={{ backgroundColor: colour }} />
<ProjectedTime time={timeStart} delay={delay} /> <ExpectedTime time={timeStart} delay={delay} />
<ProjectedTime time={timeEnd} delay={delay} /> <ExpectedTime time={timeEnd} delay={delay} />
</div> </div>
<div className='entry-title'>{title}</div> <div className='entry-title'>{title}</div>
</li> </li>
); );
} }
interface OffsetTimeProps { interface ExpectedTimeProps {
time: number; time: number;
delay: number; delay: number;
} }
function ProjectedTime(props: OffsetTimeProps) { function ExpectedTime(props: ExpectedTimeProps) {
const { time, delay } = props; const { time, delay } = props;
const { offset } = useRuntimeOffset(); const { offset } = useRuntimeOffset();
const projectedOffset = offset - delay; const expectedOffset = offset - delay;
const projectedTime = formatTime(time - offset, formatOptions); const expectedTime = formatTime(time - offset, formatOptions);
const projectedState = getOffsetState(projectedOffset); const expectedState = getOffsetState(expectedOffset);
return <SuperscriptTime className={`entry-times--${projectedState}`} time={projectedTime} />; return <SuperscriptTime className={`entry-times--${expectedState}`} time={expectedTime} />;
} }
@@ -24,9 +24,9 @@ export const scheduleOptions: ViewOption = {
defaultValue: 10, defaultValue: 10,
}, },
{ {
id: 'showProjected', id: 'showExpected',
title: 'Show projected time', title: 'Show expected time',
description: 'Whether scheduled times should account for runtime offset.', description: 'Whether the times shown should account for the runtime offset.',
type: 'boolean', type: 'boolean',
defaultValue: false, defaultValue: false,
}, },
@@ -36,14 +36,14 @@ export const scheduleOptions: ViewOption = {
type ScheduleOptions = { type ScheduleOptions = {
cycleInterval: number; cycleInterval: number;
stopCycle: boolean; stopCycle: boolean;
showProjected: boolean; showExpected: boolean;
}; };
function getScheduleOptionsFromParams(searchParams: URLSearchParams): ScheduleOptions { function getScheduleOptionsFromParams(searchParams: URLSearchParams): ScheduleOptions {
return { return {
cycleInterval: Number(searchParams.get('cycleInterval')) || 10, cycleInterval: Number(searchParams.get('cycleInterval')) || 10,
stopCycle: isStringBoolean(searchParams.get('stopCycle')), stopCycle: isStringBoolean(searchParams.get('stopCycle')),
showProjected: isStringBoolean(searchParams.get('showProjected')), showExpected: isStringBoolean(searchParams.get('showExpected')),
}; };
} }
@@ -33,7 +33,7 @@ export default function CountdownSubscriptions({
selectedId, selectedId,
goToEditMode, goToEditMode,
}: CountdownSubscriptionsProps) { }: CountdownSubscriptionsProps) {
const { secondarySource, showProjected } = useCountdownOptions(); const { secondarySource, showExpected } = useCountdownOptions();
const showFab = useFadeOutOnInactivity(true); const showFab = useFadeOutOnInactivity(true);
const timeoutId = useRef<NodeJS.Timeout | null>(null); const timeoutId = useRef<NodeJS.Timeout | null>(null);
@@ -97,8 +97,8 @@ export default function CountdownSubscriptions({
<div key={event.id} ref={isLive ? selectedRef : undefined} className={cx(['sub', isLive && 'sub--live'])}> <div key={event.id} ref={isLive ? selectedRef : undefined} className={cx(['sub', isLive && 'sub--live'])}>
<div className='sub__binder' style={{ '--user-color': event.colour }} /> <div className='sub__binder' style={{ '--user-color': event.colour }} />
<div className={cx(['sub__schedule', event.delay > 0 && 'sub__schedule--delayed'])}> <div className={cx(['sub__schedule', event.delay > 0 && 'sub__schedule--delayed'])}>
{showProjected ? ( {showExpected ? (
<ProjectedSchedule timeStart={event.timeStart} timeEnd={event.timeEnd} delay={event.delay} /> <ExpectedSchedule timeStart={event.timeStart} timeEnd={event.timeEnd} delay={event.delay} />
) : ( ) : (
<> <>
<ClockTime value={event.timeStart + event.delay} preferredFormat12='h:mm' preferredFormat24='HH:mm' /> <ClockTime value={event.timeStart + event.delay} preferredFormat12='h:mm' preferredFormat24='HH:mm' />
@@ -123,30 +123,30 @@ export default function CountdownSubscriptions({
); );
} }
interface ProjectedScheduleProps { interface ExpectedScheduleProps {
timeStart: number; timeStart: number;
timeEnd: number; timeEnd: number;
delay: number; delay: number;
} }
function ProjectedSchedule(props: ProjectedScheduleProps) { function ExpectedSchedule(props: ExpectedScheduleProps) {
const { timeStart, timeEnd, delay } = props; const { timeStart, timeEnd, delay } = props;
const { offset } = useRuntimeOffset(); const { offset } = useRuntimeOffset();
// offset is negative if we are ahead // offset is negative if we are ahead
const projectedOffset = offset - delay; const expectedOffset = offset - delay;
const projectState = getOffsetState(projectedOffset); const expectedState = getOffsetState(expectedOffset);
return ( return (
<> <>
<ClockTime <ClockTime
value={timeStart - projectedOffset} value={timeStart - expectedOffset}
className={`sub__schedule--${projectState}`} className={`sub__schedule--${expectedState}`}
preferredFormat12='h:mm' preferredFormat12='h:mm'
preferredFormat24='HH:mm' preferredFormat24='HH:mm'
/> />
<ClockTime value={timeEnd - projectedOffset} preferredFormat12='h:mm' preferredFormat24='HH:mm' /> <ClockTime value={timeEnd - expectedOffset} preferredFormat12='h:mm' preferredFormat24='HH:mm' />
</> </>
); );
} }
@@ -161,7 +161,7 @@ function SubscriptionStatus({ time, event, selectedId }: SubscriptionStatusProps
const { getLocalizedString } = useTranslation(); const { getLocalizedString } = useTranslation();
const { currentDay } = useCurrentDay(); const { currentDay } = useCurrentDay();
const { offset } = useRuntimeOffset(); const { offset } = useRuntimeOffset();
const { showProjected } = useCountdownOptions(); const { showExpected } = useCountdownOptions();
// TODO: use reporter values as in the event block chip // TODO: use reporter values as in the event block chip
const { status, timer } = getSubscriptionDisplayData( const { status, timer } = getSubscriptionDisplayData(
@@ -171,7 +171,7 @@ function SubscriptionStatus({ time, event, selectedId }: SubscriptionStatusProps
offset, offset,
currentDay, currentDay,
getLocalizedString('common.minutes'), getLocalizedString('common.minutes'),
showProjected, showExpected,
); );
return ( return (
@@ -36,9 +36,9 @@ export const getCountdownOptions = (
collapsible: true, collapsible: true,
options: [ options: [
{ {
id: 'showProjected', id: 'showExpected',
title: 'Show projected time', title: 'Show expected time',
description: 'Whether scheduled times should account for runtime offset', description: 'Whether the times shown should account for the runtime offset.',
type: 'boolean', type: 'boolean',
defaultValue: false, defaultValue: false,
}, },
@@ -62,7 +62,7 @@ export const getCountdownOptions = (
type CountdownOptions = { type CountdownOptions = {
subscriptions: EntryId[]; subscriptions: EntryId[];
secondarySource: keyof OntimeEvent | null; secondarySource: keyof OntimeEvent | null;
showProjected: boolean; showExpected: boolean;
}; };
/** /**
@@ -74,7 +74,7 @@ function getOptionsFromParams(searchParams: URLSearchParams): CountdownOptions {
return { return {
subscriptions: searchParams.getAll('sub') as EntryId[], subscriptions: searchParams.getAll('sub') as EntryId[],
secondarySource: searchParams.get('secondary-src') as keyof OntimeEvent | null, secondarySource: searchParams.get('secondary-src') as keyof OntimeEvent | null,
showProjected: isStringBoolean(searchParams.get('showProjected')), showExpected: isStringBoolean(searchParams.get('showExpected')),
}; };
} }
@@ -52,9 +52,9 @@ export function getSubscriptionDisplayData(
offset: number, offset: number,
currentDay: number, currentDay: number,
minutesString: string, minutesString: string,
showProjected = false, showExpected = false,
): { status: ProgressStatus; timer: string } { ): { status: ProgressStatus; timer: string } {
const offsetAndDelay = showProjected ? offset + subscribedEvent.delay : 0; const offsetAndDelay = showExpected ? offset + subscribedEvent.delay : 0;
if (selectedId === subscribedEvent.id) { if (selectedId === subscribedEvent.id) {
// 1. An event that is loaded but not running is {'due': <countdown | overtime>} // 1. An event that is loaded but not running is {'due': <countdown | overtime>}
@@ -139,7 +139,7 @@ export function getSubscriptionDisplayData(
}; };
} }
// the event here has to be due, we show the countdown the projected start time // the event here has to be due, we show the countdown the expected start time
return { return {
status: 'due', status: 'due',
timer: getFormattedTimer( timer: getFormattedTimer(
@@ -63,7 +63,7 @@ export default function StudioTimers({
</div> </div>
</div> </div>
<div> <div>
<div className='label right'>{getLocalizedString('common.projected_end')}</div> <div className='label right'>{getLocalizedString('common.expected_end')}</div>
<div className='runtime-timer right'>{schedule.expectedEnd}</div> <div className='runtime-timer right'>{schedule.expectedEnd}</div>
</div> </div>
</div> </div>
@@ -103,7 +103,7 @@ export default function StudioTimers({
</div> </div>
</div> </div>
<div> <div>
<div className='label right'>{getLocalizedString('common.projected_end')}</div> <div className='label right'>{getLocalizedString('common.expected_end')}</div>
<div className='runtime-timer right'>{event.expectedEnd}</div> <div className='runtime-timer right'>{event.expectedEnd}</div>
</div> </div>
</div> </div>