From ef5e7f40ed5a2fc0feec2606700312b9e2bf24cb Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Wed, 15 Apr 2026 00:49:26 +0200 Subject: [PATCH] Remove ProjectSequencesPanel component and its associated logic --- src/app/ProjectSequencesPanel.tsx | 537 ------------------------------ 1 file changed, 537 deletions(-) delete mode 100644 src/app/ProjectSequencesPanel.tsx diff --git a/src/app/ProjectSequencesPanel.tsx b/src/app/ProjectSequencesPanel.tsx deleted file mode 100644 index f9122c7f..00000000 --- a/src/app/ProjectSequencesPanel.tsx +++ /dev/null @@ -1,537 +0,0 @@ -import type { KeyboardEvent as ReactKeyboardEvent } from "react"; - -import { formatControlEffectValue, getControlTargetRefKey } from "../controls/control-surface"; -import { type ProjectDialogueLibrary, getProjectDialogues } from "../dialogues/project-dialogues"; -import { - getProjectScheduleEffectOptionId, - getProjectScheduleTargetOptionByKey, - listProjectScheduleEffectOptions, - type ProjectScheduleEffectOptionId, - type ProjectScheduleTargetOption -} from "../scheduler/project-schedule-control-options"; -import { - getProjectSequenceHeldSteps, - getProjectSequenceImpulseSteps, - getSequenceClipLabel, - type SequenceClip -} from "../sequencer/project-sequence-steps"; -import { - getProjectSequences, - type ProjectSequenceLibrary -} from "../sequencer/project-sequences"; - -interface ProjectSequencesPanelProps { - sequences: ProjectSequenceLibrary; - dialogues: ProjectDialogueLibrary; - targetOptions: ProjectScheduleTargetOption[]; - selectedSequenceId: string | null; - onSelectSequence(sequenceId: string | null): void; - onAddSequence(): void; - onDeleteSequence(sequenceId: string): void; - onSetSequenceTitle(sequenceId: string, title: string): void; - onAddHeldControlStep(sequenceId: string, targetKey: string): void; - onAddImpulseControlStep(sequenceId: string, targetKey: string): void; - onAddDialogueStep(sequenceId: string, dialogueId: string): void; - onDeleteStep(sequenceId: string, stepIndex: number): void; - onSetControlStepTarget( - sequenceId: string, - stepIndex: number, - targetKey: string - ): void; - onSetControlStepEffectOption( - sequenceId: string, - stepIndex: number, - effectOptionId: ProjectScheduleEffectOptionId - ): void; - onSetControlStepNumericValue( - sequenceId: string, - stepIndex: number, - value: number - ): void; - onSetControlStepColorValue( - sequenceId: string, - stepIndex: number, - colorHex: string - ): void; - onSetControlStepAnimationClip( - sequenceId: string, - stepIndex: number, - clipName: string - ): void; - onSetControlStepAnimationLoop( - sequenceId: string, - stepIndex: number, - loop: boolean - ): void; - onSetDialogueStepDialogueId( - sequenceId: string, - stepIndex: number, - dialogueId: string - ): void; -} - -function commitOnEnter( - event: ReactKeyboardEvent, - commit: () => void -) { - if (event.key !== "Enter") { - return; - } - - event.currentTarget.blur(); - commit(); -} - -function getControlClipNumericValue(clip: Extract): number | null { - switch (clip.effect.type) { - case "setSoundVolume": - return clip.effect.volume; - case "setLightIntensity": - case "setAmbientLightIntensity": - case "setSunLightIntensity": - return clip.effect.intensity; - default: - return null; - } -} - -function getControlClipColorValue(clip: Extract): string | null { - switch (clip.effect.type) { - case "setLightColor": - case "setAmbientLightColor": - case "setSunLightColor": - return clip.effect.colorHex; - default: - return null; - } -} - -export function ProjectSequencesPanel({ - sequences, - dialogues, - targetOptions, - selectedSequenceId, - onSelectSequence, - onAddSequence, - onDeleteSequence, - onSetSequenceTitle, - onAddHeldControlStep, - onAddImpulseControlStep, - onAddDialogueStep, - onDeleteStep, - onSetControlStepTarget, - onSetControlStepEffectOption, - onSetControlStepNumericValue, - onSetControlStepColorValue, - onSetControlStepAnimationClip, - onSetControlStepAnimationLoop, - onSetDialogueStepDialogueId -}: ProjectSequencesPanelProps) { - const sequenceList = getProjectSequences(sequences); - const dialogueList = getProjectDialogues(dialogues); - const selectedSequence = - selectedSequenceId === null - ? null - : sequences.sequences[selectedSequenceId] ?? null; - - return ( -
-
Sequences
- {sequenceList.length === 0 ? ( -
No project sequences authored yet.
- ) : ( -
- {sequenceList.map((sequence) => ( -
-
- - -
-
- ))} -
- )} - -
- -
- - {selectedSequence === null ? ( -
- Select a sequence to edit its title and steps. -
- ) : ( -
-
- Build a sequence from clips. Held clips resolve over a timeline - placement; impulse clips can be started immediately from - interaction links. -
- - -
Steps
- {selectedSequence.clips.length === 0 ? ( -
- Add held control, impulse control, or dialogue clips. Interaction - links can only run sequences that contain at least one impulse - clip. -
- ) : ( -
- {selectedSequence.clips.map((clip, clipIndex) => { - if (clip.type === "controlEffect") { - const targetKey = getControlTargetRefKey(clip.effect.target); - const targetOption = - getProjectScheduleTargetOptionByKey(targetOptions, targetKey); - const effectOptions = - targetOption === null - ? [] - : listProjectScheduleEffectOptions(targetOption); - const effectOptionId = - targetOption === null - ? null - : (() => { - try { - return getProjectScheduleEffectOptionId(clip.effect); - } catch { - return null; - } - })(); - const selectedEffectOption = - effectOptionId === null - ? null - : effectOptions.find((option) => option.id === effectOptionId) ?? - null; - - return ( -
-
-
- {getSequenceClipLabel(clip)} -
- -
- - {targetOption === null || effectOptionId === null ? ( -
- {formatControlEffectValue(clip.effect)}. This control clip - is preserved, but the current sequence editor can only edit - control targets/effects that are exposed through the - existing sequencer target catalog. -
- ) : ( - <> -
- - -
- - - {selectedEffectOption?.valueKind === "number" ? ( - - ) : null} - - {selectedEffectOption?.valueKind === "color" ? ( - - ) : null} - - {selectedEffectOption?.valueKind === "animation" ? ( - <> - - - - ) : null} - - )} -
- ); - } - - if (clip.type === "startDialogue") { - return ( -
-
-
- {getSequenceClipLabel(clip)} -
- -
- - -
- ); - } - - return ( -
-
-
- {getSequenceClipLabel(clip)} -
- -
- -
- This impulse clip is preserved, but the current sequence - editor only exposes direct dialogue authoring for authored - project sequences. -
-
- ); - })} -
- )} - -
- - - -
-
- )} -
- ); -}