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.scheduled_start': 'Geplanter beginn',
'common.scheduled_end': 'Geplantes ende',
'common.projected_start': 'Erwartetes beginn',
'common.projected_end': 'Erwartetes ende',
'common.expected_start': 'Erwartetes beginn',
'common.expected_end': 'Erwartetes ende',
'common.stage_timer': 'Bühnen-Timer',
'common.started_at': 'Gestartet am',
'common.time_now': 'Aktuelle Zeit',
+2 -2
View File
@@ -5,8 +5,8 @@ export const langEn = {
'common.next': 'Next',
'common.scheduled_start': 'Scheduled start',
'common.scheduled_end': 'Scheduled end',
'common.projected_start': 'Projected start',
'common.projected_end': 'Projected end',
'common.expected_start': 'Expected start',
'common.expected_end': 'Expected end',
'common.stage_timer': 'Stage Timer',
'common.started_at': 'Started At',
'common.time_now': 'Time now',
+2 -2
View File
@@ -7,8 +7,8 @@ export const langEs: TranslationObject = {
'common.next': 'Siguiente',
'common.scheduled_start': 'Inicio programado',
'common.scheduled_end': 'Fin programado',
'common.projected_start': 'Inicio previsto',
'common.projected_end': 'Fin previsto',
'common.expected_start': 'Inicio previsto',
'common.expected_end': 'Fin previsto',
'common.stage_timer': 'Temporizador de presentador',
'common.started_at': 'Iniciado en',
'common.time_now': 'Ahora',
+2 -2
View File
@@ -7,8 +7,8 @@ export const langFr: TranslationObject = {
'common.next': 'A suivre',
'common.scheduled_start': 'Début prévu',
'common.scheduled_end': 'Fin prévue',
'common.projected_start': 'Début projeté',
'common.projected_end': 'Fin projetée',
'common.expected_start': 'Début projeté',
'common.expected_end': 'Fin projetée',
'common.stage_timer': 'Minuteur de scène',
'common.started_at': 'Commencé à',
'common.time_now': 'Heure',
+2 -2
View File
@@ -7,8 +7,8 @@ export const langIt: TranslationObject = {
'common.next': 'Prossimo',
'common.scheduled_start': 'Inizio programmato',
'common.scheduled_end': 'Fine programmata',
'common.projected_start': 'Inizio previsto',
'common.projected_end': 'Fine prevista',
'common.expected_start': 'Inizio previsto',
'common.expected_end': 'Fine prevista',
'common.stage_timer': 'Orologio Palco',
'common.started_at': 'Iniziato Alle',
'common.time_now': 'Ora attuale',
+2 -2
View File
@@ -7,8 +7,8 @@ export const langPt: TranslationObject = {
'common.next': 'Próximo',
'common.scheduled_start': 'Início programado',
'common.scheduled_end': 'Fim programado',
'common.projected_start': 'Início previsto',
'common.projected_end': 'Fim previsto',
'common.expected_start': 'Início previsto',
'common.expected_end': 'Fim previsto',
'common.stage_timer': 'Temporizador do presentador',
'common.started_at': 'Iniciado em',
'common.time_now': 'Hora atual',
@@ -24,11 +24,11 @@ interface ScheduleItemProps {
export default function ScheduleItem(props: ScheduleItemProps) {
const { timeStart, timeEnd, title, colour, skip, delay } = props;
const { showProjected } = useScheduleOptions();
const { showExpected } = useScheduleOptions();
if (showProjected) {
if (showExpected) {
return (
<ProjectedScheduleItem
<ExpectedScheduleItem
timeStart={timeStart}
timeEnd={timeEnd}
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;
return (
<li className={cx(['entry', skip && 'entry--skip'])}>
<div className='entry-times'>
<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 className='entry-title'>{title}</div>
</li>
);
}
interface OffsetTimeProps {
interface ExpectedTimeProps {
time: number;
delay: number;
}
function ProjectedTime(props: OffsetTimeProps) {
function ExpectedTime(props: ExpectedTimeProps) {
const { time, delay } = props;
const { offset } = useRuntimeOffset();
const projectedOffset = offset - delay;
const projectedTime = formatTime(time - offset, formatOptions);
const projectedState = getOffsetState(projectedOffset);
const expectedOffset = offset - delay;
const expectedTime = formatTime(time - offset, formatOptions);
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,
},
{
id: 'showProjected',
title: 'Show projected time',
description: 'Whether scheduled times should account for runtime offset.',
id: 'showExpected',
title: 'Show expected time',
description: 'Whether the times shown should account for the runtime offset.',
type: 'boolean',
defaultValue: false,
},
@@ -36,14 +36,14 @@ export const scheduleOptions: ViewOption = {
type ScheduleOptions = {
cycleInterval: number;
stopCycle: boolean;
showProjected: boolean;
showExpected: boolean;
};
function getScheduleOptionsFromParams(searchParams: URLSearchParams): ScheduleOptions {
return {
cycleInterval: Number(searchParams.get('cycleInterval')) || 10,
stopCycle: isStringBoolean(searchParams.get('stopCycle')),
showProjected: isStringBoolean(searchParams.get('showProjected')),
showExpected: isStringBoolean(searchParams.get('showExpected')),
};
}
@@ -33,7 +33,7 @@ export default function CountdownSubscriptions({
selectedId,
goToEditMode,
}: CountdownSubscriptionsProps) {
const { secondarySource, showProjected } = useCountdownOptions();
const { secondarySource, showExpected } = useCountdownOptions();
const showFab = useFadeOutOnInactivity(true);
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 className='sub__binder' style={{ '--user-color': event.colour }} />
<div className={cx(['sub__schedule', event.delay > 0 && 'sub__schedule--delayed'])}>
{showProjected ? (
<ProjectedSchedule timeStart={event.timeStart} timeEnd={event.timeEnd} delay={event.delay} />
{showExpected ? (
<ExpectedSchedule timeStart={event.timeStart} timeEnd={event.timeEnd} delay={event.delay} />
) : (
<>
<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;
timeEnd: number;
delay: number;
}
function ProjectedSchedule(props: ProjectedScheduleProps) {
function ExpectedSchedule(props: ExpectedScheduleProps) {
const { timeStart, timeEnd, delay } = props;
const { offset } = useRuntimeOffset();
// offset is negative if we are ahead
const projectedOffset = offset - delay;
const projectState = getOffsetState(projectedOffset);
const expectedOffset = offset - delay;
const expectedState = getOffsetState(expectedOffset);
return (
<>
<ClockTime
value={timeStart - projectedOffset}
className={`sub__schedule--${projectState}`}
value={timeStart - expectedOffset}
className={`sub__schedule--${expectedState}`}
preferredFormat12='h: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 { currentDay } = useCurrentDay();
const { offset } = useRuntimeOffset();
const { showProjected } = useCountdownOptions();
const { showExpected } = useCountdownOptions();
// TODO: use reporter values as in the event block chip
const { status, timer } = getSubscriptionDisplayData(
@@ -171,7 +171,7 @@ function SubscriptionStatus({ time, event, selectedId }: SubscriptionStatusProps
offset,
currentDay,
getLocalizedString('common.minutes'),
showProjected,
showExpected,
);
return (
@@ -36,9 +36,9 @@ export const getCountdownOptions = (
collapsible: true,
options: [
{
id: 'showProjected',
title: 'Show projected time',
description: 'Whether scheduled times should account for runtime offset',
id: 'showExpected',
title: 'Show expected time',
description: 'Whether the times shown should account for the runtime offset.',
type: 'boolean',
defaultValue: false,
},
@@ -62,7 +62,7 @@ export const getCountdownOptions = (
type CountdownOptions = {
subscriptions: EntryId[];
secondarySource: keyof OntimeEvent | null;
showProjected: boolean;
showExpected: boolean;
};
/**
@@ -74,7 +74,7 @@ function getOptionsFromParams(searchParams: URLSearchParams): CountdownOptions {
return {
subscriptions: searchParams.getAll('sub') as EntryId[],
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,
currentDay: number,
minutesString: string,
showProjected = false,
showExpected = false,
): { status: ProgressStatus; timer: string } {
const offsetAndDelay = showProjected ? offset + subscribedEvent.delay : 0;
const offsetAndDelay = showExpected ? offset + subscribedEvent.delay : 0;
if (selectedId === subscribedEvent.id) {
// 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 {
status: 'due',
timer: getFormattedTimer(
@@ -63,7 +63,7 @@ export default function StudioTimers({
</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>
</div>
@@ -103,7 +103,7 @@ export default function StudioTimers({
</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>
</div>