Compare commits

...

3 Commits

Author SHA1 Message Date
Matt Jankowski
f64cc5a41e
Merge bb89b3dc37 into 74fc4dbacf 2025-07-15 17:05:58 +00:00
diondiondion
74fc4dbacf
refactor: Only remove pointer-events when necessary (#35390)
Some checks failed
Check i18n / check-i18n (push) Waiting to run
Chromatic / Run Chromatic (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (ruby) (push) Waiting to run
Check formatting / lint (push) Waiting to run
CSS Linting / lint (push) Waiting to run
Ruby Testing / build (production) (push) Waiting to run
Ruby Testing / build (test) (push) Waiting to run
Ruby Testing / test (.ruby-version) (push) Blocked by required conditions
Ruby Testing / test (3.2) (push) Blocked by required conditions
Ruby Testing / test (3.3) (push) Blocked by required conditions
Ruby Testing / ImageMagick tests (.ruby-version) (push) Blocked by required conditions
Ruby Testing / ImageMagick tests (3.2) (push) Blocked by required conditions
Ruby Testing / ImageMagick tests (3.3) (push) Blocked by required conditions
Ruby Testing / End to End testing (.ruby-version) (push) Blocked by required conditions
Ruby Testing / End to End testing (3.2) (push) Blocked by required conditions
Ruby Testing / End to End testing (3.3) (push) Blocked by required conditions
Ruby Testing / Elastic Search integration testing (.ruby-version, docker.elastic.co/elasticsearch/elasticsearch:7.17.13) (push) Blocked by required conditions
Ruby Testing / Elastic Search integration testing (.ruby-version, docker.elastic.co/elasticsearch/elasticsearch:8.10.2) (push) Blocked by required conditions
Ruby Testing / Elastic Search integration testing (.ruby-version, opensearchproject/opensearch:2) (push) Blocked by required conditions
Ruby Testing / Elastic Search integration testing (3.2, docker.elastic.co/elasticsearch/elasticsearch:7.17.13) (push) Blocked by required conditions
Ruby Testing / Elastic Search integration testing (3.3, docker.elastic.co/elasticsearch/elasticsearch:7.17.13) (push) Blocked by required conditions
Crowdin / Upload translations / upload-translations (push) Has been cancelled
Haml Linting / lint (push) Has been cancelled
Ruby Linting / lint (push) Has been cancelled
Historical data migration test / test (14-alpine) (push) Has been cancelled
Historical data migration test / test (15-alpine) (push) Has been cancelled
Historical data migration test / test (16-alpine) (push) Has been cancelled
Historical data migration test / test (17-alpine) (push) Has been cancelled
2025-07-15 15:57:31 +00:00
Matt Jankowski
bb89b3dc37 Add Status.only_replies scope 2025-07-10 09:35:52 -04:00
5 changed files with 14 additions and 4 deletions

View File

@ -2848,7 +2848,6 @@ a.account__display-name {
&__pane {
height: 100%;
overflow: hidden;
pointer-events: none;
display: flex;
justify-content: flex-end;
min-width: 285px;
@ -2860,7 +2859,6 @@ a.account__display-name {
&__inner {
position: fixed;
width: 285px;
pointer-events: auto;
height: 100%;
}
}

View File

@ -36,7 +36,7 @@ class AnnualReport::Archetype < AnnualReport::Source
end
def replies_count
@replies_count ||= report_statuses.where.not(in_reply_to_id: nil).not_replying_to_account(@account).count
@replies_count ||= report_statuses.only_replies.not_replying_to_account(@account).count
end
def standalone_count

View File

@ -6,7 +6,7 @@ class AnnualReport::TypeDistribution < AnnualReport::Source
type_distribution: {
total: report_statuses.count,
reblogs: report_statuses.only_reblogs.count,
replies: report_statuses.where.not(in_reply_to_id: nil).not_replying_to_account(@account).count,
replies: report_statuses.only_replies.not_replying_to_account(@account).count,
standalone: report_statuses.without_replies.without_reblogs.count,
},
}

View File

@ -120,6 +120,7 @@ class Status < ApplicationRecord
scope :with_accounts, ->(ids) { where(id: ids).includes(:account) }
scope :without_replies, -> { not_reply.or(reply_to_account) }
scope :not_reply, -> { where(reply: false) }
scope :only_replies, -> { where.not(in_reply_to_id: nil) }
scope :only_reblogs, -> { where.not(reblog_of_id: nil) }
scope :only_polls, -> { where.not(poll_id: nil) }
scope :without_polls, -> { where(poll_id: nil) }

View File

@ -376,6 +376,17 @@ RSpec.describe Status do
end
end
describe '.only_replies' do
let!(:status) { Fabricate :status }
let!(:replying_status) { Fabricate :status, thread: Fabricate(:status) }
it 'returns the expected statuses' do
expect(described_class.only_replies)
.to include(replying_status)
.and not_include(status)
end
end
describe '.only_polls' do
let!(:poll_status) { Fabricate :status, poll: Fabricate(:poll) }
let!(:no_poll_status) { Fabricate :status }