Réglages : choisir ses notifications ; journal de la console lisible
deploy / deploy (push) Successful in 1m12s

- Réglages → Notifications (comptes connectés) : un interrupteur par type, en 3 groupes (abonnements,
  mes avis, activité des comptes suivis), 18 langues. Choix synchronisé (settings.notifOff).
- Serveur (20261201110000, appliquée) : une notification d'un type désactivé n'est pas créée (trigger
  notifications_wanted) ; celles déjà reçues sont masquées de la liste et du compteur.
- Console : les détails des connexions étaient enregistrés comme texte JSON et affichés lettre par
  lettre. Enregistrement corrigé (sql.json), anciennes lignes remises en forme à la lecture
  (20261201100000), appareil affiché en clair (« Chrome · Windows »).

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-12-01 10:10:33 +00:00
1 parent 7903064147
commit 43e2ecd589
28 files changed
+432 -10

No files matched your search

+73
View File
@@ -0,0 +1,73 @@
import { t, type TKey } from '../i18n'
import { cx } from '../lib/utils'
import { useMedia } from '../store'
import { NOTIF_KINDS, type NotifKind } from '../types'
import { SectionTitle } from './ui'
const GROUPS: { title: TKey; kinds: [NotifKind, TKey][] }[] = [
{
title: 'notifPrefs.follows',
kinds: [
['new_follower', 'notifPrefs.new_follower'],
['follow_request', 'notifPrefs.follow_request'],
['follow_accepted', 'notifPrefs.follow_accepted'],
['unfollow', 'notifPrefs.unfollow'],
],
},
{
title: 'notifPrefs.reviews',
kinds: [
['reaction', 'notifPrefs.reaction'],
['review_comment', 'notifPrefs.review_comment'],
],
},
{
title: 'notifPrefs.friends',
kinds: [
['friend_review', 'notifPrefs.friend_review'],
['friend_started', 'notifPrefs.friend_started'],
['friend_added', 'notifPrefs.friend_added'],
],
},
]
/**
* Réglages → Notifications : ce qu'on veut recevoir dans la cloche.
* Les types désactivés sont dans les réglages synchronisés (notifOff) : le serveur ne les crée plus
* et masque ceux déjà reçus (migration 20261201110000_notification_prefs).
*/
export default function NotificationSettings() {
const { settings, updateSettings } = useMedia()
const off = new Set(settings.notifOff ?? [])
const toggle = (kind: NotifKind) => {
const next = new Set(off)
if (next.has(kind)) next.delete(kind)
else next.add(kind)
updateSettings({ notifOff: NOTIF_KINDS.filter((k) => next.has(k)) })
}
return (
<>
<SectionTitle>{t('notif.title')}</SectionTitle>
<p className="-mt-1 mb-3 text-xs text-ink-3">{t('notifPrefs.hint')}</p>
<div className="card divide-y divide-line overflow-hidden">
{GROUPS.map((g) => (
<div key={g.title} className="px-4 pb-1.5 pt-3">
<p className="text-xs font-semibold uppercase tracking-wide text-ink-3">{t(g.title)}</p>
{g.kinds.map(([kind, label]) => {
const on = !off.has(kind)
return (
<button key={kind} type="button" role="switch" aria-checked={on} onClick={() => toggle(kind)} className="flex w-full items-center gap-3 py-2.5 text-start">
<span className="flex-1 text-sm">{t(label)}</span>
<span className={cx('relative h-6 w-11 shrink-0 rounded-full transition-colors', on ? 'bg-accent-fill' : 'border border-line-strong bg-surface-2')}>
<span className={cx('absolute top-0.5 size-5 rounded-full', on ? 'start-[22px] bg-on-accent' : 'start-0.5 bg-ink')} />
</span>
</button>
)
})}
</div>
))}
</div>
</>
)
}
+13
View File
@@ -1169,6 +1169,19 @@ const dict: Translations = {
"translate.showTranslation": "عرض الترجمة",
"translate.translate": "ترجمة ({lang})",
"translate.translating": "جارٍ الترجمة…",
"notifPrefs.hint": "اختر ما يظهر تحت الجرس. ما توقفه لن يُرسل بعد الآن.",
"notifPrefs.follows": "المتابعات",
"notifPrefs.reviews": "مراجعاتي",
"notifPrefs.friends": "نشاط من أتابعهم",
"notifPrefs.new_follower": "متابع جديد",
"notifPrefs.follow_request": "طلب متابعة",
"notifPrefs.follow_accepted": "تم قبول الطلب",
"notifPrefs.unfollow": "إلغاء المتابعة",
"notifPrefs.reaction": "تفاعلات على مراجعاتي",
"notifPrefs.review_comment": "تعليقات على مراجعاتي",
"notifPrefs.friend_review": "مراجعة جديدة",
"notifPrefs.friend_started": "بدء مسلسل",
"notifPrefs.friend_added": "إضافة إلى «للمشاهدة»",
}
export default dict
+13
View File
@@ -1020,6 +1020,19 @@ const dict: Translations = {
"translate.showTranslation": "Übersetzung anzeigen",
"translate.translate": "Übersetzen ({lang})",
"translate.translating": "Wird übersetzt…",
"notifPrefs.hint": "Wähle aus, was unter der Glocke erscheint. Was du ausschaltest, wird nicht mehr gesendet.",
"notifPrefs.follows": "Folgen",
"notifPrefs.reviews": "Meine Kritiken",
"notifPrefs.friends": "Aktivität von Leuten, denen ich folge",
"notifPrefs.new_follower": "Neuer Follower",
"notifPrefs.follow_request": "Folgeanfrage",
"notifPrefs.follow_accepted": "Anfrage angenommen",
"notifPrefs.unfollow": "Entfolgt",
"notifPrefs.reaction": "Reaktionen auf meine Kritiken",
"notifPrefs.review_comment": "Kommentare zu meinen Kritiken",
"notifPrefs.friend_review": "Neue Kritik",
"notifPrefs.friend_started": "Serie angefangen",
"notifPrefs.friend_added": "Zu „Geplant“ hinzugefügt",
}
export default dict
+13
View File
@@ -1020,6 +1020,19 @@ const dict: Translations = {
"translate.showTranslation": "See translation",
"translate.translate": "Translate ({lang})",
"translate.translating": "Translating…",
"notifPrefs.hint": "Choose what shows up under the bell. Anything you turn off is no longer sent.",
"notifPrefs.follows": "Follows",
"notifPrefs.reviews": "My reviews",
"notifPrefs.friends": "Activity from people I follow",
"notifPrefs.new_follower": "New follower",
"notifPrefs.follow_request": "Follow request",
"notifPrefs.follow_accepted": "Request accepted",
"notifPrefs.unfollow": "Unfollow",
"notifPrefs.reaction": "Reactions to my reviews",
"notifPrefs.review_comment": "Comments on my reviews",
"notifPrefs.friend_review": "New review",
"notifPrefs.friend_started": "Started a series",
"notifPrefs.friend_added": "Added to “To watch”",
}
export default dict
+13
View File
@@ -1020,6 +1020,19 @@ const dict: Translations = {
"translate.showTranslation": "Ver traducción",
"translate.translate": "Traducir ({lang})",
"translate.translating": "Traduciendo…",
"notifPrefs.hint": "Elige lo que aparece en la campana. Lo que desactives ya no se envía.",
"notifPrefs.follows": "Seguimientos",
"notifPrefs.reviews": "Mis reseñas",
"notifPrefs.friends": "Actividad de las personas que sigo",
"notifPrefs.new_follower": "Nuevo seguidor",
"notifPrefs.follow_request": "Solicitud de seguimiento",
"notifPrefs.follow_accepted": "Solicitud aceptada",
"notifPrefs.unfollow": "Dejar de seguir",
"notifPrefs.reaction": "Reacciones a mis reseñas",
"notifPrefs.review_comment": "Comentarios en mis reseñas",
"notifPrefs.friend_review": "Nueva reseña",
"notifPrefs.friend_started": "Serie empezada",
"notifPrefs.friend_added": "Añadido a «Por ver»",
}
export default dict
+13
View File
@@ -1022,6 +1022,19 @@ const dict = {
"translate.showTranslation": "Voir la traduction",
"translate.translate": "Traduire ({lang})",
"translate.translating": "Traduction…",
"notifPrefs.hint": "Choisis ce qui apparaît dans la cloche. Ce que tu désactives n'est plus envoyé.",
"notifPrefs.follows": "Abonnements",
"notifPrefs.reviews": "Mes avis",
"notifPrefs.friends": "Activité des comptes que je suis",
"notifPrefs.new_follower": "Nouvel abonné",
"notifPrefs.follow_request": "Demande d'abonnement",
"notifPrefs.follow_accepted": "Demande acceptée",
"notifPrefs.unfollow": "Désabonnement",
"notifPrefs.reaction": "Réactions à mes avis",
"notifPrefs.review_comment": "Commentaires sur mes avis",
"notifPrefs.friend_review": "Nouvel avis",
"notifPrefs.friend_started": "Série commencée",
"notifPrefs.friend_added": "Ajout à « À voir »",
}
export default dict
+13
View File
@@ -1020,6 +1020,19 @@ const dict: Translations = {
"translate.showTranslation": "अनुवाद देखें",
"translate.translate": "अनुवाद करें ({lang})",
"translate.translating": "अनुवाद हो रहा है…",
"notifPrefs.hint": "चुनें कि घंटी में क्या दिखे। जो आप बंद करेंगे, वह अब नहीं भेजा जाएगा।",
"notifPrefs.follows": "फ़ॉलो",
"notifPrefs.reviews": "मेरी समीक्षाएँ",
"notifPrefs.friends": "जिन्हें मैं फ़ॉलो करता/करती हूँ उनकी गतिविधि",
"notifPrefs.new_follower": "नया फ़ॉलोअर",
"notifPrefs.follow_request": "फ़ॉलो अनुरोध",
"notifPrefs.follow_accepted": "अनुरोध स्वीकार हुआ",
"notifPrefs.unfollow": "अनफ़ॉलो",
"notifPrefs.reaction": "मेरी समीक्षाओं पर प्रतिक्रियाएँ",
"notifPrefs.review_comment": "मेरी समीक्षाओं पर टिप्पणियाँ",
"notifPrefs.friend_review": "नई समीक्षा",
"notifPrefs.friend_started": "सीरीज़ शुरू की",
"notifPrefs.friend_added": "“देखना है” में जोड़ा",
}
export default dict
+13
View File
@@ -1020,6 +1020,19 @@ const dict: Translations = {
"translate.showTranslation": "Lihat terjemahan",
"translate.translate": "Terjemahkan ({lang})",
"translate.translating": "Menerjemahkan…",
"notifPrefs.hint": "Pilih apa yang muncul di lonceng. Yang kamu matikan tidak akan dikirim lagi.",
"notifPrefs.follows": "Mengikuti",
"notifPrefs.reviews": "Ulasanku",
"notifPrefs.friends": "Aktivitas orang yang kuikuti",
"notifPrefs.new_follower": "Pengikut baru",
"notifPrefs.follow_request": "Permintaan mengikuti",
"notifPrefs.follow_accepted": "Permintaan diterima",
"notifPrefs.unfollow": "Berhenti mengikuti",
"notifPrefs.reaction": "Reaksi pada ulasanku",
"notifPrefs.review_comment": "Komentar pada ulasanku",
"notifPrefs.friend_review": "Ulasan baru",
"notifPrefs.friend_started": "Mulai menonton serial",
"notifPrefs.friend_added": "Ditambahkan ke “Mau ditonton”",
}
export default dict
+13
View File
@@ -1020,6 +1020,19 @@ const dict: Translations = {
"translate.showTranslation": "Vedi traduzione",
"translate.translate": "Traduci ({lang})",
"translate.translating": "Traduzione…",
"notifPrefs.hint": "Scegli cosa appare sotto la campanella. Ciò che disattivi non viene più inviato.",
"notifPrefs.follows": "Follow",
"notifPrefs.reviews": "Le mie recensioni",
"notifPrefs.friends": "Attività delle persone che seguo",
"notifPrefs.new_follower": "Nuovo follower",
"notifPrefs.follow_request": "Richiesta di follow",
"notifPrefs.follow_accepted": "Richiesta accettata",
"notifPrefs.unfollow": "Smesso di seguire",
"notifPrefs.reaction": "Reazioni alle mie recensioni",
"notifPrefs.review_comment": "Commenti alle mie recensioni",
"notifPrefs.friend_review": "Nuova recensione",
"notifPrefs.friend_started": "Serie iniziata",
"notifPrefs.friend_added": "Aggiunto a «Da vedere»",
}
export default dict
+13
View File
@@ -1020,6 +1020,19 @@ const dict: Translations = {
"translate.showTranslation": "翻訳を見る",
"translate.translate": "翻訳する({lang})",
"translate.translating": "翻訳中…",
"notifPrefs.hint": "ベルに表示する通知を選べます。オフにした通知は届かなくなります。",
"notifPrefs.follows": "フォロー",
"notifPrefs.reviews": "自分のレビュー",
"notifPrefs.friends": "フォロー中の人のアクティビティ",
"notifPrefs.new_follower": "新しいフォロワー",
"notifPrefs.follow_request": "フォローリクエスト",
"notifPrefs.follow_accepted": "リクエストの承認",
"notifPrefs.unfollow": "フォロー解除",
"notifPrefs.reaction": "レビューへのリアクション",
"notifPrefs.review_comment": "レビューへのコメント",
"notifPrefs.friend_review": "新しいレビュー",
"notifPrefs.friend_started": "シリーズを見始めた",
"notifPrefs.friend_added": "「見たい」に追加",
}
export default dict
+13
View File
@@ -1020,6 +1020,19 @@ const dict: Translations = {
"translate.showTranslation": "번역 보기",
"translate.translate": "번역하기 ({lang})",
"translate.translating": "번역 중…",
"notifPrefs.hint": "종 아이콘에 표시할 알림을 선택하세요. 끈 알림은 더 이상 보내지 않아요.",
"notifPrefs.follows": "팔로우",
"notifPrefs.reviews": "내 리뷰",
"notifPrefs.friends": "내가 팔로우하는 사람들의 활동",
"notifPrefs.new_follower": "새 팔로워",
"notifPrefs.follow_request": "팔로우 요청",
"notifPrefs.follow_accepted": "요청 수락",
"notifPrefs.unfollow": "팔로우 취소",
"notifPrefs.reaction": "내 리뷰에 대한 반응",
"notifPrefs.review_comment": "내 리뷰에 달린 댓글",
"notifPrefs.friend_review": "새 리뷰",
"notifPrefs.friend_started": "시리즈 시청 시작",
"notifPrefs.friend_added": "'볼 예정'에 추가",
}
export default dict
+13
View File
@@ -1020,6 +1020,19 @@ const dict: Translations = {
"translate.showTranslation": "Vertaling bekijken",
"translate.translate": "Vertalen ({lang})",
"translate.translating": "Bezig met vertalen…",
"notifPrefs.hint": "Kies wat er onder het belletje verschijnt. Wat je uitzet, wordt niet meer verstuurd.",
"notifPrefs.follows": "Volgen",
"notifPrefs.reviews": "Mijn recensies",
"notifPrefs.friends": "Activiteit van mensen die ik volg",
"notifPrefs.new_follower": "Nieuwe volger",
"notifPrefs.follow_request": "Volgverzoek",
"notifPrefs.follow_accepted": "Verzoek geaccepteerd",
"notifPrefs.unfollow": "Ontvolgd",
"notifPrefs.reaction": "Reacties op mijn recensies",
"notifPrefs.review_comment": "Opmerkingen bij mijn recensies",
"notifPrefs.friend_review": "Nieuwe recensie",
"notifPrefs.friend_started": "Serie begonnen",
"notifPrefs.friend_added": "Toegevoegd aan ‘Nog kijken’",
}
export default dict
+13
View File
@@ -1118,6 +1118,19 @@ const dict: Translations = {
"translate.showTranslation": "Pokaż tłumaczenie",
"translate.translate": "Przetłumacz ({lang})",
"translate.translating": "Tłumaczenie…",
"notifPrefs.hint": "Wybierz, co pojawia się pod dzwonkiem. To, co wyłączysz, nie będzie już wysyłane.",
"notifPrefs.follows": "Obserwowanie",
"notifPrefs.reviews": "Moje recenzje",
"notifPrefs.friends": "Aktywność obserwowanych osób",
"notifPrefs.new_follower": "Nowy obserwujący",
"notifPrefs.follow_request": "Prośba o obserwowanie",
"notifPrefs.follow_accepted": "Prośba zaakceptowana",
"notifPrefs.unfollow": "Koniec obserwowania",
"notifPrefs.reaction": "Reakcje na moje recenzje",
"notifPrefs.review_comment": "Komentarze do moich recenzji",
"notifPrefs.friend_review": "Nowa recenzja",
"notifPrefs.friend_started": "Rozpoczęty serial",
"notifPrefs.friend_added": "Dodano do „Do obejrzenia”",
}
export default dict
+13
View File
@@ -1020,6 +1020,19 @@ const dict: Translations = {
"translate.showTranslation": "Ver tradução",
"translate.translate": "Traduzir ({lang})",
"translate.translating": "Traduzindo…",
"notifPrefs.hint": "Escolhe o que aparece no sino. O que desativares deixa de ser enviado.",
"notifPrefs.follows": "Seguidores",
"notifPrefs.reviews": "As minhas críticas",
"notifPrefs.friends": "Atividade de quem sigo",
"notifPrefs.new_follower": "Novo seguidor",
"notifPrefs.follow_request": "Pedido para seguir",
"notifPrefs.follow_accepted": "Pedido aceite",
"notifPrefs.unfollow": "Deixou de seguir",
"notifPrefs.reaction": "Reações às minhas críticas",
"notifPrefs.review_comment": "Comentários nas minhas críticas",
"notifPrefs.friend_review": "Nova crítica",
"notifPrefs.friend_started": "Série começada",
"notifPrefs.friend_added": "Adicionado a «Quero ver»",
}
export default dict
+13
View File
@@ -1118,6 +1118,19 @@ const dict: Translations = {
"translate.showTranslation": "Показать перевод",
"translate.translate": "Перевести ({lang})",
"translate.translating": "Перевод…",
"notifPrefs.hint": "Выбери, что показывать под колокольчиком. Отключённое больше не отправляется.",
"notifPrefs.follows": "Подписки",
"notifPrefs.reviews": "Мои отзывы",
"notifPrefs.friends": "Активность тех, на кого я подписан(а)",
"notifPrefs.new_follower": "Новый подписчик",
"notifPrefs.follow_request": "Запрос на подписку",
"notifPrefs.follow_accepted": "Запрос принят",
"notifPrefs.unfollow": "Отписка",
"notifPrefs.reaction": "Реакции на мои отзывы",
"notifPrefs.review_comment": "Комментарии к моим отзывам",
"notifPrefs.friend_review": "Новый отзыв",
"notifPrefs.friend_started": "Начатый сериал",
"notifPrefs.friend_added": "Добавлено в «В планах»",
}
export default dict
+13
View File
@@ -1020,6 +1020,19 @@ const dict: Translations = {
"translate.showTranslation": "ดูคำแปล",
"translate.translate": "แปล ({lang})",
"translate.translating": "กำลังแปล…",
"notifPrefs.hint": "เลือกสิ่งที่จะแสดงในกระดิ่ง สิ่งที่ปิดไว้จะไม่ถูกส่งอีก",
"notifPrefs.follows": "การติดตาม",
"notifPrefs.reviews": "รีวิวของฉัน",
"notifPrefs.friends": "กิจกรรมของคนที่ฉันติดตาม",
"notifPrefs.new_follower": "ผู้ติดตามใหม่",
"notifPrefs.follow_request": "คำขอติดตาม",
"notifPrefs.follow_accepted": "คำขอได้รับการยอมรับ",
"notifPrefs.unfollow": "เลิกติดตาม",
"notifPrefs.reaction": "รีแอคชันต่อรีวิวของฉัน",
"notifPrefs.review_comment": "ความคิดเห็นในรีวิวของฉัน",
"notifPrefs.friend_review": "รีวิวใหม่",
"notifPrefs.friend_started": "เริ่มดูซีรีส์",
"notifPrefs.friend_added": "เพิ่มใน “อยากดู”",
}
export default dict
+13
View File
@@ -1020,6 +1020,19 @@ const dict: Translations = {
"translate.showTranslation": "Çeviriyi gör",
"translate.translate": "Çevir ({lang})",
"translate.translating": "Çevriliyor…",
"notifPrefs.hint": "Zilin altında nelerin görüneceğini seç. Kapattıkların artık gönderilmez.",
"notifPrefs.follows": "Takip",
"notifPrefs.reviews": "Yorumlarım",
"notifPrefs.friends": "Takip ettiklerimin etkinliği",
"notifPrefs.new_follower": "Yeni takipçi",
"notifPrefs.follow_request": "Takip isteği",
"notifPrefs.follow_accepted": "İstek kabul edildi",
"notifPrefs.unfollow": "Takipten çıkma",
"notifPrefs.reaction": "Yorumlarıma tepkiler",
"notifPrefs.review_comment": "Yorumlarıma gelen yanıtlar",
"notifPrefs.friend_review": "Yeni yorum",
"notifPrefs.friend_started": "Başlanan dizi",
"notifPrefs.friend_added": "“İzlenecek” listesine ekleme",
}
export default dict
+13
View File
@@ -1020,6 +1020,19 @@ const dict: Translations = {
"translate.showTranslation": "Xem bản dịch",
"translate.translate": "Dịch ({lang})",
"translate.translating": "Đang dịch…",
"notifPrefs.hint": "Chọn những gì hiển thị dưới chuông. Mục bạn tắt sẽ không được gửi nữa.",
"notifPrefs.follows": "Theo dõi",
"notifPrefs.reviews": "Đánh giá của tôi",
"notifPrefs.friends": "Hoạt động của người tôi theo dõi",
"notifPrefs.new_follower": "Người theo dõi mới",
"notifPrefs.follow_request": "Yêu cầu theo dõi",
"notifPrefs.follow_accepted": "Yêu cầu được chấp nhận",
"notifPrefs.unfollow": "Hủy theo dõi",
"notifPrefs.reaction": "Cảm xúc về đánh giá của tôi",
"notifPrefs.review_comment": "Bình luận về đánh giá của tôi",
"notifPrefs.friend_review": "Đánh giá mới",
"notifPrefs.friend_started": "Bắt đầu xem phim bộ",
"notifPrefs.friend_added": "Thêm vào “Sẽ xem”",
}
export default dict
+13
View File
@@ -1020,6 +1020,19 @@ const dict: Translations = {
"translate.showTranslation": "查看译文",
"translate.translate": "翻译({lang})",
"translate.translating": "正在翻译…",
"notifPrefs.hint": "选择铃铛中显示的内容。关闭的通知将不再发送。",
"notifPrefs.follows": "关注",
"notifPrefs.reviews": "我的评价",
"notifPrefs.friends": "我关注的人的动态",
"notifPrefs.new_follower": "新关注者",
"notifPrefs.follow_request": "关注请求",
"notifPrefs.follow_accepted": "请求已接受",
"notifPrefs.unfollow": "取消关注",
"notifPrefs.reaction": "对我评价的回应",
"notifPrefs.review_comment": "对我评价的评论",
"notifPrefs.friend_review": "新评价",
"notifPrefs.friend_started": "开始看剧",
"notifPrefs.friend_added": "加入“想看”",
}
export default dict
+2 -1
View File
@@ -1,5 +1,5 @@
import { t } from '../i18n'
import type { BackupFile, Criteria, CustomList, MediaItem, MediaType, Settings, TopCategory, TopEntry, WatchStatus } from '../types'
import { NOTIF_KINDS, type BackupFile, type Criteria, type CustomList, type MediaItem, type MediaType, type Settings, type TopCategory, type TopEntry, type WatchStatus } from '../types'
import { ALL_TOP_CATEGORIES, MEDIA_TYPES, STATUSES } from './constants'
import { episodeCap } from './franchise'
import { cleanThemeMode } from './theme'
@@ -161,6 +161,7 @@ export function normalizeSettings(raw: unknown): Partial<Settings> | undefined {
if (Array.isArray(raw.statsHiddenMonths)) {
out.statsHiddenMonths = [...new Set(raw.statsHiddenMonths.filter((m): m is string => typeof m === 'string' && /^\d{4}-(0[1-9]|1[0-2])$/.test(m)))].sort().slice(-600)
}
if (Array.isArray(raw.notifOff)) out.notifOff = NOTIF_KINDS.filter((k) => (raw.notifOff as unknown[]).includes(k))
return out
}
+2
View File
@@ -4,6 +4,7 @@ import { Check, Download, ExternalLink, HardDrive, Import, Trash2, Upload, UserX
import { lazy, Suspense, useEffect, useRef, useState, type ReactNode } from 'react'
import AccountSection from '../components/AccountSection'
import ConfirmDialog from '../components/ConfirmDialog'
import NotificationSettings from '../components/NotificationSettings'
import { PageHeader, SectionTitle } from '../components/ui'
import { exportBackup, parseBackupFile, type ParsedBackup } from '../lib/backup'
import { ALL_TOP_CATEGORIES, TOP_CATEGORIES } from '../lib/constants'
@@ -133,6 +134,7 @@ export default function SettingsPage() {
)}
{account && <AccountSection account={account} onMessage={(kind, text) => setMessage({ kind, text })} />}
{account && <NotificationSettings />}
{guest && (
<>
<SectionTitle>{t('account.title')}</SectionTitle>
+5 -4
View File
@@ -268,9 +268,10 @@ export function MediaProvider({
getLists: () => listsRef.current,
applyLists: (next) => setLists(() => next, true),
getSettings: () => {
const { topCategories, themeMode, statsHiddenMonths } = settingsRef.current
// Mois masqués : liste vide plutôt qu'absente, sinon « tout réafficher » ne partirait jamais au serveur
return { topCategories, themeMode, statsHiddenMonths: statsHiddenMonths ?? [] }
const { topCategories, themeMode, statsHiddenMonths, notifOff } = settingsRef.current
// Listes vides plutôt qu'absentes, sinon « tout réafficher / tout réactiver » ne partirait jamais au serveur.
// notifOff est aussi lu par le serveur : les notifications désactivées ne sont pas créées.
return { topCategories, themeMode, statsHiddenMonths: statsHiddenMonths ?? [], notifOff: notifOff ?? [] }
},
applySettings: (patch) => updateSettingsRef.current(patch, true),
itemsChanged: () => void reloadItems().catch(() => {}),
@@ -311,7 +312,7 @@ export function MediaProvider({
}, [settings.themeMode])
const updateSettings = useCallback((patch: Partial<Settings>, silent = false) => {
if (!silent && syncRef.current && ('topCategories' in patch || 'themeMode' in patch || 'statsHiddenMonths' in patch)) syncRef.current.markSettings()
if (!silent && syncRef.current && ('topCategories' in patch || 'themeMode' in patch || 'statsHiddenMonths' in patch || 'notifOff' in patch)) syncRef.current.markSettings()
setSettings((prev) => {
const next = { ...prev, ...patch }
try {
+6
View File
@@ -109,8 +109,14 @@ export interface Settings {
themeMode: ThemeMode
/** Mois masqués dans la courbe des stats (AAAA-MM), ex. le mois où j'ai tout ajouté d'un coup. */
statsHiddenMonths?: string[]
/** Types de notifications désactivés (Réglages → Notifications). Lu aussi par le serveur, qui ne les crée pas. */
notifOff?: NotifKind[]
}
/** Types de notifications (mêmes noms que la colonne notifications.kind). */
export const NOTIF_KINDS = ['new_follower', 'follow_request', 'follow_accepted', 'unfollow', 'reaction', 'review_comment', 'friend_review', 'friend_started', 'friend_added'] as const
export type NotifKind = (typeof NOTIF_KINDS)[number]
export interface CustomList {
id: string
name: string