feat(board): add more_threads_last_year suggestion

This commit is contained in:
plebeius
2025-11-08 15:56:32 +01:00
parent 9cc78694d8
commit e3e25995d6
37 changed files with 116 additions and 42 deletions
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "مساعدة",
"filter_and_highlights_help": "مساعدة الفلاتر والإبرازات",
"filter_and_highlights": "التصفية والتسليط الضوء",
"boards_you_moderate": "المنتديات التي تقوم بالإشراف عليها"
"boards_you_moderate": "المنتديات التي تقوم بالإشراف عليها",
"more_threads_last_year": "{{count}} مواضيع منذ {{currentTimeFilterName}} — [<1>عرض المزيد من المواضيع من السنة الماضية</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "সাহায্য",
"filter_and_highlights_help": "ফিল্টার এবং হাইলাইট সাহায্য",
"filter_and_highlights": "ফিল্টার এবং হাইলাইট",
"boards_you_moderate": "আপনি যে বোর্ডগুলি পরিচালনা করেন"
"boards_you_moderate": "আপনি যে বোর্ডগুলি পরিচালনা করেন",
"more_threads_last_year": "{{count}} থ্রেড {{currentTimeFilterName}} থেকে — [<1>গত বছরের আরও থ্রেড দেখান</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "Pomoc",
"filter_and_highlights_help": "Pomoc s filtry a zvýrazněním",
"filter_and_highlights": "Filtry a zvýraznění",
"boards_you_moderate": "Fóra, která moderujete"
"boards_you_moderate": "Fóra, která moderujete",
"more_threads_last_year": "{{count}} příspěvků od {{currentTimeFilterName}} — [<1>Zobrazit více příspěvků z minulého roku</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "Hjælp",
"filter_and_highlights_help": "Filtre og fremhævelser Hjælp",
"filter_and_highlights": "Filtre og fremhævninger",
"boards_you_moderate": "Boards du modererer"
"boards_you_moderate": "Boards du modererer",
"more_threads_last_year": "{{count}} tråde siden {{currentTimeFilterName}} — [<1>Vis flere tråde fra sidste år</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "Hilfe",
"filter_and_highlights_help": "Filter- und Markierungs-Hilfe",
"filter_and_highlights": "Filter und Hervorhebungen",
"boards_you_moderate": "Boards, die Sie moderieren"
"boards_you_moderate": "Boards, die Sie moderieren",
"more_threads_last_year": "{{count}} Threads seit {{currentTimeFilterName}} — [<1>Mehr Threads vom letzten Jahr anzeigen</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "Βοήθεια",
"filter_and_highlights_help": "Βοήθεια φίλτρων και επισήμανσης",
"filter_and_highlights": "Φίλτρα και Επισημάνσεις",
"boards_you_moderate": "Boards που διαχειρίζεστε"
"boards_you_moderate": "Boards που διαχειρίζεστε",
"more_threads_last_year": "{{count}} νήματα από {{currentTimeFilterName}} — [<1>Προβολή περισσότερων νημάτων από το περασμένο έτος</1>]"
}
+3 -2
View File
@@ -296,5 +296,6 @@
"help": "Help",
"filter_and_highlights_help": "Filters & Highlights Help",
"filter_and_highlights": "Filters & Highlights",
"boards_you_moderate": "boards you moderate"
}
"boards_you_moderate": "boards you moderate",
"more_threads_last_year": "{{count}} threads since {{currentTimeFilterName}} — [<1>Show More Threads from Last Year</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "Ayuda",
"filter_and_highlights_help": "Ayuda de filtros y resaltes",
"filter_and_highlights": "Filtros y resaltados",
"boards_you_moderate": "tableros que moderas"
"boards_you_moderate": "tableros que moderas",
"more_threads_last_year": "{{count}} hilos desde {{currentTimeFilterName}} — [<1>Ver más hilos del año pasado</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "کمک",
"filter_and_highlights_help": "کمک فیلترها و برجسته‌ها",
"filter_and_highlights": "فیلترها و برجسته‌ها",
"boards_you_moderate": "تابلوهایی که مدیریت می‌کنید"
"boards_you_moderate": "تابلوهایی که مدیریت می‌کنید",
"more_threads_last_year": "{{count}} پست از {{currentTimeFilterName}} — [<1>نمایش بیشتر پست‌های سال گذشته</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "Apua",
"filter_and_highlights_help": "Suodattimet ja korostukset -apu",
"filter_and_highlights": "Suodattimet ja korostukset",
"boards_you_moderate": "lautakunnat, joita valvot"
"boards_you_moderate": "lautakunnat, joita valvot",
"more_threads_last_year": "{{count}} ketjua sitten {{currentTimeFilterName}} — [<1>Näytä lisää viime vuoden ketjuja</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "Tulong",
"filter_and_highlights_help": "Tulong sa mga filter at highlight",
"filter_and_highlights": "Mga filter at highlight",
"boards_you_moderate": "mga board na iyong minomoderate"
"boards_you_moderate": "mga board na iyong minomoderate",
"more_threads_last_year": "{{count}} mga thread mula {{currentTimeFilterName}} — [<1>Ipakita ang higit pang mga thread mula noong nakaraang taon</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "Aide",
"filter_and_highlights_help": "Aide sur les filtres et surlignages",
"filter_and_highlights": "Filtres et surlignages",
"boards_you_moderate": "boards que vous modérez"
"boards_you_moderate": "boards que vous modérez",
"more_threads_last_year": "{{count}} fils depuis {{currentTimeFilterName}} — [<1>Afficher plus de fils de l'année dernière</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "עזרה",
"filter_and_highlights_help": "עזרה במסננים והדגשות",
"filter_and_highlights": "מסננים והדגשות",
"boards_you_moderate": "לוחות שאתה מפקח עליהם"
"boards_you_moderate": "לוחות שאתה מפקח עליהם",
"more_threads_last_year": "{{count}} חוטים מאז {{currentTimeFilterName}} — [<1>הצג עוד חוטים מהשנה שעברה</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "मदद",
"filter_and_highlights_help": "फ़िल्टर और हाइलाइट्स सहायता",
"filter_and_highlights": "फ़िल्टर और हाइलाइट्स",
"boards_you_moderate": "बोर्ड जो आप मॉडरेट करते हैं"
"boards_you_moderate": "बोर्ड जो आप मॉडरेट करते हैं",
"more_threads_last_year": "{{count}} थ्रेड्स {{currentTimeFilterName}} से — [<1>पिछले साल के अधिक थ्रेड्स दिखाएं</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "Segítség",
"filter_and_highlights_help": "Szűrők és kiemelések súgó",
"filter_and_highlights": "Szűrők és kiemelések",
"boards_you_moderate": "boardok, amelyeket moderálsz"
"boards_you_moderate": "boardok, amelyeket moderálsz",
"more_threads_last_year": "{{count}} szál {{currentTimeFilterName}} óta — [<1>Több szál megjelenítése a múlt évből</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "Bantuan",
"filter_and_highlights_help": "Bantuan Filter dan Sorotan",
"filter_and_highlights": "Filter dan Sorotan",
"boards_you_moderate": "board yang Anda moderasi"
"boards_you_moderate": "board yang Anda moderasi",
"more_threads_last_year": "{{count}} thread sejak {{currentTimeFilterName}} — [<1>Tampilkan lebih banyak thread dari tahun lalu</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "Aiuto",
"filter_and_highlights_help": "Aiuto su Filtri e Evidenziazioni",
"filter_and_highlights": "Filtri e Evidenziazioni",
"boards_you_moderate": "board che moderi"
"boards_you_moderate": "board che moderi",
"more_threads_last_year": "{{count}} thread da {{currentTimeFilterName}} — [<1>Mostra altri thread dell'anno scorso</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "ヘルプ",
"filter_and_highlights_help": "フィルターとハイライトのヘルプ",
"filter_and_highlights": "フィルターとハイライト",
"boards_you_moderate": "あなたが管理するボード"
"boards_you_moderate": "あなたが管理するボード",
"more_threads_last_year": "{{count}} スレッド {{currentTimeFilterName}} から — [<1>去年のスレッドをさらに表示</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "도움말",
"filter_and_highlights_help": "필터 및 하이라이트 도움말",
"filter_and_highlights": "필터 및 하이라이트",
"boards_you_moderate": "당신이 관리하는 게시판"
"boards_you_moderate": "당신이 관리하는 게시판",
"more_threads_last_year": "{{count}} 스레드 {{currentTimeFilterName}} 이후 — [<1>작년의 스레드 더 보기</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "मदत",
"filter_and_highlights_help": "फिल्टर आणि हायलाइट्स सहाय्य",
"filter_and_highlights": "फिल्टर आणि हायलाइट्स",
"boards_you_moderate": "तुम्ही ज्यांचे नियंत्रण करता अशा बोर्ड्स"
"boards_you_moderate": "तुम्ही ज्यांचे नियंत्रण करता अशा बोर्ड्स",
"more_threads_last_year": "{{count}} ध糀ं {{currentTimeFilterName}} पासून — [<1>गेल्या वर्षातील आणखी थ्रेड्स दाखवा</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "Help",
"filter_and_highlights_help": "Filters en Markeringen Help",
"filter_and_highlights": "Filters en markeringen",
"boards_you_moderate": "boards die je beheert"
"boards_you_moderate": "boards die je beheert",
"more_threads_last_year": "{{count}} threads sinds {{currentTimeFilterName}} — [<1>Meer threads van afgelopen jaar tonen</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "Hjelp",
"filter_and_highlights_help": "Filtre og fremhevinger Hjelp",
"filter_and_highlights": "Filtre og uthevinger",
"boards_you_moderate": "boards du modererer"
"boards_you_moderate": "boards du modererer",
"more_threads_last_year": "{{count}} tråder siden {{currentTimeFilterName}} — [<1>Vis flere tråder fra forrige år</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "Pomoc",
"filter_and_highlights_help": "Pomoc dotycząca filtrów i wyróżnień",
"filter_and_highlights": "Filtry i wyróżnienia",
"boards_you_moderate": "boards, które moderujesz"
"boards_you_moderate": "boards, które moderujesz",
"more_threads_last_year": "{{count}} wątki od {{currentTimeFilterName}} — [<1>Pokaż więcej wątków z zeszłego roku</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "Ajuda",
"filter_and_highlights_help": "Ajuda de Filtros e Realces",
"filter_and_highlights": "Filtros e Destaques",
"boards_you_moderate": "boards que você modera"
"boards_you_moderate": "boards que você modera",
"more_threads_last_year": "{{count}} tópicos desde {{currentTimeFilterName}} — [<1>Mostrar mais tópicos do ano passado</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "Ajutor",
"filter_and_highlights_help": "Ajutor pentru filtre și evidențieri",
"filter_and_highlights": "Filtre și evidențieri",
"boards_you_moderate": "boards pe care le moderezi"
"boards_you_moderate": "boards pe care le moderezi",
"more_threads_last_year": "{{count}} subiecte din {{currentTimeFilterName}} — [<1>Afișați mai multe subiecte de anul trecut</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "Помощь",
"filter_and_highlights_help": "Помощь с фильтрами и выделениями",
"filter_and_highlights": "Фильтры и выделения",
"boards_you_moderate": "boards, которые вы модерируете"
"boards_you_moderate": "boards, которые вы модерируете",
"more_threads_last_year": "{{count}} темы с {{currentTimeFilterName}} — [<1>Показать больше тем с прошлого года</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "Ndihmë",
"filter_and_highlights_help": "Ndihma për Filtro & Thekso",
"filter_and_highlights": "Filtra dhe thekson",
"boards_you_moderate": "boards që i moderoni"
"boards_you_moderate": "boards që i moderoni",
"more_threads_last_year": "{{count}} tema nga {{currentTimeFilterName}} — [<1>Shfaq më shumë tema nga viti i kaluar</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "Hjälp",
"filter_and_highlights_help": "Filter och markeringar Hjälp",
"filter_and_highlights": "Filter och markeringar",
"boards_you_moderate": "boards du modererar"
"boards_you_moderate": "boards du modererar",
"more_threads_last_year": "{{count}} trådar sedan {{currentTimeFilterName}} — [<1>Visa fler trådar från förra året</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "సహాయం",
"filter_and_highlights_help": "ఫిల్టర్లు మరియు హైలైట్ సహాయం",
"filter_and_highlights": "ఫిల్టర్లు మరియు హైలైట్స్",
"boards_you_moderate": "మీరు మోడరేట్ చేసే బోర్డులు"
"boards_you_moderate": "మీరు మోడరేట్ చేసే బోర్డులు",
"more_threads_last_year": "{{count}} థ్రెడ్‌లు {{currentTimeFilterName}} నుండి — [<1>గత సంవత్సరం నుండి మరిన్ని థ్రెడ్‌లను చూపించండి</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "ช่วยเหลือ",
"filter_and_highlights_help": "ตัวกรองและการเน้นความช่วยเหลือ",
"filter_and_highlights": "ตัวกรองและไฮไลท์",
"boards_you_moderate": "บอร์ดที่คุณดูแล"
"boards_you_moderate": "บอร์ดที่คุณดูแล",
"more_threads_last_year": "{{count}} กระทู้ตั้งแต่ {{currentTimeFilterName}} — [<1>แสดงกระทู้จากปีที่แล้วเพิ่มเติม</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "Yardım",
"filter_and_highlights_help": "Filtreler ve Vurgular Yardımı",
"filter_and_highlights": "Filtreler ve Vurgular",
"boards_you_moderate": "modere ettiğiniz panolar"
"boards_you_moderate": "modere ettiğiniz panolar",
"more_threads_last_year": "{{count}} konu {{currentTimeFilterName}} itibariyle — [<1>Geçen yıldan daha fazla konu göster</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "Допомога",
"filter_and_highlights_help": "Допомога з фільтрами та підсвічуваннями",
"filter_and_highlights": "Фільтри та виділення",
"boards_you_moderate": "boards, які ви модеруватимете"
"boards_you_moderate": "boards, які ви модеруватимете",
"more_threads_last_year": "{{count}} тем з {{currentTimeFilterName}} — [<1>Показати більше тем з минулого року</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "مدد",
"filter_and_highlights_help": "فلٹرز اور ہائی لائٹس کی مدد",
"filter_and_highlights": "فلٹرز اور ہائلाइटس",
"boards_you_moderate": "وہ بورڈز جن کی آپ نگرانی کرتے ہیں"
"boards_you_moderate": "وہ بورڈز جن کی آپ نگرانی کرتے ہیں",
"more_threads_last_year": "{{count}} تھریڈز {{currentTimeFilterName}} سے — [<1>گزشتہ سال کے مزید تھریڈز دکھائیں</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "Trợ giúp",
"filter_and_highlights_help": "Trợ giúp bộ lọc và đánh dấu",
"filter_and_highlights": "Bộ lọc và Nổi bật",
"boards_you_moderate": "boards bạn điều hành"
"boards_you_moderate": "boards bạn điều hành",
"more_threads_last_year": "{{count}} chủ đề từ {{currentTimeFilterName}} — [<1>Hiển thị thêm các chủ đề từ năm ngoái</1>]"
}
+2 -1
View File
@@ -295,5 +295,6 @@
"help": "帮助",
"filter_and_highlights_help": "过滤器和高亮帮助",
"filter_and_highlights": "筛选器与高亮",
"boards_you_moderate": "您管理的板块"
"boards_you_moderate": "您管理的板块",
"more_threads_last_year": "{{count}} 主题自 {{currentTimeFilterName}} — [<1>显示更多去年的主题</1>]"
}
+22 -3
View File
@@ -148,14 +148,23 @@ const Board = () => {
newerThan: 60 * 60 * 24 * 30,
filter: hideThreadsWithoutImages ? createThreadsWithoutImagesFilter() : undefined,
});
const { feed: yearlyFeed } = useFeed({
subplebbitAddresses,
sortType,
newerThan: 60 * 60 * 24 * 365,
filter: hideThreadsWithoutImages ? createThreadsWithoutImagesFilter() : undefined,
});
const feedLength = feed.length;
const weeklyFeedLength = weeklyFeed.length;
const monthlyFeedLength = monthlyFeed.length;
const yearlyFeedLength = yearlyFeed.length;
const hasFeedLoaded = !!feed;
const loadingStateString =
useFeedStateString(subplebbitAddresses) ||
(!hasFeedLoaded || (feedLength === 0 && !(weeklyFeedLength > feedLength || monthlyFeedLength > feedLength)) ? t('loading_feed') : t('looking_for_more_posts'));
(!hasFeedLoaded || (feedLength === 0 && !(weeklyFeedLength > feedLength || monthlyFeedLength > feedLength || yearlyFeedLength > monthlyFeedLength))
? t('loading_feed')
: t('looking_for_more_posts'));
const [showMorePostsSuggestion, setShowMorePostsSuggestion] = useState(false);
useEffect(() => {
@@ -189,7 +198,7 @@ const Board = () => {
) : (
(isInAllView || isInSubscriptionsView || isInModView) &&
showMorePostsSuggestion &&
monthlyFeed.length > feed.length &&
(monthlyFeed.length > feed.length || yearlyFeed.length > monthlyFeed.length) &&
(() => {
const basePath = isInAllView ? '/all' : isInSubscriptionsView ? '/subscriptions' : isInModView ? '/mod' : boardPath ? `/${boardPath}` : '';
return weeklyFeed.length > feed.length ? (
@@ -202,7 +211,7 @@ const Board = () => {
}}
/>
</div>
) : (
) : monthlyFeed.length > feed.length ? (
<div className={styles.morePostsSuggestion}>
<Trans
i18nKey='more_threads_last_month'
@@ -212,6 +221,16 @@ const Board = () => {
}}
/>
</div>
) : (
<div className={styles.morePostsSuggestion}>
<Trans
i18nKey='more_threads_last_year'
values={{ currentTimeFilterName, count: feed.length }}
components={{
1: <Link to={`${basePath}/1y`} />,
}}
/>
</div>
);
})()
)}
+23 -3
View File
@@ -285,6 +285,13 @@ const Catalog = () => {
filter: createCombinedFilter(showTextOnlyThreads, filterItems, searchText, subplebbitAddress || 'all', handleFilterMatch),
});
const { feed: yearlyFeed } = useFeed({
subplebbitAddresses,
sortType,
newerThan: 60 * 60 * 24 * 365,
filter: createCombinedFilter(showTextOnlyThreads, filterItems, searchText, subplebbitAddress || 'all', handleFilterMatch),
});
const [showMorePostsSuggestion, setShowMorePostsSuggestion] = useState(false);
useEffect(() => {
const timer = setTimeout(() => {
@@ -306,9 +313,12 @@ const Catalog = () => {
const feedLength = feed.length;
const weeklyFeedLength = weeklyFeed.length;
const monthlyFeedLength = monthlyFeed.length;
const yearlyFeedLength = yearlyFeed.length;
const hasFeedLoaded = !!feed;
const loadingStateString =
useFeedStateString(subplebbitAddresses) || !hasFeedLoaded || (feedLength === 0 && !(weeklyFeedLength > feedLength || monthlyFeedLength > feedLength))
useFeedStateString(subplebbitAddresses) ||
!hasFeedLoaded ||
(feedLength === 0 && !(weeklyFeedLength > feedLength || monthlyFeedLength > feedLength || yearlyFeedLength > monthlyFeedLength))
? t('loading_feed')
: t('looking_for_more_posts');
@@ -361,7 +371,7 @@ const Catalog = () => {
) : (
(isInAllView || isInSubscriptionsView) &&
showMorePostsSuggestion &&
monthlyFeed.length > feed.length &&
(monthlyFeed.length > feed.length || yearlyFeed.length > monthlyFeed.length) &&
(weeklyFeed.length > feed.length ? (
<div className={styles.stateString}>
<Trans
@@ -372,7 +382,7 @@ const Catalog = () => {
}}
/>
</div>
) : (
) : monthlyFeed.length > feed.length ? (
<div className={styles.stateString}>
<Trans
i18nKey='more_threads_last_month'
@@ -382,6 +392,16 @@ const Catalog = () => {
}}
/>
</div>
) : (
<div className={styles.stateString}>
<Trans
i18nKey='more_threads_last_year'
values={{ currentTimeFilterName, count: feed.length }}
components={{
1: <Link to={(isInAllView ? '/all/catalog' : isInSubscriptionsView ? '/subscriptions/catalog' : `/${boardPath}/catalog`) + '/1y'} />,
}}
/>
</div>
))
)}
<div className={styles.stateString}>