From 520974e05211e988b0447f7f29e88798b1794bcf Mon Sep 17 00:00:00 2001 From: Claire Date: Thu, 5 Jun 2025 17:36:51 +0200 Subject: [PATCH] Add ability to filter quote posts in home timeline (#34946) --- .../home_timeline/components/column_settings.tsx | 13 +++++++++++++ .../ui/containers/status_list_container.js | 15 +++++++++------ app/javascript/mastodon/locales/en.json | 1 + app/javascript/mastodon/reducers/settings.js | 1 + 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/app/javascript/mastodon/features/home_timeline/components/column_settings.tsx b/app/javascript/mastodon/features/home_timeline/components/column_settings.tsx index cb03d38847..7de82215e4 100644 --- a/app/javascript/mastodon/features/home_timeline/components/column_settings.tsx +++ b/app/javascript/mastodon/features/home_timeline/components/column_settings.tsx @@ -40,6 +40,19 @@ export const ColumnSettings: React.FC = () => { } /> + + } + /> + createSelector([ if (id === null || id === 'inline-follow-suggestions') return true; const statusForId = statuses.get(id); - let showStatus = true; if (statusForId.get('account') === me) return true; - if (columnSettings.getIn(['shows', 'reblog']) === false) { - showStatus = showStatus && statusForId.get('reblog') === null; + if (columnSettings.getIn(['shows', 'reblog']) === false && statusForId.get('reblog') !== null) { + return false; } - if (columnSettings.getIn(['shows', 'reply']) === false) { - showStatus = showStatus && (statusForId.get('in_reply_to_id') === null || statusForId.get('in_reply_to_account_id') === me); + if (columnSettings.getIn(['shows', 'reply']) === false && statusForId.get('in_reply_to_id') !== null && statusForId.get('in_reply_to_account_id') !== me) { + return false; } - return showStatus; + if (columnSettings.getIn(['shows', 'quote']) === false && statusForId.get('quote') !== null) { + return false; + } + + return true; }); }); diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index 7b8c93382a..589aae2e55 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -430,6 +430,7 @@ "hints.profiles.see_more_posts": "See more posts on {domain}", "hints.threads.replies_may_be_missing": "Replies from other servers may be missing.", "hints.threads.see_more": "See more replies on {domain}", + "home.column_settings.show_quotes": "Show quotes", "home.column_settings.show_reblogs": "Show boosts", "home.column_settings.show_replies": "Show replies", "home.hide_announcements": "Hide announcements", diff --git a/app/javascript/mastodon/reducers/settings.js b/app/javascript/mastodon/reducers/settings.js index fc02ac7186..9e2ee5f55a 100644 --- a/app/javascript/mastodon/reducers/settings.js +++ b/app/javascript/mastodon/reducers/settings.js @@ -20,6 +20,7 @@ const initialState = ImmutableMap({ home: ImmutableMap({ shows: ImmutableMap({ + quote: true, reblog: true, reply: true, }),