Notes en étoiles uniquement : plus d'échelle sur 10
- Réglage « Notation » retiré, ainsi que le curseur sur 10 et l'affichage « /10 » (fiche, cartes, Top 5, stats, filtres, carte de partage) : tout s'affiche sur 5 étoiles - Les notes restent stockées comme avant (sur 10 en interne) : rien ne change pour les notes existantes - Réglage ratingScale retiré des réglages synchronisés et des sauvegardes ; textes inutiles retirés (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:
40 files changed
+61
-214
No files matched your search
@@ -110,7 +110,7 @@ export default function JournalView({ onOpen }: { onOpen: (item: MediaItem) => v
|
||||
{e.item.rating ? (
|
||||
<span className="flex shrink-0 items-center gap-1 text-xs font-semibold">
|
||||
<Star size={12} className="fill-accent text-accent" />
|
||||
{formatRating(e.item.rating, settings.ratingScale)}
|
||||
{formatRating(e.item.rating)}
|
||||
</span>
|
||||
) : null}
|
||||
</button>
|
||||
|
||||
@@ -73,7 +73,7 @@ export const MediaCard = memo(function MediaCard({ item, onOpen }: { item: Media
|
||||
<h3 className="mt-2.5 line-clamp-2 font-sans text-sm font-semibold leading-snug tracking-normal">{item.title}</h3>
|
||||
<div className="mt-1 flex items-center justify-between gap-2">
|
||||
<StatusPill status={item.status} />
|
||||
<RatingBadge value={item.rating} scale={settings.ratingScale} />
|
||||
<RatingBadge value={item.rating} />
|
||||
</div>
|
||||
<Progress item={view} />
|
||||
</button>
|
||||
|
||||
@@ -2,16 +2,15 @@ import { t } from '../i18n'
|
||||
import { Star, X } from 'lucide-react'
|
||||
import type { MouseEvent } from 'react'
|
||||
import { cx, formatRating } from '../lib/utils'
|
||||
import type { RatingScale } from '../types'
|
||||
|
||||
/** Petite note compacte (étoile + valeur) pour les cartes. */
|
||||
export function RatingBadge({ value, scale }: { value?: number; scale: RatingScale }) {
|
||||
export function RatingBadge({ value }: { value?: number }) {
|
||||
if (value == null || value === 0) return null
|
||||
return (
|
||||
<span className="inline-flex items-center gap-1 text-xs font-semibold text-ink">
|
||||
<Star size={12} className="fill-accent text-accent" />
|
||||
{formatRating(value, scale)}
|
||||
<span className="font-normal text-ink-3">/{scale}</span>
|
||||
{formatRating(value)}
|
||||
<span className="font-normal text-ink-3">/5</span>
|
||||
</span>
|
||||
)
|
||||
}
|
||||
@@ -20,44 +19,17 @@ interface InputProps {
|
||||
/** Valeur interne sur 10 */
|
||||
value?: number
|
||||
onChange: (value: number | undefined) => void
|
||||
scale: RatingScale
|
||||
size?: 'lg' | 'sm'
|
||||
label?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Saisie de note.
|
||||
* - Échelle 5 : étoiles avec demi-étoiles (touche la moitié gauche d'une étoile pour ½).
|
||||
* - Échelle 10 : curseur au pas de 0,5.
|
||||
* La valeur est toujours stockée sur 10.
|
||||
* Saisie de note : étoiles avec demi-étoiles (touche la moitié gauche d'une étoile pour ½).
|
||||
* La valeur est stockée sur 10.
|
||||
*/
|
||||
export function RatingInput({ value, onChange, scale, size = 'lg', label }: InputProps) {
|
||||
export function RatingInput({ value, onChange, size = 'lg', label }: InputProps) {
|
||||
const px = size === 'lg' ? 34 : 24
|
||||
|
||||
if (scale === '10') {
|
||||
return (
|
||||
<div className="flex items-center gap-3">
|
||||
<input
|
||||
type="range"
|
||||
min={0}
|
||||
max={10}
|
||||
step={0.5}
|
||||
value={value ?? 0}
|
||||
aria-label={label ?? t('rating.outOf10')}
|
||||
onChange={(e) => {
|
||||
const v = Number(e.target.value)
|
||||
onChange(v === 0 ? undefined : v)
|
||||
}}
|
||||
className="h-2 flex-1 accent-accent-fill"
|
||||
/>
|
||||
<span className={cx('w-14 text-end font-semibold tabular-nums', size === 'lg' ? 'text-xl' : 'text-sm')}>
|
||||
{value ? formatRating(value, '10') : '—'}
|
||||
<span className="text-xs font-normal text-ink-3">/10</span>
|
||||
</span>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
const stars = (value ?? 0) / 2
|
||||
const pick = (e: MouseEvent<HTMLButtonElement>, index: number) => {
|
||||
const rect = e.currentTarget.getBoundingClientRect()
|
||||
@@ -91,7 +63,7 @@ export function RatingInput({ value, onChange, scale, size = 'lg', label }: Inpu
|
||||
)
|
||||
})}
|
||||
<span className={cx('ms-2 tabular-nums text-ink-2', size === 'lg' ? 'text-base' : 'text-xs')}>
|
||||
{value ? formatRating(value, '5') : ''}
|
||||
{value ? formatRating(value) : ''}
|
||||
</span>
|
||||
{value != null && size === 'lg' && (
|
||||
<button type="button" onClick={() => onChange(undefined)} className="ms-auto p-1 text-ink-3" aria-label={t('rating.clear')}>
|
||||
|
||||
@@ -228,7 +228,7 @@ export default function Roulette({ onClose, onOpen }: Props) {
|
||||
: formatDuration(sessionMinutes(result))}
|
||||
</span>
|
||||
{result.platform && <span>· {result.platform}</span>}
|
||||
<RatingBadge value={result.rating} scale={settings.ratingScale} />
|
||||
<RatingBadge value={result.rating} />
|
||||
</div>
|
||||
{result.status === 'pause' && (
|
||||
<p className="mt-2 text-xs text-ink-2">
|
||||
|
||||
@@ -116,7 +116,7 @@ export default function TopFive({ onOpen }: { onOpen: (item: MediaItem) => void
|
||||
</button>
|
||||
<div className="mt-1.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-ink-3">
|
||||
{first.year && <span>{first.year}</span>}
|
||||
<RatingBadge value={first.rating} scale={settings.ratingScale} />
|
||||
<RatingBadge value={first.rating} />
|
||||
</div>
|
||||
{first.genres.length > 0 && <p className="mt-2 line-clamp-1 text-xs text-ink-3">{first.genres.slice(0, 3).map(genreLabel).join(' · ')}</p>}
|
||||
</>
|
||||
@@ -150,7 +150,7 @@ export default function TopFive({ onOpen }: { onOpen: (item: MediaItem) => void
|
||||
<p className="ms-4 mt-1.5 truncate text-[11px] font-medium text-ink-2" title={item?.title}>
|
||||
{item ? item.title : '—'}
|
||||
</p>
|
||||
{item?.rating ? <p className="ms-4 text-[10px] text-ink-3">{formatRating(item.rating, settings.ratingScale)}/{settings.ratingScale}</p> : null}
|
||||
{item?.rating ? <p className="ms-4 text-[10px] text-ink-3">{formatRating(item.rating)}/5</p> : null}
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
|
||||
@@ -120,7 +120,7 @@ export default function TopFiveEditor({ category: initialCategory, onClose }: Pr
|
||||
<div className="min-w-0 flex-1">
|
||||
<p className="truncate text-sm font-semibold">{item.title}</p>
|
||||
<p className="text-xs text-ink-3">
|
||||
{[item.year, item.rating ? `${formatRating(item.rating, settings.ratingScale)}/${settings.ratingScale}` : null].filter(Boolean).join(' · ')}
|
||||
{[item.year, item.rating ? `${formatRating(item.rating)}/5` : null].filter(Boolean).join(' · ')}
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex shrink-0 items-center">
|
||||
@@ -171,7 +171,7 @@ export default function TopFiveEditor({ category: initialCategory, onClose }: Pr
|
||||
<p className="truncate text-sm font-medium">{item.title}</p>
|
||||
<div className="mt-1 flex items-center gap-2 text-xs text-ink-3">
|
||||
<TypeBadge item={item} />
|
||||
{item.rating ? `${formatRating(item.rating, settings.ratingScale)}/${settings.ratingScale}` : ''}
|
||||
{item.rating ? `${formatRating(item.rating)}/5` : ''}
|
||||
{item.top && item.top.category !== category && (
|
||||
<span className="text-accent">
|
||||
{t('top.number', { rank: item.top.rank })} {TOP_CATEGORIES.find((c) => c.value === item.top!.category)?.plural}
|
||||
|
||||
@@ -138,7 +138,7 @@ export default function FriendsFeed() {
|
||||
{e.item.rating != null && e.kind !== 'added' && (
|
||||
<span className="flex items-center gap-0.5 font-semibold text-ink-2">
|
||||
<Star size={10} className="fill-accent text-accent" />
|
||||
{formatRating(e.item.rating, settings.ratingScale)}
|
||||
{formatRating(e.item.rating)}
|
||||
</span>
|
||||
)}
|
||||
{e.item.notes && <span>{t('feed.review')}</span>}
|
||||
|
||||
@@ -125,7 +125,7 @@ export default function ItemPeek({ item, owner, onClose }: { item: MediaItem; ow
|
||||
{item.rating != null && (
|
||||
<span className="flex items-center gap-1 text-sm font-semibold">
|
||||
<Star size={14} className="fill-accent text-accent" />
|
||||
{formatRating(item.rating, settings.ratingScale)}
|
||||
{formatRating(item.rating)}
|
||||
</span>
|
||||
)}
|
||||
{canReact && review && <ReportButton target={{ type: 'review', id: review.item_id, userId: review.user_id }} className="-me-1.5 size-8" size={16} />}
|
||||
|
||||
@@ -25,7 +25,7 @@ function PosterTile({ item, onOpen, caption }: { item: MediaItem; onOpen: () =>
|
||||
{item.rating != null && (
|
||||
<>
|
||||
<Star size={10} className="fill-accent text-accent" />
|
||||
{formatRating(item.rating, settings.ratingScale)}
|
||||
{formatRating(item.rating)}
|
||||
</>
|
||||
)}
|
||||
{caption && <span className="truncate">{caption}</span>}
|
||||
|
||||
@@ -85,7 +85,7 @@ function ReviewCard({ r, onOpenProfile }: { r: TitleReview; onOpenProfile: (user
|
||||
{r.rating != null && (
|
||||
<span className="flex shrink-0 items-center gap-0.5 text-sm font-semibold text-ink-2">
|
||||
<Star size={12} className="fill-accent text-accent" />
|
||||
{formatRating(r.rating, settings.ratingScale)}
|
||||
{formatRating(r.rating)}
|
||||
</span>
|
||||
)}
|
||||
{!mine && <ReportButton target={{ type: 'review', id: r.item_id, userId: r.user_id }} className="-me-1.5" size={16} />}
|
||||
|
||||
@@ -4,7 +4,7 @@ import { t } from '../../i18n'
|
||||
import { episodesBeforeSeason } from '../../lib/franchise'
|
||||
import { seasonsAverage } from '../../lib/seasons'
|
||||
import { cx, formatRating } from '../../lib/utils'
|
||||
import type { MediaItem, RatingScale, SeasonRating } from '../../types'
|
||||
import type { MediaItem, SeasonRating } from '../../types'
|
||||
import { RatingInput } from '../Rating'
|
||||
|
||||
/**
|
||||
@@ -14,19 +14,17 @@ import { RatingInput } from '../Rating'
|
||||
*/
|
||||
export default function SeasonRatings({
|
||||
item,
|
||||
scale,
|
||||
highlight,
|
||||
onChange,
|
||||
}: {
|
||||
item: MediaItem
|
||||
scale: RatingScale
|
||||
/** Saison à mettre en avant (on vient de la finir) */
|
||||
highlight?: number
|
||||
onChange: (seasonRatings: MediaItem['seasonRatings']) => void
|
||||
}) {
|
||||
const seasons = item.seasons ?? []
|
||||
const ratings: Record<string, SeasonRating> = item.seasonRatings ?? {}
|
||||
const avg = seasonsAverage(ratings, scale)
|
||||
const avg = seasonsAverage(ratings)
|
||||
|
||||
const set = (n: number, patch: Partial<SeasonRating>) => {
|
||||
const key = String(n)
|
||||
@@ -42,7 +40,7 @@ export default function SeasonRatings({
|
||||
<h3 className="eyebrow text-ink-2">{t('seasons.title')}</h3>
|
||||
{avg != null && (
|
||||
<span className="text-xs text-ink-3">
|
||||
{t('seasons.average')} <span className="font-semibold text-ink">{formatRating(avg, scale)}</span>
|
||||
{t('seasons.average')} <span className="font-semibold text-ink">{formatRating(avg)}</span>
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
@@ -59,7 +57,7 @@ export default function SeasonRatings({
|
||||
size={size}
|
||||
seen={seen}
|
||||
value={ratings[String(n)]}
|
||||
scale={scale}
|
||||
|
||||
highlight={highlight === n}
|
||||
onChange={(patch) => set(n, patch)}
|
||||
/>
|
||||
@@ -75,7 +73,6 @@ function SeasonRow({
|
||||
size,
|
||||
seen,
|
||||
value,
|
||||
scale,
|
||||
highlight,
|
||||
onChange,
|
||||
}: {
|
||||
@@ -83,7 +80,6 @@ function SeasonRow({
|
||||
size: number
|
||||
seen: number
|
||||
value?: SeasonRating
|
||||
scale: RatingScale
|
||||
highlight: boolean
|
||||
onChange: (patch: Partial<SeasonRating>) => void
|
||||
}) {
|
||||
@@ -128,7 +124,7 @@ function SeasonRow({
|
||||
|
||||
{started && (
|
||||
<div className="mt-2.5">
|
||||
<RatingInput value={value?.rating} onChange={(rating) => onChange({ rating })} scale={scale} size="sm" label={t('seasons.season', { n })} />
|
||||
<RatingInput value={value?.rating} onChange={(rating) => onChange({ rating })} size="sm" label={t('seasons.season', { n })} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import { GuestError, useMedia } from '../../store'
|
||||
import { allTags, cleanTag } from '../../lib/bulk'
|
||||
import { useLibraryActions } from '../library/useLibraryActions'
|
||||
import TagInput from '../TagInput'
|
||||
import type { MediaInput, MediaItem, RatingScale, WatchStatus } from '../../types'
|
||||
import type { MediaInput, MediaItem, WatchStatus } from '../../types'
|
||||
import ConfirmDialog from '../ConfirmDialog'
|
||||
import EpisodeList from '../EpisodeList'
|
||||
import { useSocial } from '../social/SocialProvider'
|
||||
@@ -293,7 +293,7 @@ export default function TitleSheet({ item: initial, seed, onClose, onGoToSetting
|
||||
if (settings.tmdbKey && item.externalId?.startsWith('tmdb:') && navigator.onLine) {
|
||||
credits = await getTmdbCredits(item.externalId, settings.tmdbKey).catch(() => undefined)
|
||||
}
|
||||
const blob = await renderItemCard(item, settings.ratingScale, credits)
|
||||
const blob = await renderItemCard(item, credits)
|
||||
setPreview({ blob, filename: `kino-${slug(item.title)}.png` })
|
||||
} catch {
|
||||
setToast(t('share.err.create'))
|
||||
@@ -424,7 +424,7 @@ export default function TitleSheet({ item: initial, seed, onClose, onGoToSetting
|
||||
<div className="flex flex-col lg:mt-8 lg:px-6 lg:grid lg:grid-cols-[minmax(0,1fr)_28rem] xl:grid-cols-[minmax(0,1fr)_32rem] lg:items-start lg:gap-6">
|
||||
<div className="order-1 lg:col-start-2 lg:row-start-1">
|
||||
{/* Note moyenne du public */}
|
||||
{source && <PublicRating average={average} votes={extras?.votes} distribution={extras?.distribution} scale={settings.ratingScale} source={source} mine={item?.rating} />}
|
||||
{source && <PublicRating average={average} votes={extras?.votes} distribution={extras?.distribution} source={source} mine={item?.rating} />}
|
||||
|
||||
{/* Mes actions */}
|
||||
<section className="card mx-4 mt-4 p-4">
|
||||
@@ -466,13 +466,13 @@ export default function TitleSheet({ item: initial, seed, onClose, onGoToSetting
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
<RatingInput value={item?.rating} onChange={rate} scale={settings.ratingScale} />
|
||||
<RatingInput value={item?.rating} onChange={rate} />
|
||||
{item && hasSeasons(item) && (
|
||||
<p className="mt-1.5 text-xs text-ink-3">
|
||||
{seasonsAverage(item.seasonRatings, settings.ratingScale) != null && item.status === 'termine' ? t('seasons.finalApplied') : t('seasons.finalHint')}
|
||||
{seasonsAverage(item.seasonRatings) != null && item.status === 'termine' ? t('seasons.finalApplied') : t('seasons.finalHint')}
|
||||
</p>
|
||||
)}
|
||||
{item?.rating != null && <Criteria item={item} scale={settings.ratingScale} onChange={(criteria) => void update(item.id, { criteria })} />}
|
||||
{item?.rating != null && <Criteria item={item} onChange={(criteria) => void update(item.id, { criteria })} />}
|
||||
</div>
|
||||
{busy && (
|
||||
<p className="mt-3 flex items-center gap-2 text-xs text-ink-3">
|
||||
@@ -544,7 +544,7 @@ export default function TitleSheet({ item: initial, seed, onClose, onGoToSetting
|
||||
{item && hasSeasons(item) && (
|
||||
<SeasonRatings
|
||||
item={item}
|
||||
scale={settings.ratingScale}
|
||||
|
||||
highlight={focus && 'season' in focus ? focus.season : undefined}
|
||||
onChange={(seasonRatings) => void update(item.id, { seasonRatings })}
|
||||
/>
|
||||
@@ -737,14 +737,12 @@ function PublicRating({
|
||||
average,
|
||||
votes,
|
||||
distribution,
|
||||
scale,
|
||||
source,
|
||||
mine,
|
||||
}: {
|
||||
average?: number
|
||||
votes?: number
|
||||
distribution?: { score: number; amount: number }[]
|
||||
scale: RatingScale
|
||||
source: string
|
||||
mine?: number
|
||||
}) {
|
||||
@@ -757,8 +755,8 @@ function PublicRating({
|
||||
{average != null ? (
|
||||
<>
|
||||
<p className="mt-1 text-4xl font-bold leading-none tabular-nums">
|
||||
{formatRating(average, scale)}
|
||||
<span className="text-base font-normal text-ink-3">/{scale}</span>
|
||||
{formatRating(average)}
|
||||
<span className="text-base font-normal text-ink-3">/5</span>
|
||||
</p>
|
||||
<p className="mt-1.5 text-xs text-ink-3">
|
||||
{votes ? `${t('title.votes', { count: votes, n: compact.format(votes) })} · ` : ''}
|
||||
@@ -770,7 +768,7 @@ function PublicRating({
|
||||
)}
|
||||
{mine != null && average != null && (
|
||||
<p className="mt-1 text-xs text-ink-2">
|
||||
{t('title.yourRating')} <span className="font-semibold text-ink">{formatRating(mine, scale)}</span>
|
||||
{t('title.yourRating')} <span className="font-semibold text-ink">{formatRating(mine)}</span>
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
@@ -786,7 +784,7 @@ function PublicRating({
|
||||
)
|
||||
}
|
||||
|
||||
function Criteria({ item, scale, onChange }: { item: MediaItem; scale: RatingScale; onChange: (c: MediaItem['criteria']) => void }) {
|
||||
function Criteria({ item, onChange }: { item: MediaItem; onChange: (c: MediaItem['criteria']) => void }) {
|
||||
const [open, setOpen] = useState(() => Object.keys(item.criteria).length > 0)
|
||||
return (
|
||||
<div className="mt-3">
|
||||
@@ -801,7 +799,7 @@ function Criteria({ item, scale, onChange }: { item: MediaItem; scale: RatingSca
|
||||
<RatingInput
|
||||
size="sm"
|
||||
label={c.label}
|
||||
scale={scale}
|
||||
|
||||
value={item.criteria[c.key]}
|
||||
onChange={(v) => {
|
||||
const next = { ...item.criteria }
|
||||
|
||||
Reference in new issue
Block a user