From 6c7da6f653b452f1ce9d2995eae65606703598ab Mon Sep 17 00:00:00 2001 From: Aria Minaei Date: Thu, 9 Mar 2023 12:43:41 +0100 Subject: [PATCH] UX improvements for PlayheadPositionPopover --- .../RightOverlay/PlayheadPositionPopover.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/theatre/studio/src/panels/SequenceEditorPanel/RightOverlay/PlayheadPositionPopover.tsx b/theatre/studio/src/panels/SequenceEditorPanel/RightOverlay/PlayheadPositionPopover.tsx index da776c9..046eb42 100644 --- a/theatre/studio/src/panels/SequenceEditorPanel/RightOverlay/PlayheadPositionPopover.tsx +++ b/theatre/studio/src/panels/SequenceEditorPanel/RightOverlay/PlayheadPositionPopover.tsx @@ -33,7 +33,7 @@ const PlayheadPositionPopover: React.FC<{ * Called when user hits enter/escape */ onRequestClose: (reason: string) => void -}> = ({layoutP}) => { +}> = ({layoutP, onRequestClose}) => { const sheet = val(layoutP.sheet) const sequence = sheet.getSequence() @@ -53,6 +53,7 @@ const PlayheadPositionPopover: React.FC<{ if (tempPosition) { tempPosition = undefined sequence.position = originalPosition + onRequestClose('discardTemporaryValue') } }, permanentlySetValue(newPosition: number): void { @@ -60,6 +61,7 @@ const PlayheadPositionPopover: React.FC<{ tempPosition = undefined } sequence.position = clamp(newPosition, 0, sequence.length) + onRequestClose('permanentlySetValue') }, } }, [layoutP, sequence]) @@ -72,11 +74,13 @@ const PlayheadPositionPopover: React.FC<{ return usePrism(() => { const sequence = sheet.getSequence() + const value = Number(val(sequence.pointer.position).toFixed(3)) + return (