App plus fluide : accueil stable, moins de réseau, synchro et base allégées
deploy / deploy (push) Successful in 47s
deploy / deploy (push) Successful in 47s
Accueil - Place de la bannière réservée pendant la lecture de la bibliothèque : plus de saut au démarrage (décalage 0,44 → 0). - Bannière : seules l'image affichée, la suivante et la précédente sont chargées (≈ 800 Ko de moins sur téléphone), image décodée avant d'être montrée, pas de défilement automatique hors écran, sous le doigt ou en animations réduites. - « Dernières sorties » : mise à jour seulement quand la rangée approche de l'écran ; fiche et saisons d'une série partagées entre les deux mois ; cache lu une fois par lancement (plus à chaque retour sur l'accueil). - « À voir » tiré au hasard une fois par jour (plus de nouvelles affiches à chaque ouverture). - Fil des abonnements : plus de double chargement, pas de nouvelle demande en revenant sur l'accueil (2 min). Fluidité - Store découpé : les actions (useMediaActions) et l'état de la synchro (useSyncStatus) ne redessinent plus toute l'app ; fiches inchangées conservées après une synchro. - Changement d'onglet en transition (onglet surligné tout de suite), catalogue par tranches de 24, cartes mémorisées avec fonctions stables, accueil et catalogue mémorisés. - Formateurs de dates et nombres gardés en mémoire ; longues listes d'épisodes : lignes hors écran non dessinées. - Sans flou sur les barres fixes ; page figée derrière une fiche juste après son apparition ; pas d'écouteur de molette sur téléphone ; double tap sans délai ; barre du bas masquée pendant la saisie. Réseau - Proxy TMDB et notes Trakt appelés sans en-tête : plus de pré-requête CORS (0 au lieu d'une par appel). - Images TMDB / AniList en mode CORS, cache posters-v2 / backdrops-v2 (les copies opaques comptaient ~7 Mo de quota chacune). - Synchro : curseur « réglé » (les dernières fiches ne sont plus retéléchargées chaque minute), rythme 1 min après une activité, 3 min au repos, plus de double synchro au retour sur l'app. - Pré-téléchargement allégé (pages légales, police en double, grandes icônes). Base (migration 20261129180000_write_path_perf, appliquée) - Notifications aux abonnés en une requête ; quota vérifié une fois par envoi ; fiche identique non réécrite ; index inutilisé supprimé. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVo1qxKoBQCaMd7Ue8PGbe
This commit is contained in:
46 files changed
+680
-191
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import { Check, Loader2, PenLine, Search, X } from 'lucide-react'
|
||||
import { imgCors } from '../../lib/tmdbImage'
|
||||
import { useEffect, useRef, useState, type ReactNode } from 'react'
|
||||
import { t } from '../../i18n'
|
||||
import { useBackToClose } from '../../lib/backNav'
|
||||
@@ -100,7 +101,7 @@ export default function AddTitle({
|
||||
<li key={r.externalId}>
|
||||
<button data-prefetch={r.externalId} onClick={() => (mine ? onOpenItem(mine) : onPick(r))} className="flex w-full items-center gap-3 py-3 text-start active:bg-surface lg:border-b lg:border-line">
|
||||
{r.thumb ? (
|
||||
<img src={r.thumb} alt="" loading="lazy" className="h-[5.25rem] w-14 shrink-0 rounded-lg border border-line bg-surface-2 object-cover" />
|
||||
<img src={r.thumb} crossOrigin={imgCors(r.thumb)} alt="" loading="lazy" className="h-[5.25rem] w-14 shrink-0 rounded-lg border border-line bg-surface-2 object-cover" />
|
||||
) : (
|
||||
<span className="grid h-[5.25rem] w-14 shrink-0 place-items-center rounded-lg border border-line bg-surface-2 font-semibold text-ink-3">{r.title.charAt(0)}</span>
|
||||
)}
|
||||
@@ -128,7 +129,7 @@ export default function AddTitle({
|
||||
<li key={p.id}>
|
||||
<button onClick={() => onOpenPerson(p)} className="flex w-full items-center gap-3 py-2.5 text-start active:bg-surface lg:border-b lg:border-line">
|
||||
{p.photo ? (
|
||||
<img src={p.photo} alt="" loading="lazy" className="size-14 shrink-0 rounded-full border border-line bg-surface-2 object-cover" />
|
||||
<img src={p.photo} crossOrigin={imgCors(p.photo)} alt="" loading="lazy" className="size-14 shrink-0 rounded-full border border-line bg-surface-2 object-cover" />
|
||||
) : (
|
||||
<span className="grid size-14 shrink-0 place-items-center rounded-full border border-line bg-surface-2 text-lg font-semibold text-ink-3">{p.name.charAt(0)}</span>
|
||||
)}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Check, Pencil } from 'lucide-react'
|
||||
import { smoothScroll } from '../../lib/motion'
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
import { t } from '../../i18n'
|
||||
import { episodesBeforeSeason } from '../../lib/franchise'
|
||||
@@ -92,7 +93,7 @@ function SeasonRow({
|
||||
|
||||
// Saison qu'on vient de finir : on l'amène à l'écran
|
||||
useEffect(() => {
|
||||
if (highlight) ref.current?.scrollIntoView({ behavior: 'smooth', block: 'center' })
|
||||
if (highlight) ref.current?.scrollIntoView({ behavior: smoothScroll(), block: 'center' })
|
||||
}, [highlight])
|
||||
|
||||
// À l'ouverture de l'éditeur : on repart de l'avis enregistré (il a pu changer depuis, ex. synchro)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { locale, t } from '../../i18n'
|
||||
import { numberFormat, t } from '../../i18n'
|
||||
import { smoothScroll } from '../../lib/motion'
|
||||
import { FilmStrip } from '../ui'
|
||||
import { Bookmark, Check, ChevronDown, Eye, Heart, Loader2, MessagesSquare, Minus, MoreHorizontal, Pencil, Play, Plus, Share2, Trash2, X } from 'lucide-react'
|
||||
import { useEffect, useMemo, useRef, useState, type ReactNode } from 'react'
|
||||
@@ -11,7 +12,7 @@ import { useEscape } from '../../lib/escape'
|
||||
import { episodeCap, seasonPosition } from '../../lib/franchise'
|
||||
import { episodesPatch } from '../../lib/progress'
|
||||
import { useScrollLock } from '../../lib/scrollLock'
|
||||
import { backdropSrcSet, tmdbSized } from '../../lib/tmdbImage'
|
||||
import { backdropSrcSet, tmdbSized, imgCors } from '../../lib/tmdbImage'
|
||||
import { cx, formatDate, formatDuration, formatRating, todayISO } from '../../lib/utils'
|
||||
import { GuestError, useMedia } from '../../store'
|
||||
import { allTags, cleanTag } from '../../lib/bulk'
|
||||
@@ -262,7 +263,7 @@ export default function TitleSheet({ item: initial, seed, onClose, onOpenPerson,
|
||||
const [focus, setFocus] = useState<Completion | undefined>(initialFocus)
|
||||
const ratingRef = useRef<HTMLDivElement>(null)
|
||||
useEffect(() => {
|
||||
if (focus && 'final' in focus) ratingRef.current?.scrollIntoView({ behavior: 'smooth', block: 'center' })
|
||||
if (focus && 'final' in focus) ratingRef.current?.scrollIntoView({ behavior: smoothScroll(), block: 'center' })
|
||||
}, [focus])
|
||||
|
||||
// Revisionnage qui vient de se terminer (dernier épisode coché ici)
|
||||
@@ -384,6 +385,7 @@ export default function TitleSheet({ item: initial, seed, onClose, onOpenPerson,
|
||||
{heroImage ? (
|
||||
<img
|
||||
src={tmdbSized(heroImage, 'w1280')}
|
||||
crossOrigin={imgCors(tmdbSized(heroImage, 'w1280'))}
|
||||
srcSet={backdropSrcSet(heroImage)}
|
||||
sizes="100vw"
|
||||
alt=""
|
||||
@@ -657,7 +659,7 @@ export default function TitleSheet({ item: initial, seed, onClose, onOpenPerson,
|
||||
className="group w-[5.5rem] shrink-0 text-center"
|
||||
>
|
||||
{c.photo ? (
|
||||
<img src={c.photo} alt="" loading="lazy" className="mx-auto size-20 rounded-full border border-line bg-surface-2 object-cover transition-colors group-hover:border-accent" />
|
||||
<img src={c.photo} crossOrigin={imgCors(c.photo)} alt="" loading="lazy" className="mx-auto size-20 rounded-full border border-line bg-surface-2 object-cover transition-colors group-hover:border-accent" />
|
||||
) : (
|
||||
<span className="mx-auto grid size-20 place-items-center rounded-full border border-line bg-surface-2 text-lg font-semibold text-ink-3 transition-colors group-hover:border-accent">{c.name.charAt(0)}</span>
|
||||
)}
|
||||
@@ -798,7 +800,7 @@ function PublicRating({
|
||||
pending?: boolean
|
||||
}) {
|
||||
const max = Math.max(1, ...(distribution ?? []).map((d) => d.amount))
|
||||
const compact = new Intl.NumberFormat(locale(), { notation: 'compact', maximumFractionDigits: 1 })
|
||||
const compact = numberFormat({ notation: 'compact', maximumFractionDigits: 1 })
|
||||
return (
|
||||
<section className="mx-4 mt-6 flex items-end justify-between gap-4 border-b border-line pb-4">
|
||||
<div className="shrink-0">
|
||||
|
||||
@@ -2,7 +2,7 @@ import { ChevronDown, ExternalLink, Globe } from 'lucide-react'
|
||||
import { useMemo, type ReactNode } from 'react'
|
||||
import { t } from '../../i18n'
|
||||
import type { TitleExtras } from '../../lib/catalogApi'
|
||||
import { tmdbSized } from '../../lib/tmdbImage'
|
||||
import { tmdbSized, imgCors } from '../../lib/tmdbImage'
|
||||
import { countryName, defaultWatchRegion, OFFER_KINDS, setWatchRegion, useWatchRegion, type StreamLink, type WatchProvider } from '../../lib/watchProviders'
|
||||
|
||||
const JUSTWATCH = 'https://www.justwatch.com'
|
||||
@@ -96,6 +96,7 @@ function ProviderLogo({ provider, href }: { provider: WatchProvider; href?: stri
|
||||
const logo = provider.logo ? (
|
||||
<img
|
||||
src={provider.logo}
|
||||
crossOrigin={imgCors(provider.logo)}
|
||||
srcSet={`${provider.logo} 1x, ${tmdbSized(provider.logo, 'w154')} 2x`}
|
||||
alt={provider.name}
|
||||
title={provider.name}
|
||||
@@ -132,7 +133,7 @@ function StreamLinks({ links }: { links: StreamLink[] }) {
|
||||
>
|
||||
{l.icon ? (
|
||||
<span className="grid size-7 shrink-0 place-items-center rounded-full bg-surface-2" style={l.color ? { backgroundColor: l.color } : undefined}>
|
||||
<img src={l.icon} alt="" loading="lazy" className="size-4 object-contain" />
|
||||
<img src={l.icon} crossOrigin={imgCors(l.icon)} alt="" loading="lazy" className="size-4 object-contain" />
|
||||
</span>
|
||||
) : (
|
||||
<span className="grid size-7 shrink-0 place-items-center rounded-full bg-surface-2 text-xs font-semibold text-ink-2" aria-hidden>
|
||||
|
||||
Reference in new issue
Block a user