fix(teleprompter): apply the flip params on change, not only on mount

The flip options seeded useState and were then never read again, so a change
took effect only on a fresh load. Toggling flip in the view options did
nothing until the page was reloaded.

They now sync when the param changes, the way the speed option already does,
while the F key still owns the state between changes.

This also matters beyond the params editor. Ontime can redirect a specific
client to a path, and the teleprompter keeps its whole configuration in the
query string, so one device can already reconfigure a prompter running on
another. Verified that a same route query change applies live and leaves the
scroll position untouched, which is what makes that usable during a show.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cb8RVPNQ2ETPJxdy4b8CHf
This commit is contained in:
Claude
2026-08-14 17:32:16 +00:00
parent 23a184244c
commit 8233261606
@@ -1,5 +1,5 @@
import { OntimeView } from 'ontime-types';
import { type CSSProperties, useState } from 'react';
import { type CSSProperties, useEffect, useState } from 'react';
import EmptyPage from '../../common/components/state/EmptyPage';
import ViewParamsEditor from '../../common/components/view-params-editor/ViewParamsEditor';
@@ -50,6 +50,16 @@ function Teleprompter({ rundown, rundownMetadata, customFields }: TeleprompterDa
const [flipV, setFlipV] = useState(options.flipV);
const [showHelp, setShowHelp] = useState(false);
/**
* The flip params seed the local state, which the F key then owns.
* Without this the params would only ever apply on mount, so changing them in
* the view options, or from another device by redirecting this client to the
* same view with a different query, would silently do nothing.
* The speed option is kept live the same way, inside useTeleprompterScroll.
*/
useEffect(() => setFlipH(options.flipH), [options.flipH]);
useEffect(() => setFlipV(options.flipV), [options.flipV]);
const viewOptions = getTeleprompterOptions(customFields);
const blocks = buildScript(rundown, rundownMetadata, customFields, {