Fix: navigation sous-pages blog/white-papers + singleSlug
All checks were successful
Deploy / Deploy to Production (push) Successful in 25s

- App.svelte : flèches clavier bloquées sur sous-page (ArrowLeft → history.back())
- Blog/WhitePapers : reset de articleData/itemData après 1100ms (post-transition)
  pour éviter le flash pendant l'animation de changement de slide
- WhitePapers : singleSlug jamais resetté (pré-affiché à l'arrivée sur la slide)
- WhitePapers : $effect sur isActive pour replaceState + openItem si itemData null
- WhitePapers/Blog : handlePopState ignore les popstate hors de la page courante

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
isUnknown 2026-03-19 07:36:43 +01:00
parent 9f8854efa5
commit fcca068868
3 changed files with 38 additions and 4 deletions

View file

@ -58,10 +58,22 @@
window.addEventListener('resize', handleResize)
const handleKeydown = (e) => {
if (e.key !== 'ArrowRight' && e.key !== 'ArrowLeft') return
// Si on est sur une sous-page (ex: /livres-blancs/slug), ne pas changer de slide
const activePath = slides.active?.path ?? ''
const currentPath = window.location.pathname.replace(/^\/en/, '') || '/'
const isSubPage = activePath && currentPath.startsWith(activePath + '/')
if (isSubPage) {
if (e.key === 'ArrowLeft') history.back()
return
}
if (e.key === 'ArrowRight') {
const next = slides.all[slides.activeIndex + 1]
if (next) slideTo(next.path)
} else if (e.key === 'ArrowLeft') {
} else {
const prev = slides.all[slides.activeIndex - 1]
if (prev) slideTo(prev.path)
}