this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Handle hidden-filter first then quote states

+428 -315
+3 -1
src/components/status.css
··· 282 282 } 283 283 284 284 &.status-card-ghost { 285 - border-style: dashed; 285 + color: var(--text-insignificant-color); 286 + border: var(--hairline-width) dashed var(--text-insignificant-color); 287 + box-shadow: none; 286 288 } 287 289 } 288 290
+47 -43
src/components/status.jsx
··· 378 378 showActionsBar, 379 379 showReplyParent, 380 380 mediaFirst, 381 - showFilteredHidden, 382 381 }) { 383 382 const { _, t, i18n } = useLingui(); 384 383 const rtf = RTF(i18n.locale); ··· 500 499 isFiltered(filtered, filterContext); 501 500 502 501 if (filterInfo?.action === 'hide') { 503 - if (showFilteredHidden) { 504 - return ( 505 - <div class="status-card-unfulfilled status-card-ghost"> 506 - <Icon icon="quote" /> 507 - <i> 508 - <Trans>Post hidden by your filters</Trans> 509 - </i> 510 - </div> 511 - ); 512 - } 513 502 return null; 514 503 } 515 504 ··· 3886 3875 ); 3887 3876 } 3888 3877 3878 + const handledUnfulfilledStates = [ 3879 + 'deleted', 3880 + 'unauthorized', 3881 + 'pending', 3882 + 'rejected', 3883 + 'revoked', 3884 + ]; 3885 + const unfulfilledText = { 3886 + filterHidden: msg`Post hidden by your filters`, 3887 + deleted: msg`Post removed by author.`, 3888 + unauthorized: msg`You’re not authorized to view this post.`, 3889 + pending: msg`Post pending author approval.`, 3890 + rejected: msg`Quoting not allowed by the author.`, 3891 + revoked: msg`Quoting not allowed by the author.`, 3892 + }; 3893 + 3889 3894 const QuoteStatuses = memo(({ id, instance, level = 0 }) => { 3890 3895 if (!id || !instance) return; 3891 3896 const { _ } = useLingui(); ··· 3899 3904 if (!uniqueQuotes?.length) return; 3900 3905 if (level > 2) return; 3901 3906 3907 + const filterContext = useContext(FilterContext); 3908 + const currentAccount = getCurrentAccID(); 3909 + 3902 3910 return uniqueQuotes.map((q) => { 3903 - if (q.state === 'deleted') 3904 - return ( 3905 - <div class="status-card-unfulfilled"> 3906 - <Icon icon="quote" /> 3907 - <i> 3908 - <Trans>Post removed by author.</Trans> 3909 - </i> 3910 - </div> 3911 + let unfulfilledState; 3912 + 3913 + const quoteStatus = snapStates.statuses[statusKey(q.id, q.instance)]; 3914 + if (quoteStatus) { 3915 + const isSelf = 3916 + currentAccount && currentAccount === quoteStatus.account?.id; 3917 + const filterInfo = 3918 + !isSelf && isFiltered(quoteStatus.filtered, filterContext); 3919 + 3920 + if (filterInfo?.action === 'hide') { 3921 + unfulfilledState = 'filterHidden'; 3922 + } 3923 + } 3924 + 3925 + if (!unfulfilledState) { 3926 + unfulfilledState = handledUnfulfilledStates.find( 3927 + (state) => q.state === state, 3911 3928 ); 3912 - if (q.state === 'unauthorized') 3929 + } 3930 + 3931 + if (unfulfilledState) { 3913 3932 return ( 3914 - <div class="status-card-unfulfilled"> 3933 + <div 3934 + class={`status-card-unfulfilled ${ 3935 + unfulfilledState === 'filterHidden' ? 'status-card-ghost' : '' 3936 + }`} 3937 + > 3915 3938 <Icon icon="quote" /> 3916 - <i> 3917 - <Trans>You’re not authorized to view this post.</Trans> 3918 - </i> 3939 + <i>{_(unfulfilledText[unfulfilledState])}</i> 3919 3940 </div> 3920 3941 ); 3921 - if (q.state === 'pending') 3922 - return ( 3923 - <div class="status-card-unfulfilled"> 3924 - <Icon icon="quote" /> 3925 - <i> 3926 - <Trans>Post pending author approval.</Trans> 3927 - </i> 3928 - </div> 3929 - ); 3930 - if (q.state === 'rejected' || q.state === 'revoked') 3931 - return ( 3932 - <div class="status-card-unfulfilled"> 3933 - <Icon icon="quote" /> 3934 - <i> 3935 - <Trans>Quoting not allowed by the author.</Trans> 3936 - </i> 3937 - </div> 3938 - ); 3942 + } 3943 + 3939 3944 const Parent = q.native ? Fragment : LazyShazam; 3940 3945 return ( 3941 3946 <Parent id={q.instance + q.id} key={q.instance + q.id}> ··· 3951 3956 size="s" 3952 3957 quoted={level + 1} 3953 3958 enableCommentHint 3954 - showFilteredHidden 3955 3959 /> 3956 3960 </Link> 3957 3961 </Parent>
+142 -141
src/locales/en.po
··· 34 34 35 35 #: src/components/account-block.jsx:170 36 36 #: src/components/account-info.jsx:715 37 - #: src/components/status.jsx:601 37 + #: src/components/status.jsx:590 38 38 msgid "Group" 39 39 msgstr "" 40 40 ··· 111 111 #: src/components/compose.jsx:2792 112 112 #: src/components/media-alt-modal.jsx:55 113 113 #: src/components/media-modal.jsx:363 114 - #: src/components/status.jsx:1847 115 - #: src/components/status.jsx:1864 116 - #: src/components/status.jsx:1989 117 - #: src/components/status.jsx:2610 118 - #: src/components/status.jsx:2613 114 + #: src/components/status.jsx:1836 115 + #: src/components/status.jsx:1853 116 + #: src/components/status.jsx:1978 117 + #: src/components/status.jsx:2599 118 + #: src/components/status.jsx:2602 119 119 #: src/pages/account-statuses.jsx:531 120 120 #: src/pages/accounts.jsx:118 121 121 #: src/pages/hashtag.jsx:203 ··· 203 203 msgstr "" 204 204 205 205 #: src/components/account-info.jsx:946 206 - #: src/components/status.jsx:2394 206 + #: src/components/status.jsx:2383 207 207 #: src/pages/catchup.jsx:71 208 208 #: src/pages/catchup.jsx:1448 209 209 #: src/pages/catchup.jsx:2061 ··· 329 329 msgstr "" 330 330 331 331 #: src/components/account-info.jsx:1490 332 - #: src/components/status.jsx:1269 332 + #: src/components/status.jsx:1258 333 333 msgid "Link copied" 334 334 msgstr "" 335 335 336 336 #: src/components/account-info.jsx:1493 337 - #: src/components/status.jsx:1272 337 + #: src/components/status.jsx:1261 338 338 msgid "Unable to copy link" 339 339 msgstr "" 340 340 341 341 #: src/components/account-info.jsx:1499 342 342 #: src/components/shortcuts-settings.jsx:1059 343 - #: src/components/status.jsx:1278 344 - #: src/components/status.jsx:3388 343 + #: src/components/status.jsx:1267 344 + #: src/components/status.jsx:3377 345 345 msgid "Copy" 346 346 msgstr "" 347 347 348 348 #: src/components/account-info.jsx:1514 349 349 #: src/components/shortcuts-settings.jsx:1077 350 - #: src/components/status.jsx:1294 350 + #: src/components/status.jsx:1283 351 351 msgid "Sharing doesn't seem to work." 352 352 msgstr "" 353 353 354 354 #: src/components/account-info.jsx:1520 355 - #: src/components/status.jsx:1300 355 + #: src/components/status.jsx:1289 356 356 msgid "Share…" 357 357 msgstr "" 358 358 ··· 466 466 #: src/components/shortcuts-settings.jsx:230 467 467 #: src/components/shortcuts-settings.jsx:583 468 468 #: src/components/shortcuts-settings.jsx:783 469 - #: src/components/status.jsx:3112 470 - #: src/components/status.jsx:3352 471 - #: src/components/status.jsx:3861 469 + #: src/components/status.jsx:3101 470 + #: src/components/status.jsx:3341 471 + #: src/components/status.jsx:3850 472 472 #: src/pages/accounts.jsx:45 473 473 #: src/pages/catchup.jsx:1584 474 474 #: src/pages/filters.jsx:225 ··· 718 718 msgstr "Attachment #{i} failed" 719 719 720 720 #: src/components/compose.jsx:1221 721 - #: src/components/status.jsx:2177 721 + #: src/components/status.jsx:2166 722 722 #: src/components/timeline.jsx:1023 723 723 msgid "Content warning" 724 724 msgstr "" ··· 754 754 755 755 #: src/components/compose.jsx:1288 756 756 #: src/components/status.jsx:100 757 - #: src/components/status.jsx:2053 757 + #: src/components/status.jsx:2042 758 758 msgid "Private mention" 759 759 msgstr "" 760 760 ··· 791 791 792 792 #: src/components/compose.jsx:1677 793 793 #: src/components/keyboard-shortcuts-help.jsx:155 794 - #: src/components/status.jsx:1041 795 - #: src/components/status.jsx:1827 796 - #: src/components/status.jsx:1828 797 - #: src/components/status.jsx:2514 794 + #: src/components/status.jsx:1030 795 + #: src/components/status.jsx:1816 796 + #: src/components/status.jsx:1817 797 + #: src/components/status.jsx:2503 798 798 msgid "Reply" 799 799 msgstr "" 800 800 ··· 1016 1016 1017 1017 #: src/components/drafts.jsx:128 1018 1018 #: src/components/list-add-edit.jsx:188 1019 - #: src/components/status.jsx:1444 1019 + #: src/components/status.jsx:1433 1020 1020 #: src/pages/filters.jsx:603 1021 1021 #: src/pages/scheduled-posts.jsx:369 1022 1022 msgid "Delete…" ··· 1225 1225 msgstr "" 1226 1226 1227 1227 #: src/components/keyboard-shortcuts-help.jsx:176 1228 - #: src/components/status.jsx:1049 1229 - #: src/components/status.jsx:2541 1230 - #: src/components/status.jsx:2564 1231 - #: src/components/status.jsx:2565 1228 + #: src/components/status.jsx:1038 1229 + #: src/components/status.jsx:2530 1230 + #: src/components/status.jsx:2553 1231 + #: src/components/status.jsx:2554 1232 1232 msgid "Boost" 1233 1233 msgstr "" 1234 1234 ··· 1237 1237 msgstr "" 1238 1238 1239 1239 #: src/components/keyboard-shortcuts-help.jsx:184 1240 - #: src/components/status.jsx:1112 1241 - #: src/components/status.jsx:2589 1242 - #: src/components/status.jsx:2590 1240 + #: src/components/status.jsx:1101 1241 + #: src/components/status.jsx:2578 1242 + #: src/components/status.jsx:2579 1243 1243 msgid "Bookmark" 1244 1244 msgstr "" 1245 1245 ··· 1304 1304 msgstr "" 1305 1305 1306 1306 #: src/components/media-alt-modal.jsx:67 1307 - #: src/components/status.jsx:1155 1308 - #: src/components/status.jsx:1164 1307 + #: src/components/status.jsx:1144 1308 + #: src/components/status.jsx:1153 1309 1309 #: src/components/translation-block.jsx:239 1310 1310 msgid "Translate" 1311 1311 msgstr "" 1312 1312 1313 1313 #: src/components/media-alt-modal.jsx:78 1314 - #: src/components/status.jsx:1183 1314 + #: src/components/status.jsx:1172 1315 1315 msgid "Speak" 1316 1316 msgstr "" 1317 1317 ··· 1348 1348 msgstr "" 1349 1349 1350 1350 #: src/components/media-post.jsx:133 1351 - #: src/components/status.jsx:3691 1352 - #: src/components/status.jsx:3787 1353 - #: src/components/status.jsx:3865 1351 + #: src/components/status.jsx:3680 1352 + #: src/components/status.jsx:3776 1353 + #: src/components/status.jsx:3854 1354 1354 #: src/components/timeline.jsx:1012 1355 1355 #: src/pages/catchup.jsx:75 1356 1356 #: src/pages/catchup.jsx:1880 ··· 1662 1662 msgstr "" 1663 1663 1664 1664 #: src/components/notification.jsx:451 1665 - #: src/components/status.jsx:1126 1666 - #: src/components/status.jsx:1136 1665 + #: src/components/status.jsx:1115 1666 + #: src/components/status.jsx:1125 1667 1667 msgid "Boosted/Liked by…" 1668 1668 msgstr "" 1669 1669 ··· 1993 1993 msgstr "" 1994 1994 1995 1995 #: src/components/shortcuts-settings.jsx:379 1996 - #: src/components/status.jsx:1406 1996 + #: src/components/status.jsx:1395 1997 1997 #: src/pages/list.jsx:195 1998 1998 msgid "Edit" 1999 1999 msgstr "" ··· 2192 2192 msgid "Import/export settings from/to instance server (Very experimental)" 2193 2193 msgstr "" 2194 2194 2195 - #: src/components/status.jsx:508 2196 - msgid "Post hidden by your filters" 2197 - msgstr "Post hidden by your filters" 2198 - 2199 - #: src/components/status.jsx:625 2195 + #: src/components/status.jsx:614 2200 2196 msgid "<0/> <1>boosted</1>" 2201 2197 msgstr "" 2202 2198 2203 - #: src/components/status.jsx:724 2199 + #: src/components/status.jsx:713 2204 2200 msgid "Sorry, your current logged-in instance can't interact with this post from another instance." 2205 2201 msgstr "" 2206 2202 2207 2203 #. placeholder {0}: username || acct 2208 - #: src/components/status.jsx:878 2204 + #: src/components/status.jsx:867 2209 2205 msgid "Unliked @{0}'s post" 2210 2206 msgstr "" 2211 2207 2212 2208 #. placeholder {0}: username || acct 2213 - #: src/components/status.jsx:879 2209 + #: src/components/status.jsx:868 2214 2210 msgid "Liked @{0}'s post" 2215 2211 msgstr "Liked @{0}'s post" 2216 2212 2217 2213 #. placeholder {0}: username || acct 2218 - #: src/components/status.jsx:918 2214 + #: src/components/status.jsx:907 2219 2215 msgid "Unbookmarked @{0}'s post" 2220 2216 msgstr "Unbookmarked @{0}'s post" 2221 2217 2222 2218 #. placeholder {0}: username || acct 2223 - #: src/components/status.jsx:919 2219 + #: src/components/status.jsx:908 2224 2220 msgid "Bookmarked @{0}'s post" 2225 2221 msgstr "Bookmarked @{0}'s post" 2226 2222 2227 - #: src/components/status.jsx:1018 2223 + #: src/components/status.jsx:1007 2228 2224 msgid "Some media have no descriptions." 2229 2225 msgstr "" 2230 2226 2231 2227 #. placeholder {0}: rtf.format(-statusMonthsAgo, 'month') 2232 - #: src/components/status.jsx:1025 2228 + #: src/components/status.jsx:1014 2233 2229 msgid "Old post (<0>{0}</0>)" 2234 2230 msgstr "" 2235 2231 2236 - #: src/components/status.jsx:1049 2237 - #: src/components/status.jsx:1089 2238 - #: src/components/status.jsx:2541 2239 - #: src/components/status.jsx:2564 2232 + #: src/components/status.jsx:1038 2233 + #: src/components/status.jsx:1078 2234 + #: src/components/status.jsx:2530 2235 + #: src/components/status.jsx:2553 2240 2236 msgid "Unboost" 2241 2237 msgstr "" 2242 2238 2243 - #: src/components/status.jsx:1065 2244 - #: src/components/status.jsx:2556 2239 + #: src/components/status.jsx:1054 2240 + #: src/components/status.jsx:2545 2245 2241 msgid "Quote" 2246 2242 msgstr "" 2247 2243 2248 2244 #. placeholder {0}: username || acct 2249 - #: src/components/status.jsx:1077 2250 - #: src/components/status.jsx:1543 2245 + #: src/components/status.jsx:1066 2246 + #: src/components/status.jsx:1532 2251 2247 msgid "Unboosted @{0}'s post" 2252 2248 msgstr "Unboosted @{0}'s post" 2253 2249 2254 2250 #. placeholder {0}: username || acct 2255 - #: src/components/status.jsx:1078 2256 - #: src/components/status.jsx:1544 2251 + #: src/components/status.jsx:1067 2252 + #: src/components/status.jsx:1533 2257 2253 msgid "Boosted @{0}'s post" 2258 2254 msgstr "Boosted @{0}'s post" 2259 2255 2260 - #: src/components/status.jsx:1090 2256 + #: src/components/status.jsx:1079 2261 2257 msgid "Boost…" 2262 2258 msgstr "" 2263 2259 2264 - #: src/components/status.jsx:1102 2265 - #: src/components/status.jsx:1837 2266 - #: src/components/status.jsx:2577 2260 + #: src/components/status.jsx:1091 2261 + #: src/components/status.jsx:1826 2262 + #: src/components/status.jsx:2566 2267 2263 msgid "Unlike" 2268 2264 msgstr "" 2269 2265 2270 - #: src/components/status.jsx:1103 2271 - #: src/components/status.jsx:1837 2272 - #: src/components/status.jsx:1838 2273 - #: src/components/status.jsx:2577 2274 - #: src/components/status.jsx:2578 2266 + #: src/components/status.jsx:1092 2267 + #: src/components/status.jsx:1826 2268 + #: src/components/status.jsx:1827 2269 + #: src/components/status.jsx:2566 2270 + #: src/components/status.jsx:2567 2275 2271 msgid "Like" 2276 2272 msgstr "" 2277 2273 2278 - #: src/components/status.jsx:1112 2279 - #: src/components/status.jsx:2589 2274 + #: src/components/status.jsx:1101 2275 + #: src/components/status.jsx:2578 2280 2276 msgid "Unbookmark" 2281 2277 msgstr "" 2282 2278 2283 - #: src/components/status.jsx:1195 2279 + #: src/components/status.jsx:1184 2284 2280 msgid "Post text copied" 2285 2281 msgstr "Post text copied" 2286 2282 2287 - #: src/components/status.jsx:1198 2283 + #: src/components/status.jsx:1187 2288 2284 msgid "Unable to copy post text" 2289 2285 msgstr "Unable to copy post text" 2290 2286 2291 - #: src/components/status.jsx:1204 2287 + #: src/components/status.jsx:1193 2292 2288 msgid "Copy post text" 2293 2289 msgstr "Copy post text" 2294 2290 2295 2291 #. placeholder {0}: username || acct 2296 - #: src/components/status.jsx:1222 2292 + #: src/components/status.jsx:1211 2297 2293 msgid "View post by <0>@{0}</0>" 2298 2294 msgstr "" 2299 2295 2300 - #: src/components/status.jsx:1243 2296 + #: src/components/status.jsx:1232 2301 2297 msgid "Show Edit History" 2302 2298 msgstr "" 2303 2299 2304 - #: src/components/status.jsx:1246 2300 + #: src/components/status.jsx:1235 2305 2301 msgid "Edited: {editedDateText}" 2306 2302 msgstr "" 2307 2303 2308 - #: src/components/status.jsx:1313 2309 - #: src/components/status.jsx:3357 2304 + #: src/components/status.jsx:1302 2305 + #: src/components/status.jsx:3346 2310 2306 msgid "Embed post" 2311 2307 msgstr "" 2312 2308 2313 - #: src/components/status.jsx:1327 2309 + #: src/components/status.jsx:1316 2314 2310 msgid "Conversation unmuted" 2315 2311 msgstr "" 2316 2312 2317 - #: src/components/status.jsx:1327 2313 + #: src/components/status.jsx:1316 2318 2314 msgid "Conversation muted" 2319 2315 msgstr "" 2320 2316 2321 - #: src/components/status.jsx:1333 2317 + #: src/components/status.jsx:1322 2322 2318 msgid "Unable to unmute conversation" 2323 2319 msgstr "" 2324 2320 2325 - #: src/components/status.jsx:1334 2321 + #: src/components/status.jsx:1323 2326 2322 msgid "Unable to mute conversation" 2327 2323 msgstr "" 2328 2324 2329 - #: src/components/status.jsx:1343 2325 + #: src/components/status.jsx:1332 2330 2326 msgid "Unmute conversation" 2331 2327 msgstr "" 2332 2328 2333 - #: src/components/status.jsx:1350 2329 + #: src/components/status.jsx:1339 2334 2330 msgid "Mute conversation" 2335 2331 msgstr "" 2336 2332 2337 - #: src/components/status.jsx:1366 2333 + #: src/components/status.jsx:1355 2338 2334 msgid "Post unpinned from profile" 2339 2335 msgstr "" 2340 2336 2341 - #: src/components/status.jsx:1367 2337 + #: src/components/status.jsx:1356 2342 2338 msgid "Post pinned to profile" 2343 2339 msgstr "" 2344 2340 2345 - #: src/components/status.jsx:1372 2341 + #: src/components/status.jsx:1361 2346 2342 msgid "Unable to unpin post" 2347 2343 msgstr "" 2348 2344 2349 - #: src/components/status.jsx:1372 2345 + #: src/components/status.jsx:1361 2350 2346 msgid "Unable to pin post" 2351 2347 msgstr "" 2352 2348 2353 - #: src/components/status.jsx:1381 2349 + #: src/components/status.jsx:1370 2354 2350 msgid "Unpin from profile" 2355 2351 msgstr "" 2356 2352 2357 - #: src/components/status.jsx:1388 2353 + #: src/components/status.jsx:1377 2358 2354 msgid "Pin to profile" 2359 2355 msgstr "" 2360 2356 2361 - #: src/components/status.jsx:1417 2357 + #: src/components/status.jsx:1406 2362 2358 msgid "Delete this post?" 2363 2359 msgstr "" 2364 2360 2365 - #: src/components/status.jsx:1433 2361 + #: src/components/status.jsx:1422 2366 2362 msgid "Post deleted" 2367 2363 msgstr "" 2368 2364 2369 - #: src/components/status.jsx:1436 2365 + #: src/components/status.jsx:1425 2370 2366 msgid "Unable to delete post" 2371 2367 msgstr "" 2372 2368 2373 - #: src/components/status.jsx:1464 2369 + #: src/components/status.jsx:1453 2374 2370 msgid "Report post…" 2375 2371 msgstr "" 2376 2372 2377 - #: src/components/status.jsx:1838 2378 - #: src/components/status.jsx:1874 2379 - #: src/components/status.jsx:2578 2373 + #: src/components/status.jsx:1827 2374 + #: src/components/status.jsx:1863 2375 + #: src/components/status.jsx:2567 2380 2376 msgid "Liked" 2381 2377 msgstr "" 2382 2378 2383 - #: src/components/status.jsx:1871 2384 - #: src/components/status.jsx:2565 2379 + #: src/components/status.jsx:1860 2380 + #: src/components/status.jsx:2554 2385 2381 msgid "Boosted" 2386 2382 msgstr "" 2387 2383 2388 - #: src/components/status.jsx:1881 2389 - #: src/components/status.jsx:2590 2384 + #: src/components/status.jsx:1870 2385 + #: src/components/status.jsx:2579 2390 2386 msgid "Bookmarked" 2391 2387 msgstr "" 2392 2388 2393 - #: src/components/status.jsx:1885 2389 + #: src/components/status.jsx:1874 2394 2390 msgid "Pinned" 2395 2391 msgstr "" 2396 2392 2397 - #: src/components/status.jsx:1931 2398 - #: src/components/status.jsx:2402 2393 + #: src/components/status.jsx:1920 2394 + #: src/components/status.jsx:2391 2399 2395 msgid "Deleted" 2400 2396 msgstr "" 2401 2397 2402 - #: src/components/status.jsx:1972 2398 + #: src/components/status.jsx:1961 2403 2399 msgid "{repliesCount, plural, one {# reply} other {# replies}}" 2404 2400 msgstr "" 2405 2401 2406 2402 #. placeholder {0}: snapStates.statusThreadNumber[sKey] ? ` ${snapStates.statusThreadNumber[sKey]}/X` : '' 2407 - #: src/components/status.jsx:2062 2403 + #: src/components/status.jsx:2051 2408 2404 msgid "Thread{0}" 2409 2405 msgstr "" 2410 2406 2411 - #: src/components/status.jsx:2140 2412 - #: src/components/status.jsx:2202 2413 - #: src/components/status.jsx:2298 2407 + #: src/components/status.jsx:2129 2408 + #: src/components/status.jsx:2191 2409 + #: src/components/status.jsx:2287 2414 2410 msgid "Show less" 2415 2411 msgstr "" 2416 2412 2417 - #: src/components/status.jsx:2140 2418 - #: src/components/status.jsx:2202 2413 + #: src/components/status.jsx:2129 2414 + #: src/components/status.jsx:2191 2419 2415 msgid "Show content" 2420 2416 msgstr "" 2421 2417 2422 2418 #. placeholder {0}: filterInfo.titlesStr 2423 2419 #. placeholder {0}: filterInfo?.titlesStr 2424 - #: src/components/status.jsx:2294 2420 + #: src/components/status.jsx:2283 2425 2421 #: src/pages/catchup.jsx:1879 2426 2422 msgid "Filtered: {0}" 2427 2423 msgstr "Filtered: {0}" 2428 2424 2429 - #: src/components/status.jsx:2298 2425 + #: src/components/status.jsx:2287 2430 2426 msgid "Show media" 2431 2427 msgstr "" 2432 2428 2433 - #: src/components/status.jsx:2438 2429 + #: src/components/status.jsx:2427 2434 2430 msgid "Edited" 2435 2431 msgstr "" 2436 2432 2437 - #: src/components/status.jsx:2515 2433 + #: src/components/status.jsx:2504 2438 2434 msgid "Comments" 2439 2435 msgstr "" 2440 2436 2441 2437 #. More from [Author] 2442 - #: src/components/status.jsx:2815 2438 + #: src/components/status.jsx:2804 2443 2439 msgid "More from <0/>" 2444 2440 msgstr "More from <0/>" 2445 2441 2446 - #: src/components/status.jsx:3117 2442 + #: src/components/status.jsx:3106 2447 2443 msgid "Edit History" 2448 2444 msgstr "" 2449 2445 2450 - #: src/components/status.jsx:3121 2446 + #: src/components/status.jsx:3110 2451 2447 msgid "Failed to load history" 2452 2448 msgstr "" 2453 2449 2454 - #: src/components/status.jsx:3126 2450 + #: src/components/status.jsx:3115 2455 2451 #: src/pages/annual-report.jsx:45 2456 2452 msgid "Loading…" 2457 2453 msgstr "" 2458 2454 2459 - #: src/components/status.jsx:3362 2455 + #: src/components/status.jsx:3351 2460 2456 msgid "HTML Code" 2461 2457 msgstr "" 2462 2458 2463 - #: src/components/status.jsx:3379 2459 + #: src/components/status.jsx:3368 2464 2460 msgid "HTML code copied" 2465 2461 msgstr "" 2466 2462 2467 - #: src/components/status.jsx:3382 2463 + #: src/components/status.jsx:3371 2468 2464 msgid "Unable to copy HTML code" 2469 2465 msgstr "" 2470 2466 2471 - #: src/components/status.jsx:3394 2467 + #: src/components/status.jsx:3383 2472 2468 msgid "Media attachments:" 2473 2469 msgstr "" 2474 2470 2475 - #: src/components/status.jsx:3416 2471 + #: src/components/status.jsx:3405 2476 2472 msgid "Account Emojis:" 2477 2473 msgstr "" 2478 2474 2479 - #: src/components/status.jsx:3447 2480 - #: src/components/status.jsx:3492 2475 + #: src/components/status.jsx:3436 2476 + #: src/components/status.jsx:3481 2481 2477 msgid "static URL" 2482 2478 msgstr "" 2483 2479 2484 - #: src/components/status.jsx:3461 2480 + #: src/components/status.jsx:3450 2485 2481 msgid "Emojis:" 2486 2482 msgstr "" 2487 2483 2488 - #: src/components/status.jsx:3506 2484 + #: src/components/status.jsx:3495 2489 2485 msgid "Notes:" 2490 2486 msgstr "" 2491 2487 2492 - #: src/components/status.jsx:3510 2488 + #: src/components/status.jsx:3499 2493 2489 msgid "This is static, unstyled and scriptless. You may need to apply your own styles and edit as needed." 2494 2490 msgstr "" 2495 2491 2496 - #: src/components/status.jsx:3516 2492 + #: src/components/status.jsx:3505 2497 2493 msgid "Polls are not interactive, becomes a list with vote counts." 2498 2494 msgstr "" 2499 2495 2500 - #: src/components/status.jsx:3521 2496 + #: src/components/status.jsx:3510 2501 2497 msgid "Media attachments can be images, videos, audios or any file types." 2502 2498 msgstr "" 2503 2499 2504 - #: src/components/status.jsx:3527 2500 + #: src/components/status.jsx:3516 2505 2501 msgid "Post could be edited or deleted later." 2506 2502 msgstr "" 2507 2503 2508 - #: src/components/status.jsx:3533 2504 + #: src/components/status.jsx:3522 2509 2505 msgid "Preview" 2510 2506 msgstr "" 2511 2507 2512 - #: src/components/status.jsx:3542 2508 + #: src/components/status.jsx:3531 2513 2509 msgid "Note: This preview is lightly styled." 2514 2510 msgstr "" 2515 2511 2516 2512 #. [Name] [Visibility icon] boosted 2517 - #: src/components/status.jsx:3795 2513 + #: src/components/status.jsx:3784 2518 2514 msgid "<0/> <1/> boosted" 2519 2515 msgstr "" 2520 2516 2521 - #: src/components/status.jsx:3908 2517 + #: src/components/status.jsx:3886 2518 + msgid "Post hidden by your filters" 2519 + msgstr "Post hidden by your filters" 2520 + 2521 + #: src/components/status.jsx:3887 2522 2522 msgid "Post removed by author." 2523 2523 msgstr "Post removed by author." 2524 2524 2525 - #: src/components/status.jsx:3917 2525 + #: src/components/status.jsx:3888 2526 2526 msgid "You’re not authorized to view this post." 2527 2527 msgstr "You’re not authorized to view this post." 2528 2528 2529 - #: src/components/status.jsx:3926 2529 + #: src/components/status.jsx:3889 2530 2530 msgid "Post pending author approval." 2531 2531 msgstr "Post pending author approval." 2532 2532 2533 - #: src/components/status.jsx:3935 2533 + #: src/components/status.jsx:3890 2534 + #: src/components/status.jsx:3891 2534 2535 msgid "Quoting not allowed by the author." 2535 2536 msgstr "Quoting not allowed by the author." 2536 2537
+236 -130
src/pages/sandbox.jsx
··· 311 311 showQuotes: false, 312 312 quotesCount: '1', 313 313 quoteNestingLevel: '0', 314 + quoteState: 'accepted', // State for all quote posts 314 315 size: 'medium', 315 316 filters: [false, false, false], // hide, blur, warn 316 317 quoteFilters: [false, false, false], // hide, blur, warn for quotes ··· 398 399 showQuotes: toggleState.showQuotes, 399 400 quotesCount: toggleState.quotesCount, 400 401 quoteNestingLevel: toggleState.quoteNestingLevel, 402 + quoteState: toggleState.quoteState, 401 403 size: toggleState.size, 402 404 filters: toggleState.filters, 403 405 quoteFilters: toggleState.quoteFilters, ··· 528 530 id: quoteId, 529 531 instance: DEFAULT_INSTANCE, 530 532 url: `https://example.social/s/${quoteId}`, // Include URL to ensure uniqueness check works 533 + state: 534 + toggleState.quoteState === 'accepted' 535 + ? undefined 536 + : toggleState.quoteState, // Only set state if not accepted 531 537 }; 532 538 533 539 // First, delete any existing status with this ID to avoid duplicates 534 - delete states.statuses[quoteId]; 540 + const quoteStatusKey = statusKey(quoteId, DEFAULT_INSTANCE); 541 + delete states.statuses[quoteStatusKey]; 535 542 536 - // Create the actual status object that will be retrieved by QuoteStatuses 537 - const quoteStatus = { 538 - id: quoteId, 539 - content: `<p>This is quote post ${i + 1}${i % 2 === 0 ? '' : ' with some extra text'}</p>`, 540 - account: { 541 - id: `quote-account-${i}`, 542 - username: `quote${i}`, 543 - name: `Quote User ${i}`, 544 - avatar: '/logo-192.png', 545 - acct: `quote${i}@example.social`, 546 - url: `https://example.social/@quote${i}`, 547 - }, 548 - visibility: 'public', 549 - createdAt: new Date(Date.now() - i * 3600000).toISOString(), // Each post 1 hour older 550 - emojis: [], 551 - // First quote post should be plain (no media, no poll) 552 - mediaAttachments: 553 - i > 0 && i % 2 === 0 554 - ? [ 555 - { 556 - // Only non-first posts can have media (every 3rd post after the 1st) 557 - id: `quote-media-${i}`, 558 - type: 'image', 559 - url: `https://picsum.photos/seed/quote-${i}/600/400`, 560 - previewUrl: `https://picsum.photos/seed/quote-${i}/300/200`, 561 - meta: { 562 - original: { width: 600, height: 400 }, 563 - small: { width: 300, height: 200 }, 564 - }, 565 - }, 566 - ] 567 - : [], 568 - poll: 569 - i > 0 && i % 3 === 0 570 - ? { 571 - // Only non-first posts can have polls (every 4th post after the 1st) 572 - id: `quote-poll-${i}`, 573 - options: [ 574 - { 575 - title: 'Option A', 576 - votesCount: Math.floor(Math.random() * 50), 577 - }, 578 - { 579 - title: 'Option B', 580 - votesCount: Math.floor(Math.random() * 50), 581 - }, 582 - ], 583 - expiresAt: new Date( 584 - Date.now() + 24 * 60 * 60 * 1000, 585 - ).toISOString(), 586 - multiple: false, 587 - votesCount: Math.floor(Math.random() * 100), 588 - } 589 - : null, 590 - }; 591 - 592 - // Add filtering to quote posts if enabled 593 - if ( 594 - toggleState.quoteFilters && 595 - toggleState.quoteFilters.some((f) => f) 596 - ) { 597 - quoteStatus.filtered = toggleState.quoteFilters 598 - .map((enabled, filterIndex) => { 599 - if (!enabled) return null; 600 - const filterTypes = ['hide', 'blur', 'warn']; 601 - return { 602 - filter: { 603 - id: `quote-filter-${i}-${filterIndex}`, 604 - title: `Quote ${filterTypes[filterIndex]} filter`, 605 - context: ['home', 'public', 'thread', 'account'], 606 - filterAction: filterTypes[filterIndex], 607 - }, 608 - keywordMatches: [], 609 - statusMatches: [], 610 - }; 611 - }) 612 - .filter(Boolean); 613 - } 614 - 615 - // Assign the quote status to the states 616 - states.statuses[quoteId] = quoteStatus; 617 - 618 - // If nesting level > 0, add nested quotes to each quote post 619 - if (nestingLevel > 0 && i % 2 === 0) { 620 - // Add nested quotes to every other quote - use stable ID 621 - const nestedQuoteId = `nested-quote-${i}-12345`; 622 - 623 - // Add the nested quote post to states.statuses 624 - states.statuses[nestedQuoteId] = { 625 - id: nestedQuoteId, 626 - content: `<p>This is a nested quote inside quote ${i + 1}</p>`, 543 + // Create the actual status object for all quote states 544 + // This allows filtering logic to run even for non-accepted states 545 + { 546 + // Create the actual status object that will be retrieved by QuoteStatuses 547 + const quoteStatus = { 548 + id: quoteId, 549 + content: `<p>This is quote post ${i + 1}${i % 2 === 0 ? '' : ' with some extra text'}</p>`, 627 550 account: { 628 - id: `nested-account-${i}`, 629 - username: `nested${i}`, 630 - name: `Nested User ${i}`, 551 + id: `quote-account-${i}`, 552 + username: `quote${i}`, 553 + name: `Quote User ${i}`, 631 554 avatar: '/logo-192.png', 632 - acct: `nested${i}@example.social`, 633 - url: `https://example.social/@nested${i}`, 555 + acct: `quote${i}@example.social`, 556 + url: `https://example.social/@quote${i}`, 634 557 }, 635 558 visibility: 'public', 636 - createdAt: new Date(Date.now() - (i + 1) * 3600000).toISOString(), 559 + createdAt: new Date(Date.now() - i * 3600000).toISOString(), // Each post 1 hour older 637 560 emojis: [], 638 - mediaAttachments: [], // No media in nested quotes for simplicity 561 + // First quote post should be plain (no media, no poll) 562 + mediaAttachments: 563 + i > 0 && i % 2 === 0 564 + ? [ 565 + { 566 + // Only non-first posts can have media (every 3rd post after the 1st) 567 + id: `quote-media-${i}`, 568 + type: 'image', 569 + url: `https://picsum.photos/seed/quote-${i}/600/400`, 570 + previewUrl: `https://picsum.photos/seed/quote-${i}/300/200`, 571 + meta: { 572 + original: { width: 600, height: 400 }, 573 + small: { width: 300, height: 200 }, 574 + }, 575 + }, 576 + ] 577 + : [], 578 + poll: 579 + i > 0 && i % 3 === 0 580 + ? { 581 + // Only non-first posts can have polls (every 4th post after the 1st) 582 + id: `quote-poll-${i}`, 583 + options: [ 584 + { 585 + title: 'Option A', 586 + votesCount: Math.floor(Math.random() * 50), 587 + }, 588 + { 589 + title: 'Option B', 590 + votesCount: Math.floor(Math.random() * 50), 591 + }, 592 + ], 593 + expiresAt: new Date( 594 + Date.now() + 24 * 60 * 60 * 1000, 595 + ).toISOString(), 596 + multiple: false, 597 + votesCount: Math.floor(Math.random() * 100), 598 + } 599 + : null, 639 600 }; 640 601 641 - // Create reference object for nested quote - critical for proper rendering 642 - const nestedQuoteRef = { 643 - id: nestedQuoteId, 644 - instance: DEFAULT_INSTANCE, 645 - url: `https://example.social/s/${nestedQuoteId}`, 646 - }; 602 + // Add filtering to quote posts if enabled 603 + if ( 604 + toggleState.quoteFilters && 605 + toggleState.quoteFilters.some((f) => f) 606 + ) { 607 + quoteStatus.filtered = toggleState.quoteFilters 608 + .map((enabled, filterIndex) => { 609 + if (!enabled) return null; 610 + const filterTypes = ['hide', 'blur', 'warn']; 611 + return { 612 + filter: { 613 + id: `quote-filter-${i}-${filterIndex}`, 614 + title: `Quote ${filterTypes[filterIndex]} filter`, 615 + context: ['home', 'public', 'thread', 'account'], 616 + filterAction: filterTypes[filterIndex], 617 + }, 618 + keywordMatches: [], 619 + statusMatches: [], 620 + }; 621 + }) 622 + .filter(Boolean); 623 + } 647 624 648 - // Add another level of nesting if specified 649 - if (nestingLevel > 1 && i === 0) { 650 - // Only add deepest nesting to first quote 651 - const deepNestedId = `deep-nested-${i}-12345`; 625 + // Assign the quote status to the states using the correct key format 626 + states.statuses[quoteStatusKey] = quoteStatus; 627 + 628 + // If nesting level > 0, add nested quotes to each quote post 629 + if (nestingLevel > 0 && i % 2 === 0) { 630 + // Add nested quotes to every other quote - use stable ID 631 + const nestedQuoteId = `nested-quote-${i}-12345`; 652 632 653 - states.statuses[deepNestedId] = { 654 - id: deepNestedId, 655 - content: `<p>This is a deeply nested quote (level 2)</p>`, 633 + // Add the nested quote post to states.statuses 634 + states.statuses[nestedQuoteId] = { 635 + id: nestedQuoteId, 636 + content: `<p>This is a nested quote inside quote ${i + 1}</p>`, 656 637 account: { 657 - id: `deep-account-${i}`, 658 - username: `deep${i}`, 659 - name: `Deep User ${i}`, 638 + id: `nested-account-${i}`, 639 + username: `nested${i}`, 640 + name: `Nested User ${i}`, 660 641 avatar: '/logo-192.png', 661 - acct: `deep${i}@example.social`, 662 - url: `https://example.social/@deep${i}`, 642 + acct: `nested${i}@example.social`, 643 + url: `https://example.social/@nested${i}`, 663 644 }, 664 645 visibility: 'public', 665 646 createdAt: new Date( 666 - Date.now() - (i + 2) * 3600000, 647 + Date.now() - (i + 1) * 3600000, 667 648 ).toISOString(), 668 649 emojis: [], 650 + mediaAttachments: [], // No media in nested quotes for simplicity 669 651 }; 670 652 671 - // Create deep nested reference 672 - const deepNestedRef = { 673 - id: deepNestedId, 653 + // Create reference object for nested quote - critical for proper rendering 654 + const nestedQuoteRef = { 655 + id: nestedQuoteId, 674 656 instance: DEFAULT_INSTANCE, 675 - url: `https://example.social/s/${deepNestedId}`, 657 + url: `https://example.social/s/${nestedQuoteId}`, 676 658 }; 677 659 678 - // Important: Use the proper key format for the nested quote 679 - const nestedKey = statusKey(nestedQuoteId, DEFAULT_INSTANCE); 680 - states.statusQuotes[nestedKey] = [deepNestedRef]; 681 - } 660 + // Add another level of nesting if specified 661 + if (nestingLevel > 1 && i === 0) { 662 + // Only add deepest nesting to first quote 663 + const deepNestedId = `deep-nested-${i}-12345`; 682 664 683 - // Add nested quote to the quote's quotes using the proper key format 684 - const quoteKey = statusKey(quoteId, DEFAULT_INSTANCE); 685 - states.statusQuotes[quoteKey] = [nestedQuoteRef]; 686 - } 665 + states.statuses[deepNestedId] = { 666 + id: deepNestedId, 667 + content: `<p>This is a deeply nested quote (level 2)</p>`, 668 + account: { 669 + id: `deep-account-${i}`, 670 + username: `deep${i}`, 671 + name: `Deep User ${i}`, 672 + avatar: '/logo-192.png', 673 + acct: `deep${i}@example.social`, 674 + url: `https://example.social/@deep${i}`, 675 + }, 676 + visibility: 'public', 677 + createdAt: new Date( 678 + Date.now() - (i + 2) * 3600000, 679 + ).toISOString(), 680 + emojis: [], 681 + }; 682 + 683 + // Create deep nested reference 684 + const deepNestedRef = { 685 + id: deepNestedId, 686 + instance: DEFAULT_INSTANCE, 687 + url: `https://example.social/s/${deepNestedId}`, 688 + }; 689 + 690 + // Important: Use the proper key format for the nested quote 691 + const nestedKey = statusKey(nestedQuoteId, DEFAULT_INSTANCE); 692 + states.statusQuotes[nestedKey] = [deepNestedRef]; 693 + } 694 + 695 + // Add nested quote to the quote's quotes using the proper key format 696 + const quoteKey = statusKey(quoteId, DEFAULT_INSTANCE); 697 + states.statusQuotes[quoteKey] = [nestedQuoteRef]; 698 + } 699 + } // Close the quote status creation block 687 700 688 701 return quoteRef; 689 702 }); ··· 699 712 toggleState.showQuotes, 700 713 toggleState.quotesCount, 701 714 toggleState.quoteNestingLevel, 715 + toggleState.quoteState, 702 716 toggleState.quoteFilters, 703 717 ]); 704 718 ··· 1250 1264 }} 1251 1265 /> 1252 1266 </label> 1267 + </li> 1268 + 1269 + <li> 1270 + <span>Quote state</span> 1271 + <ul> 1272 + <li> 1273 + <label> 1274 + <input 1275 + type="radio" 1276 + name="quoteState" 1277 + value="accepted" 1278 + checked={toggleState.quoteState === 'accepted'} 1279 + onChange={(e) => { 1280 + updateToggles({ quoteState: e.target.value }); 1281 + }} 1282 + /> 1283 + <span>Accepted</span> 1284 + </label> 1285 + </li> 1286 + <li> 1287 + <label> 1288 + <input 1289 + type="radio" 1290 + name="quoteState" 1291 + value="deleted" 1292 + checked={toggleState.quoteState === 'deleted'} 1293 + onChange={(e) => { 1294 + updateToggles({ quoteState: e.target.value }); 1295 + }} 1296 + /> 1297 + <span>Deleted</span> 1298 + </label> 1299 + </li> 1300 + <li> 1301 + <label> 1302 + <input 1303 + type="radio" 1304 + name="quoteState" 1305 + value="unauthorized" 1306 + checked={ 1307 + toggleState.quoteState === 'unauthorized' 1308 + } 1309 + onChange={(e) => { 1310 + updateToggles({ quoteState: e.target.value }); 1311 + }} 1312 + /> 1313 + <span>Unauthorized</span> 1314 + </label> 1315 + </li> 1316 + <li> 1317 + <label> 1318 + <input 1319 + type="radio" 1320 + name="quoteState" 1321 + value="pending" 1322 + checked={toggleState.quoteState === 'pending'} 1323 + onChange={(e) => { 1324 + updateToggles({ quoteState: e.target.value }); 1325 + }} 1326 + /> 1327 + <span>Pending</span> 1328 + </label> 1329 + </li> 1330 + <li> 1331 + <label> 1332 + <input 1333 + type="radio" 1334 + name="quoteState" 1335 + value="rejected" 1336 + checked={toggleState.quoteState === 'rejected'} 1337 + onChange={(e) => { 1338 + updateToggles({ quoteState: e.target.value }); 1339 + }} 1340 + /> 1341 + <span>Rejected</span> 1342 + </label> 1343 + </li> 1344 + <li> 1345 + <label> 1346 + <input 1347 + type="radio" 1348 + name="quoteState" 1349 + value="revoked" 1350 + checked={toggleState.quoteState === 'revoked'} 1351 + onChange={(e) => { 1352 + updateToggles({ quoteState: e.target.value }); 1353 + }} 1354 + /> 1355 + <span>Revoked</span> 1356 + </label> 1357 + </li> 1358 + </ul> 1253 1359 </li> 1254 1360 <li> 1255 1361 <b>Quote Filters</b>