Unhide hidden-filtered quote posts

pull/1214/head
Lim Chee Aun 2025-07-10 18:33:24 +08:00
rodzic da9a5e3dae
commit 821060c238
4 zmienionych plików z 230 dodań i 138 usunięć

Wyświetl plik

@ -280,6 +280,10 @@
.icon {
color: var(--text-insignificant-color);
}
&.status-card-ghost {
border-style: dashed;
}
}
@keyframes skeleton-breathe {

Wyświetl plik

@ -378,6 +378,7 @@ function Status({
showActionsBar,
showReplyParent,
mediaFirst,
showFilteredHidden,
}) {
const { _, t, i18n } = useLingui();
const rtf = RTF(i18n.locale);
@ -499,6 +500,16 @@ function Status({
isFiltered(filtered, filterContext);
if (filterInfo?.action === 'hide') {
if (showFilteredHidden) {
return (
<div class="status-card-unfulfilled status-card-ghost">
<Icon icon="quote" />
<i>
<Trans>Post hidden by your filters</Trans>
</i>
</div>
);
}
return null;
}
@ -3940,6 +3951,7 @@ const QuoteStatuses = memo(({ id, instance, level = 0 }) => {
size="s"
quoted={level + 1}
enableCommentHint
showFilteredHidden
/>
</Link>
</Parent>

278
src/locales/en.po wygenerowano
Wyświetl plik

@ -34,7 +34,7 @@ msgstr ""
#: src/components/account-block.jsx:170
#: src/components/account-info.jsx:715
#: src/components/status.jsx:590
#: src/components/status.jsx:601
msgid "Group"
msgstr ""
@ -111,11 +111,11 @@ msgstr ""
#: src/components/compose.jsx:2792
#: src/components/media-alt-modal.jsx:55
#: src/components/media-modal.jsx:363
#: src/components/status.jsx:1836
#: src/components/status.jsx:1853
#: src/components/status.jsx:1978
#: src/components/status.jsx:2599
#: src/components/status.jsx:2602
#: src/components/status.jsx:1847
#: src/components/status.jsx:1864
#: src/components/status.jsx:1989
#: src/components/status.jsx:2610
#: src/components/status.jsx:2613
#: src/pages/account-statuses.jsx:531
#: src/pages/accounts.jsx:118
#: src/pages/hashtag.jsx:203
@ -203,7 +203,7 @@ msgid "Original"
msgstr ""
#: src/components/account-info.jsx:946
#: src/components/status.jsx:2383
#: src/components/status.jsx:2394
#: src/pages/catchup.jsx:71
#: src/pages/catchup.jsx:1448
#: src/pages/catchup.jsx:2061
@ -329,30 +329,30 @@ msgid "Add/Remove from Lists"
msgstr ""
#: src/components/account-info.jsx:1490
#: src/components/status.jsx:1258
#: src/components/status.jsx:1269
msgid "Link copied"
msgstr ""
#: src/components/account-info.jsx:1493
#: src/components/status.jsx:1261
#: src/components/status.jsx:1272
msgid "Unable to copy link"
msgstr ""
#: src/components/account-info.jsx:1499
#: src/components/shortcuts-settings.jsx:1059
#: src/components/status.jsx:1267
#: src/components/status.jsx:3377
#: src/components/status.jsx:1278
#: src/components/status.jsx:3388
msgid "Copy"
msgstr ""
#: src/components/account-info.jsx:1514
#: src/components/shortcuts-settings.jsx:1077
#: src/components/status.jsx:1283
#: src/components/status.jsx:1294
msgid "Sharing doesn't seem to work."
msgstr ""
#: src/components/account-info.jsx:1520
#: src/components/status.jsx:1289
#: src/components/status.jsx:1300
msgid "Share…"
msgstr ""
@ -466,9 +466,9 @@ msgstr ""
#: src/components/shortcuts-settings.jsx:230
#: src/components/shortcuts-settings.jsx:583
#: src/components/shortcuts-settings.jsx:783
#: src/components/status.jsx:3101
#: src/components/status.jsx:3341
#: src/components/status.jsx:3850
#: src/components/status.jsx:3112
#: src/components/status.jsx:3352
#: src/components/status.jsx:3861
#: src/pages/accounts.jsx:45
#: src/pages/catchup.jsx:1584
#: src/pages/filters.jsx:225
@ -718,7 +718,7 @@ msgid "Attachment #{i} failed"
msgstr "Attachment #{i} failed"
#: src/components/compose.jsx:1221
#: src/components/status.jsx:2166
#: src/components/status.jsx:2177
#: src/components/timeline.jsx:1023
msgid "Content warning"
msgstr ""
@ -754,7 +754,7 @@ msgstr ""
#: src/components/compose.jsx:1288
#: src/components/status.jsx:100
#: src/components/status.jsx:2042
#: src/components/status.jsx:2053
msgid "Private mention"
msgstr ""
@ -791,10 +791,10 @@ msgstr "Schedule"
#: src/components/compose.jsx:1677
#: src/components/keyboard-shortcuts-help.jsx:155
#: src/components/status.jsx:1030
#: src/components/status.jsx:1816
#: src/components/status.jsx:1817
#: src/components/status.jsx:2503
#: src/components/status.jsx:1041
#: src/components/status.jsx:1827
#: src/components/status.jsx:1828
#: src/components/status.jsx:2514
msgid "Reply"
msgstr ""
@ -1016,7 +1016,7 @@ msgstr ""
#: src/components/drafts.jsx:128
#: src/components/list-add-edit.jsx:188
#: src/components/status.jsx:1433
#: src/components/status.jsx:1444
#: src/pages/filters.jsx:603
#: src/pages/scheduled-posts.jsx:369
msgid "Delete…"
@ -1225,10 +1225,10 @@ msgid "<0>l</0> or <1>f</1>"
msgstr ""
#: src/components/keyboard-shortcuts-help.jsx:176
#: src/components/status.jsx:1038
#: src/components/status.jsx:2530
#: src/components/status.jsx:2553
#: src/components/status.jsx:2554
#: src/components/status.jsx:1049
#: src/components/status.jsx:2541
#: src/components/status.jsx:2564
#: src/components/status.jsx:2565
msgid "Boost"
msgstr ""
@ -1237,9 +1237,9 @@ msgid "<0>Shift</0> + <1>b</1>"
msgstr ""
#: src/components/keyboard-shortcuts-help.jsx:184
#: src/components/status.jsx:1101
#: src/components/status.jsx:2578
#: src/components/status.jsx:2579
#: src/components/status.jsx:1112
#: src/components/status.jsx:2589
#: src/components/status.jsx:2590
msgid "Bookmark"
msgstr ""
@ -1304,14 +1304,14 @@ msgid "Media description"
msgstr ""
#: src/components/media-alt-modal.jsx:67
#: src/components/status.jsx:1144
#: src/components/status.jsx:1153
#: src/components/status.jsx:1155
#: src/components/status.jsx:1164
#: src/components/translation-block.jsx:239
msgid "Translate"
msgstr ""
#: src/components/media-alt-modal.jsx:78
#: src/components/status.jsx:1172
#: src/components/status.jsx:1183
msgid "Speak"
msgstr ""
@ -1348,9 +1348,9 @@ msgid "Filtered: {filterTitleStr}"
msgstr ""
#: src/components/media-post.jsx:133
#: src/components/status.jsx:3680
#: src/components/status.jsx:3776
#: src/components/status.jsx:3854
#: src/components/status.jsx:3691
#: src/components/status.jsx:3787
#: src/components/status.jsx:3865
#: src/components/timeline.jsx:1012
#: src/pages/catchup.jsx:75
#: src/pages/catchup.jsx:1880
@ -1662,8 +1662,8 @@ msgid "[Unknown notification type: {type}]"
msgstr ""
#: src/components/notification.jsx:451
#: src/components/status.jsx:1115
#: src/components/status.jsx:1125
#: src/components/status.jsx:1126
#: src/components/status.jsx:1136
msgid "Boosted/Liked by…"
msgstr ""
@ -1993,7 +1993,7 @@ msgid "Move down"
msgstr ""
#: src/components/shortcuts-settings.jsx:379
#: src/components/status.jsx:1395
#: src/components/status.jsx:1406
#: src/pages/list.jsx:195
msgid "Edit"
msgstr ""
@ -2192,341 +2192,345 @@ msgstr ""
msgid "Import/export settings from/to instance server (Very experimental)"
msgstr ""
#: src/components/status.jsx:614
#: src/components/status.jsx:508
msgid "Post hidden by your filters"
msgstr "Post hidden by your filters"
#: src/components/status.jsx:625
msgid "<0/> <1>boosted</1>"
msgstr ""
#: src/components/status.jsx:713
#: src/components/status.jsx:724
msgid "Sorry, your current logged-in instance can't interact with this post from another instance."
msgstr ""
#. placeholder {0}: username || acct
#: src/components/status.jsx:867
#: src/components/status.jsx:878
msgid "Unliked @{0}'s post"
msgstr ""
#. placeholder {0}: username || acct
#: src/components/status.jsx:868
#: src/components/status.jsx:879
msgid "Liked @{0}'s post"
msgstr "Liked @{0}'s post"
#. placeholder {0}: username || acct
#: src/components/status.jsx:907
#: src/components/status.jsx:918
msgid "Unbookmarked @{0}'s post"
msgstr "Unbookmarked @{0}'s post"
#. placeholder {0}: username || acct
#: src/components/status.jsx:908
#: src/components/status.jsx:919
msgid "Bookmarked @{0}'s post"
msgstr "Bookmarked @{0}'s post"
#: src/components/status.jsx:1007
#: src/components/status.jsx:1018
msgid "Some media have no descriptions."
msgstr ""
#. placeholder {0}: rtf.format(-statusMonthsAgo, 'month')
#: src/components/status.jsx:1014
#: src/components/status.jsx:1025
msgid "Old post (<0>{0}</0>)"
msgstr ""
#: src/components/status.jsx:1038
#: src/components/status.jsx:1078
#: src/components/status.jsx:2530
#: src/components/status.jsx:2553
#: src/components/status.jsx:1049
#: src/components/status.jsx:1089
#: src/components/status.jsx:2541
#: src/components/status.jsx:2564
msgid "Unboost"
msgstr ""
#: src/components/status.jsx:1054
#: src/components/status.jsx:2545
#: src/components/status.jsx:1065
#: src/components/status.jsx:2556
msgid "Quote"
msgstr ""
#. placeholder {0}: username || acct
#: src/components/status.jsx:1066
#: src/components/status.jsx:1532
#: src/components/status.jsx:1077
#: src/components/status.jsx:1543
msgid "Unboosted @{0}'s post"
msgstr "Unboosted @{0}'s post"
#. placeholder {0}: username || acct
#: src/components/status.jsx:1067
#: src/components/status.jsx:1533
#: src/components/status.jsx:1078
#: src/components/status.jsx:1544
msgid "Boosted @{0}'s post"
msgstr "Boosted @{0}'s post"
#: src/components/status.jsx:1079
#: src/components/status.jsx:1090
msgid "Boost…"
msgstr ""
#: src/components/status.jsx:1091
#: src/components/status.jsx:1826
#: src/components/status.jsx:2566
#: src/components/status.jsx:1102
#: src/components/status.jsx:1837
#: src/components/status.jsx:2577
msgid "Unlike"
msgstr ""
#: src/components/status.jsx:1092
#: src/components/status.jsx:1826
#: src/components/status.jsx:1827
#: src/components/status.jsx:2566
#: src/components/status.jsx:2567
#: src/components/status.jsx:1103
#: src/components/status.jsx:1837
#: src/components/status.jsx:1838
#: src/components/status.jsx:2577
#: src/components/status.jsx:2578
msgid "Like"
msgstr ""
#: src/components/status.jsx:1101
#: src/components/status.jsx:2578
#: src/components/status.jsx:1112
#: src/components/status.jsx:2589
msgid "Unbookmark"
msgstr ""
#: src/components/status.jsx:1184
#: src/components/status.jsx:1195
msgid "Post text copied"
msgstr "Post text copied"
#: src/components/status.jsx:1187
#: src/components/status.jsx:1198
msgid "Unable to copy post text"
msgstr "Unable to copy post text"
#: src/components/status.jsx:1193
#: src/components/status.jsx:1204
msgid "Copy post text"
msgstr "Copy post text"
#. placeholder {0}: username || acct
#: src/components/status.jsx:1211
#: src/components/status.jsx:1222
msgid "View post by <0>@{0}</0>"
msgstr ""
#: src/components/status.jsx:1232
#: src/components/status.jsx:1243
msgid "Show Edit History"
msgstr ""
#: src/components/status.jsx:1235
#: src/components/status.jsx:1246
msgid "Edited: {editedDateText}"
msgstr ""
#: src/components/status.jsx:1302
#: src/components/status.jsx:3346
#: src/components/status.jsx:1313
#: src/components/status.jsx:3357
msgid "Embed post"
msgstr ""
#: src/components/status.jsx:1316
#: src/components/status.jsx:1327
msgid "Conversation unmuted"
msgstr ""
#: src/components/status.jsx:1316
#: src/components/status.jsx:1327
msgid "Conversation muted"
msgstr ""
#: src/components/status.jsx:1322
#: src/components/status.jsx:1333
msgid "Unable to unmute conversation"
msgstr ""
#: src/components/status.jsx:1323
#: src/components/status.jsx:1334
msgid "Unable to mute conversation"
msgstr ""
#: src/components/status.jsx:1332
#: src/components/status.jsx:1343
msgid "Unmute conversation"
msgstr ""
#: src/components/status.jsx:1339
#: src/components/status.jsx:1350
msgid "Mute conversation"
msgstr ""
#: src/components/status.jsx:1355
#: src/components/status.jsx:1366
msgid "Post unpinned from profile"
msgstr ""
#: src/components/status.jsx:1356
#: src/components/status.jsx:1367
msgid "Post pinned to profile"
msgstr ""
#: src/components/status.jsx:1361
#: src/components/status.jsx:1372
msgid "Unable to unpin post"
msgstr ""
#: src/components/status.jsx:1361
#: src/components/status.jsx:1372
msgid "Unable to pin post"
msgstr ""
#: src/components/status.jsx:1370
#: src/components/status.jsx:1381
msgid "Unpin from profile"
msgstr ""
#: src/components/status.jsx:1377
#: src/components/status.jsx:1388
msgid "Pin to profile"
msgstr ""
#: src/components/status.jsx:1406
#: src/components/status.jsx:1417
msgid "Delete this post?"
msgstr ""
#: src/components/status.jsx:1422
#: src/components/status.jsx:1433
msgid "Post deleted"
msgstr ""
#: src/components/status.jsx:1425
#: src/components/status.jsx:1436
msgid "Unable to delete post"
msgstr ""
#: src/components/status.jsx:1453
#: src/components/status.jsx:1464
msgid "Report post…"
msgstr ""
#: src/components/status.jsx:1827
#: src/components/status.jsx:1863
#: src/components/status.jsx:2567
#: src/components/status.jsx:1838
#: src/components/status.jsx:1874
#: src/components/status.jsx:2578
msgid "Liked"
msgstr ""
#: src/components/status.jsx:1860
#: src/components/status.jsx:2554
#: src/components/status.jsx:1871
#: src/components/status.jsx:2565
msgid "Boosted"
msgstr ""
#: src/components/status.jsx:1870
#: src/components/status.jsx:2579
#: src/components/status.jsx:1881
#: src/components/status.jsx:2590
msgid "Bookmarked"
msgstr ""
#: src/components/status.jsx:1874
#: src/components/status.jsx:1885
msgid "Pinned"
msgstr ""
#: src/components/status.jsx:1920
#: src/components/status.jsx:2391
#: src/components/status.jsx:1931
#: src/components/status.jsx:2402
msgid "Deleted"
msgstr ""
#: src/components/status.jsx:1961
#: src/components/status.jsx:1972
msgid "{repliesCount, plural, one {# reply} other {# replies}}"
msgstr ""
#. placeholder {0}: snapStates.statusThreadNumber[sKey] ? ` ${snapStates.statusThreadNumber[sKey]}/X` : ''
#: src/components/status.jsx:2051
#: src/components/status.jsx:2062
msgid "Thread{0}"
msgstr ""
#: src/components/status.jsx:2129
#: src/components/status.jsx:2191
#: src/components/status.jsx:2287
#: src/components/status.jsx:2140
#: src/components/status.jsx:2202
#: src/components/status.jsx:2298
msgid "Show less"
msgstr ""
#: src/components/status.jsx:2129
#: src/components/status.jsx:2191
#: src/components/status.jsx:2140
#: src/components/status.jsx:2202
msgid "Show content"
msgstr ""
#. placeholder {0}: filterInfo.titlesStr
#. placeholder {0}: filterInfo?.titlesStr
#: src/components/status.jsx:2283
#: src/components/status.jsx:2294
#: src/pages/catchup.jsx:1879
msgid "Filtered: {0}"
msgstr "Filtered: {0}"
#: src/components/status.jsx:2287
#: src/components/status.jsx:2298
msgid "Show media"
msgstr ""
#: src/components/status.jsx:2427
#: src/components/status.jsx:2438
msgid "Edited"
msgstr ""
#: src/components/status.jsx:2504
#: src/components/status.jsx:2515
msgid "Comments"
msgstr ""
#. More from [Author]
#: src/components/status.jsx:2804
#: src/components/status.jsx:2815
msgid "More from <0/>"
msgstr "More from <0/>"
#: src/components/status.jsx:3106
#: src/components/status.jsx:3117
msgid "Edit History"
msgstr ""
#: src/components/status.jsx:3110
#: src/components/status.jsx:3121
msgid "Failed to load history"
msgstr ""
#: src/components/status.jsx:3115
#: src/components/status.jsx:3126
#: src/pages/annual-report.jsx:45
msgid "Loading…"
msgstr ""
#: src/components/status.jsx:3351
#: src/components/status.jsx:3362
msgid "HTML Code"
msgstr ""
#: src/components/status.jsx:3368
#: src/components/status.jsx:3379
msgid "HTML code copied"
msgstr ""
#: src/components/status.jsx:3371
#: src/components/status.jsx:3382
msgid "Unable to copy HTML code"
msgstr ""
#: src/components/status.jsx:3383
#: src/components/status.jsx:3394
msgid "Media attachments:"
msgstr ""
#: src/components/status.jsx:3405
#: src/components/status.jsx:3416
msgid "Account Emojis:"
msgstr ""
#: src/components/status.jsx:3436
#: src/components/status.jsx:3481
#: src/components/status.jsx:3447
#: src/components/status.jsx:3492
msgid "static URL"
msgstr ""
#: src/components/status.jsx:3450
#: src/components/status.jsx:3461
msgid "Emojis:"
msgstr ""
#: src/components/status.jsx:3495
#: src/components/status.jsx:3506
msgid "Notes:"
msgstr ""
#: src/components/status.jsx:3499
#: src/components/status.jsx:3510
msgid "This is static, unstyled and scriptless. You may need to apply your own styles and edit as needed."
msgstr ""
#: src/components/status.jsx:3505
#: src/components/status.jsx:3516
msgid "Polls are not interactive, becomes a list with vote counts."
msgstr ""
#: src/components/status.jsx:3510
#: src/components/status.jsx:3521
msgid "Media attachments can be images, videos, audios or any file types."
msgstr ""
#: src/components/status.jsx:3516
#: src/components/status.jsx:3527
msgid "Post could be edited or deleted later."
msgstr ""
#: src/components/status.jsx:3522
#: src/components/status.jsx:3533
msgid "Preview"
msgstr ""
#: src/components/status.jsx:3531
#: src/components/status.jsx:3542
msgid "Note: This preview is lightly styled."
msgstr ""
#. [Name] [Visibility icon] boosted
#: src/components/status.jsx:3784
#: src/components/status.jsx:3795
msgid "<0/> <1/> boosted"
msgstr ""
#: src/components/status.jsx:3897
#: src/components/status.jsx:3908
msgid "Post removed by author."
msgstr "Post removed by author."
#: src/components/status.jsx:3906
#: src/components/status.jsx:3917
msgid "Youre not authorized to view this post."
msgstr "Youre not authorized to view this post."
#: src/components/status.jsx:3915
#: src/components/status.jsx:3926
msgid "Post pending author approval."
msgstr "Post pending author approval."
#: src/components/status.jsx:3924
#: src/components/status.jsx:3935
msgid "Quoting not allowed by the author."
msgstr "Quoting not allowed by the author."

Wyświetl plik

@ -45,6 +45,7 @@ const MOCK_STATUS = ({ toggles = {} } = {}) => {
showCard,
size,
filters,
quoteFilters,
userPreferences,
} = toggles;
@ -312,6 +313,7 @@ const INITIAL_STATE = {
quoteNestingLevel: '0',
size: 'medium',
filters: [false, false, false], // hide, blur, warn
quoteFilters: [false, false, false], // hide, blur, warn for quotes
mediaPreference: 'default',
expandWarnings: false,
contextType: 'none', // Default context type
@ -398,6 +400,7 @@ export default function Sandbox() {
quoteNestingLevel: toggleState.quoteNestingLevel,
size: toggleState.size,
filters: toggleState.filters,
quoteFilters: toggleState.quoteFilters,
},
});
@ -531,7 +534,7 @@ export default function Sandbox() {
delete states.statuses[quoteId];
// Create the actual status object that will be retrieved by QuoteStatuses
states.statuses[quoteId] = {
const quoteStatus = {
id: quoteId,
content: `<p>This is quote post ${i + 1}${i % 2 === 0 ? '' : ' with some extra text'}</p>`,
account: {
@ -586,6 +589,32 @@ export default function Sandbox() {
: null,
};
// Add filtering to quote posts if enabled
if (
toggleState.quoteFilters &&
toggleState.quoteFilters.some((f) => f)
) {
quoteStatus.filtered = toggleState.quoteFilters
.map((enabled, filterIndex) => {
if (!enabled) return null;
const filterTypes = ['hide', 'blur', 'warn'];
return {
filter: {
id: `quote-filter-${i}-${filterIndex}`,
title: `Quote ${filterTypes[filterIndex]} filter`,
context: ['home', 'public', 'thread', 'account'],
filterAction: filterTypes[filterIndex],
},
keywordMatches: [],
statusMatches: [],
};
})
.filter(Boolean);
}
// Assign the quote status to the states
states.statuses[quoteId] = quoteStatus;
// If nesting level > 0, add nested quotes to each quote post
if (nestingLevel > 0 && i % 2 === 0) {
// Add nested quotes to every other quote - use stable ID
@ -670,6 +699,7 @@ export default function Sandbox() {
toggleState.showQuotes,
toggleState.quotesCount,
toggleState.quoteNestingLevel,
toggleState.quoteFilters,
]);
// Handler for filter checkboxes
@ -679,6 +709,13 @@ export default function Sandbox() {
updateToggles({ filters: newFilters });
};
// Handler for quote filter checkboxes
const handleQuoteFilterChange = (index) => {
const newQuoteFilters = [...toggleState.quoteFilters];
newQuoteFilters[index] = !newQuoteFilters[index];
updateToggles({ quoteFilters: newQuoteFilters });
};
// Function to check if the current state is different from the initial state
const hasChanges = () => {
return Object.keys(INITIAL_STATE).some((key) => {
@ -1214,6 +1251,41 @@ export default function Sandbox() {
/>
</label>
</li>
<li>
<b>Quote Filters</b>
<ul>
<li>
<label>
<input
type="checkbox"
checked={toggleState.quoteFilters[0]}
onChange={() => handleQuoteFilterChange(0)}
/>
<span>Hide</span>
</label>
</li>
<li>
<label>
<input
type="checkbox"
checked={toggleState.quoteFilters[1]}
onChange={() => handleQuoteFilterChange(1)}
/>
<span>Blur</span>
</label>
</li>
<li>
<label>
<input
type="checkbox"
checked={toggleState.quoteFilters[2]}
onChange={() => handleQuoteFilterChange(2)}
/>
<span>Warn</span>
</label>
</li>
</ul>
</li>
</ul>
)}
</li>