From 51f968ec87d1e7520ba78a31921eb25faa7412bc Mon Sep 17 00:00:00 2001 From: Phuong Le <39565248+func25@users.noreply.github.com> Date: Wed, 13 May 2026 12:25:40 +0700 Subject: [PATCH] fix(studio): keep preview selection overlay visible for selected elements (#777) --- packages/studio/src/App.tsx | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/packages/studio/src/App.tsx b/packages/studio/src/App.tsx index fde60e971..d0491c98e 100644 --- a/packages/studio/src/App.tsx +++ b/packages/studio/src/App.tsx @@ -26,7 +26,6 @@ import { STUDIO_MOTION_PANEL_ENABLED, } from "./components/editor/manualEditingAvailability"; import { getStudioMotionForSelection } from "./components/editor/studioMotion"; -import { getTimelineElementKey, isTimelineElementActiveAtTime } from "./utils/timelineInspector"; import type { DomEditSelection } from "./components/editor/domEditing"; import { AskAgentModal } from "./components/AskAgentModal"; import { StudioHeader } from "./components/StudioHeader"; @@ -79,7 +78,6 @@ export function StudioApp() { const captionSync = useCaptionSync(projectId); const currentTime = usePlayerStore((s) => s.currentTime); const timelineElements = usePlayerStore((s) => s.elements); - const selectedTimelineElementId = usePlayerStore((s) => s.selectedElementId); const setSelectedTimelineElementId = usePlayerStore((s) => s.setSelectedElementId); const timelineDuration = usePlayerStore((s) => s.duration); const isPlaying = usePlayerStore((s) => s.isPlaying); @@ -284,14 +282,6 @@ export function StudioApp() { domEditSession.domEditSelection, ) : null; - const selectedTimelineElement = useMemo( - () => - selectedTimelineElementId - ? (timelineElements.find((el) => getTimelineElementKey(el) === selectedTimelineElementId) ?? - null) - : null, - [selectedTimelineElementId, timelineElements], - ); const designPanelActive = STUDIO_INSPECTOR_PANELS_ENABLED && panelLayout.rightPanelTab === "design"; const motionPanelActive = @@ -300,11 +290,7 @@ export function StudioApp() { panelLayout.rightPanelTab === "motion"; const inspectorPanelActive = designPanelActive || motionPanelActive; const shouldShowSelectedDomBounds = - inspectorPanelActive && - !panelLayout.rightCollapsed && - !isPlaying && - (!selectedTimelineElement || - isTimelineElementActiveAtTime(currentTime, selectedTimelineElement)); + inspectorPanelActive && !panelLayout.rightCollapsed && !isPlaying; const inspectorButtonActive = STUDIO_INSPECTOR_PANELS_ENABLED && !panelLayout.rightCollapsed && inspectorPanelActive;