Files
gods-eye-view/src/ui/views/SceneOptions.vue
T
Sameh Khamis 54b8060f71 fix(ui): keep the scene select on the published scene after a local pick
Re-apply the published scene to the select after every option render, as the imperative renderer did. The scene and visual-input QA scripts click a held shot label after disposal and wait a frame for the bloom row.
2026-10-30 23:56:20 -07:00

32 lines
910 B
Vue

<script setup>
import { storeToRefs } from 'pinia';
import { getCurrentInstance, watch } from 'vue';
import { useSceneStore } from '../stores/scenes.js';
// The Scene select's options; selecting one stays with SceneControls.
const { scenes, listedSceneId, listedRevision } = storeToRefs(useSceneStore());
// Every option render shows the published scene, as the select did before:
// `selected` alone is written only when it changes, so it would leave a
// person's later pick standing.
const instance = getCurrentInstance();
watch(
listedRevision,
() => {
const select = instance.proxy.$el?.parentNode;
if (select && listedSceneId.value) select.value = listedSceneId.value;
},
{ flush: 'post' },
);
</script>
<template>
<option
v-for="scene in scenes"
:key="scene.id"
:value="scene.id"
:selected="scene.id === listedSceneId"
>{{ scene.title }}</option
>
</template>