Rends les items de la queue de lecture cliquables.

This commit is contained in:
2025-12-27 14:56:45 +01:00
parent 6d9c50d454
commit 40cce9f894
8 changed files with 268 additions and 4 deletions

View File

@@ -3,17 +3,26 @@ import { computed, ref, watch, nextTick, toRef } from 'vue'
import { useRenderer } from '@/composables/useRenderers'
import QueueItem from './QueueItem.vue'
import { Link } from 'lucide-vue-next'
import type { QueueItem as QueueItemType } from '@/services/pmocontrol/types'
const props = defineProps<{
rendererId: string
}>()
const emit = defineEmits<{
clickItem: [item: QueueItemType]
}>()
const { queue, binding } = useRenderer(toRef(props, 'rendererId'))
const isAttached = computed(() => !!binding.value)
const queueContainer = ref<HTMLElement | null>(null)
function handleItemClick(item: QueueItemType) {
emit('clickItem', item)
}
// Auto-scroll vers la piste courante lors de l'ouverture
watch(() => queue.value?.current_index, async (currentIndex) => {
if (currentIndex !== null && currentIndex !== undefined && queueContainer.value) {
@@ -53,6 +62,7 @@ watch(() => queue.value?.current_index, async (currentIndex) => {
:key="item.index"
:item="item"
:is-current="item.index === queue.current_index"
@click="handleItemClick"
/>
</div>