From 8233261606e4b988af1c05a7cb6dc40123afc6a0 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 14 Aug 2026 17:32:16 +0000 Subject: [PATCH] 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 Claude-Session: https://claude.ai/code/session_01Cb8RVPNQ2ETPJxdy4b8CHf --- apps/client/src/views/teleprompter/Teleprompter.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/client/src/views/teleprompter/Teleprompter.tsx b/apps/client/src/views/teleprompter/Teleprompter.tsx index d2d000d87..8870a3a3d 100644 --- a/apps/client/src/views/teleprompter/Teleprompter.tsx +++ b/apps/client/src/views/teleprompter/Teleprompter.tsx @@ -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, {