Social : avis avec spoilers, commentaires sous les avis, listes partagées
- Spoilers : case « Contient des spoilers » dans l'éditeur d'avis (notesSpoiler, synchronisé avec la fiche) ; texte retiré de la page (pas seulement flouté) jusqu'à « Afficher le spoiler » dans les avis d'un titre et l'aperçu d'une fiche ; badge sur mon avis. - Commentaires sous les avis (≤ 500 car.) : fil avec auteur, date relative, suppression (auteur / auteur de l'avis / admin), compteur à côté des réactions, notification « review_comment » (préférence notifPrefs.comments), anti-spam 10/min côté SQL. - Listes partagées : section dans l'onglet Listes, invitations (notification + acceptation), membres, qui a ajouté quoi, quitter / retirer un membre / supprimer, ajout depuis la fiche et depuis la bibliothèque, ouverture d'un titre (ma fiche ou fiche du catalogue). - SQL : 20261009130000_review_spoilers_comments.sql et 20261009130100_shared_lists.sql (RLS, aucun accès direct aux tables, fonctions security definer + search_path vide). - Tout se masque sans compte ou si les migrations ne sont pas encore appliquées. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVo1qxKoBQCaMd7Ue8PGbe
This commit is contained in:
41 files changed
+3487
-27
No files matched your search
@@ -25,6 +25,8 @@ import { RatingInput } from '../Rating'
|
||||
import SharePreview from '../SharePreview'
|
||||
import EditDetails from './EditDetails'
|
||||
import ReviewEditor from './ReviewEditor'
|
||||
import ReviewComments from '../social/ReviewComments'
|
||||
import SharedListPicker from '../social/SharedListPicker'
|
||||
|
||||
/** Suivi « vide » d'un titre qu'on ajoute. */
|
||||
const BLANK: Pick<MediaInput, 'criteria' | 'episodesWatched' | 'genres'> = { criteria: {}, episodesWatched: 0, genres: [] }
|
||||
@@ -435,12 +437,23 @@ export default function TitleSheet({ item: initial, seed, onClose, onGoToSetting
|
||||
{/* Mon avis */}
|
||||
<section className="mx-4 mt-4">
|
||||
{item?.notes ? (
|
||||
<button onClick={() => setReviewing(true)} className="card block w-full p-4 text-left">
|
||||
<span className="eyebrow flex items-center justify-between">
|
||||
{t('form.review')} <Pencil size={13} />
|
||||
</span>
|
||||
<p className="mt-2 line-clamp-6 whitespace-pre-line text-sm leading-relaxed text-ink">{item.notes}</p>
|
||||
</button>
|
||||
<div className="card p-4">
|
||||
<button onClick={() => setReviewing(true)} className="block w-full text-start">
|
||||
<span className="eyebrow flex items-center justify-between">
|
||||
<span className="flex items-center gap-2">
|
||||
{t('form.review')}
|
||||
{item.notesSpoiler && <span className="rounded-full border border-accent/50 px-1.5 py-px text-[10px] text-accent">{t('spoiler.badge')}</span>}
|
||||
</span>
|
||||
<Pencil size={13} />
|
||||
</span>
|
||||
<p className="mt-2 line-clamp-6 whitespace-pre-line text-sm leading-relaxed text-ink">{item.notes}</p>
|
||||
</button>
|
||||
{social.enabled && social.me && (
|
||||
<div className="mt-3 border-t border-line pt-3">
|
||||
<ReviewComments key={item.id} authorId={social.me.id} itemId={item.id} />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<button onClick={() => setReviewing(true)} disabled={busy} className="flex w-full items-center gap-2 rounded-2xl border border-dashed border-line-strong px-4 py-3.5 text-left text-sm text-ink-2">
|
||||
<Pencil size={16} className="text-accent" /> {t('title.writeReview')}
|
||||
@@ -493,6 +506,11 @@ export default function TitleSheet({ item: initial, seed, onClose, onGoToSetting
|
||||
|
||||
{/* Mon suivi : dates, plateforme, listes, revisionnages */}
|
||||
{item && <Tracking item={item} lists={lists} onChange={(patch) => void update(item.id, patch)} />}
|
||||
|
||||
{/* Listes partagées avec d'autres membres (titre de ma bibliothèque ou pas encore ajouté) */}
|
||||
{externalId && social.enabled && (
|
||||
<SharedListPicker snapshot={{ externalId, title, type, year: data.year, poster: item?.poster ?? poster }} posterFallback={seed?.posterUrl} />
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -522,11 +540,12 @@ export default function TitleSheet({ item: initial, seed, onClose, onGoToSetting
|
||||
<ReviewEditor
|
||||
title={title}
|
||||
initial={item?.notes ?? ''}
|
||||
initialSpoiler={!!item?.notesSpoiler}
|
||||
onClose={() => setReviewing(false)}
|
||||
onSave={async (notes) => {
|
||||
onSave={async (notes, spoiler) => {
|
||||
setReviewing(false)
|
||||
// Écrire un avis sur un titre pas encore ajouté le marque comme vu
|
||||
await save({ notes: notes || undefined, ...(item ? {} : { status: 'termine' as const, endDate: todayISO() }) })
|
||||
await save({ notes: notes || undefined, notesSpoiler: (notes && spoiler) || undefined, ...(item ? {} : { status: 'termine' as const, endDate: todayISO() }) })
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user