Stats : ajouts en lot détectés, « date inconnue » et écran « Dates à corriger »
deploy / deploy (push) Successful in 35s

- Les titres « terminés » le jour d'un ajout en lot (≥ 15 titres créés ou
  terminés le même jour) ne faussent plus la courbe mois par mois ni les années ;
  ils restent comptés dans les totaux. Note sous la courbe + lien.
- Fiche : « Je ne sais plus » pour la date de fin ; dates approximatives
  (année ou mois) affichées comme telles.
- Écran « Dates à corriger » : sélection multiple (filtre par type), année et
  mois facultatif, ou « Je ne sais plus » ; onglet des dates approximatives.
- Nouveau champ endApprox (synchro, sauvegarde), 18 langues.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YVo1qxKoBQCaMd7Ue8PGbe
This commit is contained in:
Claude committed 2026-10-10 17:24:32 +00:00
1 parent e579cac315
commit 2f37438d16
25 files changed
+772 -22

No files matched your search

+33 -9
View File
@@ -1,3 +1,4 @@
import { approxPatch, endLabel } from '../../lib/dating'
import { locale, t } from '../../i18n'
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'
@@ -183,11 +184,13 @@ export default function TitleSheet({ item: initial, seed, onClose, onGoToSetting
if (s === status) return
const patch: Partial<MediaInput> = { status: s }
const today = todayISO()
if (s === 'a_voir') Object.assign(patch, { startDate: undefined, endDate: undefined })
if (s === 'a_voir') Object.assign(patch, { startDate: undefined, endDate: undefined, endApprox: undefined })
// Série : la date de début est celle du premier épisode coché
if (s === 'en_cours') Object.assign(patch, { startDate: episodic && !item?.episodesWatched ? item?.startDate : (item?.startDate ?? today), endDate: undefined })
if (s === 'en_cours') Object.assign(patch, { startDate: episodic && !item?.episodesWatched ? item?.startDate : (item?.startDate ?? today), endDate: undefined, endApprox: undefined })
if (s === 'termine') {
patch.endDate = item?.status === 'termine' && item.endDate ? item.endDate : today
const keep = item?.status === 'termine' && item.endDate
patch.endDate = keep ? item.endDate : today
if (!keep) patch.endApprox = undefined
if (!item?.startDate) patch.startDate = episodic && item?.episodesWatched ? today : patch.endDate
const cap = episodeCap(item ?? { episodesTotal: data.episodesTotal, seasons: data.seasons })
if (episodic && cap) patch.episodesWatched = cap
@@ -214,7 +217,8 @@ export default function TitleSheet({ item: initial, seed, onClose, onGoToSetting
}
// Date de fin seulement pour un titre terminé (noter une série en cours ne la termine pas)
const finished = (patch.status ?? item?.status) === 'termine'
if (finished && !item?.endDate) patch.endDate = today
// (« date inconnue » choisie exprès : on ne la remplace pas)
if (finished && !item?.endDate && !item?.endApprox) patch.endDate = today
if (finished && !item?.startDate) patch.startDate = today
}
void save(patch)
@@ -769,7 +773,7 @@ function Tracking({ item, lists, tagSuggestions, onChange }: { item: MediaItem;
const rewatches = [...(item.rewatchDates ?? [])].sort().reverse()
const summary = [
item.startDate && `${t('form.startShort')} ${formatDate(item.startDate)}`,
item.endDate && `${t('form.endShort')} ${formatDate(item.endDate)}`,
endLabel(item) && `${t('form.endShort')} ${endLabel(item)}`,
rewatches.length ? t('title.rewatchCount', { count: rewatches.length }) : undefined,
].filter(Boolean)
@@ -789,10 +793,30 @@ function Tracking({ item, lists, tagSuggestions, onChange }: { item: MediaItem;
<span className="label">{t('form.startShort')}</span>
<input className="field" type="date" value={item.startDate ?? ''} max={todayISO()} onChange={(e) => onChange({ startDate: e.target.value || undefined })} />
</label>
<label className="block">
<span className="label">{t('form.endShort')}</span>
<input className="field" type="date" value={item.endDate ?? ''} max={todayISO()} onChange={(e) => onChange({ endDate: e.target.value || undefined })} />
</label>
<div>
<label className="block">
<span className="label">
{t('form.endShort')}
{(item.endApprox === 'year' || item.endApprox === 'month') && <span className="ms-1.5 font-normal normal-case text-ink-3">· {t('dates.approxLabel')}</span>}
</span>
{item.endApprox === 'unknown' ? (
<span className="field block text-ink-3">{t('dates.unknown')}</span>
) : (
<input className="field" type="date" value={item.endDate ?? ''} max={todayISO()} onChange={(e) => onChange({ endDate: e.target.value || undefined, endApprox: undefined })} />
)}
</label>
{item.status === 'termine' && (
<button
type="button"
onClick={() => onChange(item.endApprox === 'unknown' ? { endApprox: undefined } : approxPatch(item, 'unknown'))}
aria-pressed={item.endApprox === 'unknown'}
className={cx('chip mt-2 text-xs', item.endApprox === 'unknown' && 'chip-on')}
>
{item.endApprox === 'unknown' && <Check size={13} />}
{t('dates.dunno')}
</button>
)}
</div>
</div>
<div>
<span className="label">{t('lists.myLists')}</span>