Fix player : plus de saut de morceaux, mode scroll par défaut, supprime toggle paginé, media → sources

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Yvv
2026-02-27 13:10:12 +01:00
parent 14d3a7b3e3
commit 8803087e77
2 changed files with 8 additions and 16 deletions

4
.gitignore vendored
View File

@@ -18,8 +18,8 @@ logs
.fleet
.idea
# Media sources (originaux, pas servis par l'appli)
media/
# Sources originales (PDF, JPG — pas servies par l'appli)
sources/
# Local env files
.env

View File

@@ -34,22 +34,11 @@
>
<div class="i-lucide-list h-5 w-5" />
</button>
<button
class="reader-bar-btn"
@click="toggleReadingMode"
:aria-label="isScrollMode ? 'Mode paginé' : 'Mode défilement'"
:title="isScrollMode ? 'Mode paginé' : 'Mode défilement'"
>
<div :class="isScrollMode ? 'i-lucide-book-open' : 'i-lucide-scroll-text'" class="h-5 w-5" />
</button>
<div class="reader-bar-title">
<span class="reader-bar-num">{{ chapterIdx + 1 }}.</span>
{{ chapters[chapterIdx].title }}
</div>
<span class="reader-bar-pages">
<template v-if="isScrollMode">{{ scrollPercent }}%</template>
<template v-else>{{ currentPage + 1 }}<span class="op-40">/</span>{{ totalPages }}</template>
</span>
<span class="reader-bar-pages">{{ scrollPercent }}%</span>
<button class="reader-bar-btn reader-bar-close" @click="close" aria-label="Fermer">
<div class="i-lucide-x h-5 w-5" />
</button>
@@ -172,7 +161,7 @@ const showSommaire = ref(false)
const isTurning = ref(false)
// ── Reading mode ──
const readingMode = ref<'paginated' | 'scroll'>('paginated')
const readingMode = ref<'paginated' | 'scroll'>('scroll')
const isScrollMode = computed(() => readingMode.value === 'scroll')
const scrollPercent = ref(0)
@@ -448,7 +437,7 @@ watch(isOpen, async (open) => {
}
})
// ── Sync: when song changes in player, navigate to matching chapter ──
// ── Sync: when song changes in player, navigate to matching chapter (display only, no loadAndPlay) ──
watch(() => playerStore.currentSong, (song) => {
if (!song || !isOpen.value) return
if (_skipSongWatch) {
@@ -459,8 +448,11 @@ watch(() => playerStore.currentSong, (song) => {
if (!slug) return
const idx = chapters.findIndex(ch => ch.slug === slug)
if (idx !== -1 && idx !== chapterIdx.value) {
// Only update the displayed chapter — do NOT call goToChapter/loadAndPlay
// to avoid retriggering this watcher and causing song skips
chapterIdx.value = idx
currentPage.value = 0
showSommaire.value = false
if (isScrollMode.value && viewportEl.value) {
viewportEl.value.scrollTop = 0
}