From 4e55001e65a10fc672a2a0a9520023f936d64dc7 Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 3 Oct 2023 12:21:32 +0200 Subject: [PATCH 1/3] Add a short-lived lock to trend refresh scheduler (#27253) --- app/workers/scheduler/trends/refresh_scheduler.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/workers/scheduler/trends/refresh_scheduler.rb b/app/workers/scheduler/trends/refresh_scheduler.rb index b559ba46b4..85c000deea 100644 --- a/app/workers/scheduler/trends/refresh_scheduler.rb +++ b/app/workers/scheduler/trends/refresh_scheduler.rb @@ -3,7 +3,7 @@ class Scheduler::Trends::RefreshScheduler include Sidekiq::Worker - sidekiq_options retry: 0 + sidekiq_options retry: 0, lock: :until_executed, lock_ttl: 30.minutes.to_i def perform Trends.refresh! From ceb365c41950283f601058e38e779565eca43b31 Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 3 Oct 2023 12:21:42 +0200 Subject: [PATCH 2/3] Fix boosts of local users being filtered in account timelines (#27204) --- app/lib/account_statuses_filter.rb | 6 +++++- .../account_statuses_filter_spec.rb | 16 +++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) rename spec/{models => lib}/account_statuses_filter_spec.rb (91%) diff --git a/app/lib/account_statuses_filter.rb b/app/lib/account_statuses_filter.rb index a5aca96601..b34ebb4777 100644 --- a/app/lib/account_statuses_filter.rb +++ b/app/lib/account_statuses_filter.rb @@ -60,8 +60,12 @@ class AccountStatusesFilter .where(reblog_of_id: nil) .or( scope + # This is basically `Status.not_domain_blocked_by_account(current_account)` + # and `Status.not_excluded_by_account(current_account)` but on the + # `reblog` association. Unfortunately, there seem to be no clean way + # to re-use those scopes in our case. + .where(reblog: { accounts: { domain: nil } }).or(scope.where.not(reblog: { accounts: { domain: current_account.excluded_from_timeline_domains } })) .where.not(reblog: { account_id: current_account.excluded_from_timeline_account_ids }) - .where.not(reblog: { accounts: { domain: current_account.excluded_from_timeline_domains } }) ) end diff --git a/spec/models/account_statuses_filter_spec.rb b/spec/lib/account_statuses_filter_spec.rb similarity index 91% rename from spec/models/account_statuses_filter_spec.rb rename to spec/lib/account_statuses_filter_spec.rb index 0cf6453fe3..c821eb4bac 100644 --- a/spec/models/account_statuses_filter_spec.rb +++ b/spec/lib/account_statuses_filter_spec.rb @@ -202,7 +202,7 @@ RSpec.describe AccountStatusesFilter do context 'when blocking a reblogged domain' do let(:other_account) { Fabricate(:account, domain: 'example.com') } let(:reblogging_status) { Fabricate(:status, account: other_account) } - let(:reblog) { Fabricate(:status, account: account, visibility: 'public', reblog: reblogging_status) } + let!(:reblog) { Fabricate(:status, account: account, visibility: 'public', reblog: reblogging_status) } before do current_account.block_domain!(other_account.domain) @@ -213,6 +213,20 @@ RSpec.describe AccountStatusesFilter do end end + context 'when blocking an unrelated domain' do + let(:other_account) { Fabricate(:account, domain: nil) } + let(:reblogging_status) { Fabricate(:status, account: other_account, visibility: 'public') } + let!(:reblog) { Fabricate(:status, account: account, visibility: 'public', reblog: reblogging_status) } + + before do + current_account.block_domain!('example.com') + end + + it 'returns the reblog from the non-blocked domain' do + expect(subject.results.pluck(:id)).to include(reblog.id) + end + end + context 'when muting a reblogged account' do let(:reblog) { status_with_reblog!('public') } From 37bbd3c1064380a756b4e821655d7697105f99f5 Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 3 Oct 2023 13:12:39 +0200 Subject: [PATCH 3/3] Fix double scroll bars in some columns in advanced interface (#27187) --- app/javascript/mastodon/components/column.jsx | 6 -- .../mastodon/features/explore/index.jsx | 72 +++++++++---------- .../mastodon/features/explore/links.jsx | 2 +- .../mastodon/features/explore/results.jsx | 2 +- .../mastodon/features/explore/suggestions.jsx | 2 +- .../mastodon/features/explore/tags.jsx | 2 +- .../mastodon/features/firehose/index.jsx | 42 ++++++----- .../styles/mastodon/components.scss | 3 + 8 files changed, 62 insertions(+), 69 deletions(-) diff --git a/app/javascript/mastodon/components/column.jsx b/app/javascript/mastodon/components/column.jsx index d737bd347c..cf9df3ba27 100644 --- a/app/javascript/mastodon/components/column.jsx +++ b/app/javascript/mastodon/components/column.jsx @@ -22,12 +22,6 @@ export default class Column extends PureComponent { scrollable = document.scrollingElement; } else { scrollable = this.node.querySelector('.scrollable'); - - // Some columns have nested `.scrollable` containers, with the outer one - // being a wrapper while the actual scrollable content is deeper. - if (scrollable.classList.contains('scrollable--flex')) { - scrollable = scrollable?.querySelector('.scrollable') || scrollable; - } } if (!scrollable) { diff --git a/app/javascript/mastodon/features/explore/index.jsx b/app/javascript/mastodon/features/explore/index.jsx index 1a66adc87c..fefdc23fab 100644 --- a/app/javascript/mastodon/features/explore/index.jsx +++ b/app/javascript/mastodon/features/explore/index.jsx @@ -67,47 +67,45 @@ class Explore extends PureComponent { -
- {isSearching ? ( - - ) : ( - <> -
- - + {isSearching ? ( + + ) : ( + <> +
+ + + + + + + + + {signedIn && ( + + + )} - - - + + + +
- {signedIn && ( - - - - )} + + + + + + + + - - - -
- - - - - - - - - - - - {intl.formatMessage(messages.title)} - - - - )} -
+ + {intl.formatMessage(messages.title)} + + + + )} ); } diff --git a/app/javascript/mastodon/features/explore/links.jsx b/app/javascript/mastodon/features/explore/links.jsx index 663aa6d80f..e610c84d41 100644 --- a/app/javascript/mastodon/features/explore/links.jsx +++ b/app/javascript/mastodon/features/explore/links.jsx @@ -52,7 +52,7 @@ class Links extends PureComponent { } return ( -
+
{banner} {isLoading ? () : links.map((link, i) => ( diff --git a/app/javascript/mastodon/features/explore/results.jsx b/app/javascript/mastodon/features/explore/results.jsx index c6fe9b78e0..4c23d6422d 100644 --- a/app/javascript/mastodon/features/explore/results.jsx +++ b/app/javascript/mastodon/features/explore/results.jsx @@ -204,7 +204,7 @@ class Results extends PureComponent {
-
+
+
{isLoading ? : suggestions.map(suggestion => ( ))} diff --git a/app/javascript/mastodon/features/explore/tags.jsx b/app/javascript/mastodon/features/explore/tags.jsx index 1a4d259690..11e0147214 100644 --- a/app/javascript/mastodon/features/explore/tags.jsx +++ b/app/javascript/mastodon/features/explore/tags.jsx @@ -51,7 +51,7 @@ class Tags extends PureComponent { } return ( -
+
{banner} {isLoading ? () : hashtags.map(hashtag => ( diff --git a/app/javascript/mastodon/features/firehose/index.jsx b/app/javascript/mastodon/features/firehose/index.jsx index e5b47d3fe0..efde58a5c0 100644 --- a/app/javascript/mastodon/features/firehose/index.jsx +++ b/app/javascript/mastodon/features/firehose/index.jsx @@ -169,32 +169,30 @@ const Firehose = ({ feedType, multiColumn }) => { -
-
- - - +
+ + + - - - + + + - - - -
- - + + +
+ + {intl.formatMessage(messages.title)} diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index 2e305ed759..f0380de5bf 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -8279,6 +8279,9 @@ noscript { flex: 1 1 auto; display: flex; flex-direction: column; + background: $ui-base-color; + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; } .story {