From 7825cd1bdb3f60af0979da88942be3f382e8acf9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 24 Mar 2025 09:08:58 +0100 Subject: [PATCH 01/13] chore(deps): update dependency tzinfo-data to v1.2025.2 (#34248) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 04d5aac6cd..624a6630d9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -866,7 +866,7 @@ GEM unf (~> 0.1.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - tzinfo-data (1.2025.1) + tzinfo-data (1.2025.2) tzinfo (>= 1.0.0) unf (0.1.4) unf_ext From 0a5bbf5ac619e8c09dc3248cb7fd3bedc86f7256 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 24 Mar 2025 08:10:07 +0000 Subject: [PATCH 02/13] chore(deps): update definitelytyped types (non-major) (#34247) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index 0d44f66d4f..d35b3d4258 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4059,12 +4059,12 @@ __metadata: linkType: hard "@types/react@npm:^18.2.7": - version: 18.3.18 - resolution: "@types/react@npm:18.3.18" + version: 18.3.19 + resolution: "@types/react@npm:18.3.19" dependencies: "@types/prop-types": "npm:*" csstype: "npm:^3.0.2" - checksum: 10c0/8fb2b00672072135d0858dc9db07873ea107cc238b6228aaa2a9afd1ef7a64a7074078250db38afbeb19064be8ea6af5eac32d404efdd5f45e093cc4829d87f8 + checksum: 10c0/236bfe0c4748ada1a640f13573eca3e0fc7c9d847b442947adb352b0718d6d285357fd84c33336c8ffb8cbfabc0d58a43a647c7fd79857fecd61fb58ab6f7918 languageName: node linkType: hard @@ -4211,11 +4211,11 @@ __metadata: linkType: hard "@types/ws@npm:^8.5.9": - version: 8.5.14 - resolution: "@types/ws@npm:8.5.14" + version: 8.18.0 + resolution: "@types/ws@npm:8.18.0" dependencies: "@types/node": "npm:*" - checksum: 10c0/be88a0b6252f939cb83340bd1b4d450287f752c19271195cd97564fd94047259a9bb8c31c585a61b69d8a1b069a99df9dd804db0132d3359c54d3890c501416a + checksum: 10c0/a56d2e0d1da7411a1f3548ce02b51a50cbe9e23f025677d03df48f87e4a3c72e1342fbf1d12e487d7eafa8dc670c605152b61bbf9165891ec0e9694b0d3ea8d4 languageName: node linkType: hard From fe4cf75ecec2e46fe2cfccd0f2ad6921891fae4e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 24 Mar 2025 08:10:29 +0000 Subject: [PATCH 03/13] chore(deps): update dependency strong_migrations to v2.2.1 (#34246) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 624a6630d9..b84185d7d2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -830,7 +830,7 @@ GEM stoplight (4.1.1) redlock (~> 1.0) stringio (3.1.5) - strong_migrations (2.2.0) + strong_migrations (2.2.1) activerecord (>= 7) swd (2.0.3) activesupport (>= 3) From d15879312e37a5d324ef83bc61472647c3d0e550 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 24 Mar 2025 08:10:43 +0000 Subject: [PATCH 04/13] chore(deps): update dependency pghero to v3.6.2 (#34245) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index b84185d7d2..f8c830291a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -587,7 +587,7 @@ GEM pastel (0.8.0) tty-color (~> 0.5) pg (1.5.9) - pghero (3.6.1) + pghero (3.6.2) activerecord (>= 6.1) pp (0.6.2) prettyprint From 9d3daa847a6408fa5935178465ae5833c3ecbf2b Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 24 Mar 2025 04:11:34 -0400 Subject: [PATCH 05/13] Convert `filters/statuses` spec controller->system/request (#34232) --- .../filters/statuses_controller_spec.rb | 45 ------------------- spec/requests/filters/statuses_spec.rb | 26 +++++++++++ spec/system/filters/statuses_spec.rb | 21 +++++++++ 3 files changed, 47 insertions(+), 45 deletions(-) delete mode 100644 spec/controllers/filters/statuses_controller_spec.rb create mode 100644 spec/system/filters/statuses_spec.rb diff --git a/spec/controllers/filters/statuses_controller_spec.rb b/spec/controllers/filters/statuses_controller_spec.rb deleted file mode 100644 index 7bad403571..0000000000 --- a/spec/controllers/filters/statuses_controller_spec.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -RSpec.describe Filters::StatusesController do - render_views - - describe 'GET #index' do - let(:filter) { Fabricate(:custom_filter) } - - context 'with signed out user' do - it 'redirects' do - get :index, params: { filter_id: filter } - - expect(response).to be_redirect - end - end - - context 'with a signed in user' do - context 'with the filter user signed in' do - before do - sign_in(filter.account.user) - get :index, params: { filter_id: filter } - end - - it 'returns http success and private cache control headers' do - expect(response).to have_http_status(200) - - expect(response.headers['Cache-Control']).to include('private, no-store') - end - end - - context 'with another user signed in' do - before do - sign_in(Fabricate(:user)) - get :index, params: { filter_id: filter } - end - - it 'returns http not found' do - expect(response).to have_http_status(404) - end - end - end - end -end diff --git a/spec/requests/filters/statuses_spec.rb b/spec/requests/filters/statuses_spec.rb index aa1d049da7..b462b56223 100644 --- a/spec/requests/filters/statuses_spec.rb +++ b/spec/requests/filters/statuses_spec.rb @@ -16,4 +16,30 @@ RSpec.describe 'Filters Statuses' do .to redirect_to(edit_filter_path(filter)) end end + + describe 'GET /filters/:filter_id/statuses' do + let(:filter) { Fabricate(:custom_filter) } + + context 'with signed out user' do + it 'redirects' do + get filter_statuses_path(filter) + + expect(response) + .to be_redirect + end + end + + context 'with a signed in user' do + context 'with another user signed in' do + before { sign_in(Fabricate(:user)) } + + it 'returns http not found' do + get filter_statuses_path(filter) + + expect(response) + .to have_http_status(404) + end + end + end + end end diff --git a/spec/system/filters/statuses_spec.rb b/spec/system/filters/statuses_spec.rb new file mode 100644 index 0000000000..b353bd8674 --- /dev/null +++ b/spec/system/filters/statuses_spec.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe 'Filters Statuses' do + describe 'Viewing statuses under a filter' do + let(:filter) { Fabricate(:custom_filter, title: 'good filter') } + + context 'with the filter user signed in' do + before { sign_in(filter.account.user) } + + it 'returns a page with the status filters' do + visit filter_statuses_path(filter) + + expect(page) + .to have_private_cache_control + .and have_title(/good filter/) + end + end + end +end From b892b15ba6c8527de28c6240d865fdf14c1be03a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 24 Mar 2025 09:35:40 +0100 Subject: [PATCH 06/13] New Crowdin Translations (automated) (#34240) Co-authored-by: GitHub Actions --- app/javascript/mastodon/locales/nan.json | 50 ++++++++++++++++++++++ app/javascript/mastodon/locales/zh-CN.json | 2 + config/locales/activerecord.sl.yml | 2 + config/locales/simple_form.sl.yml | 7 +++ config/locales/zh-CN.yml | 2 + 5 files changed, 63 insertions(+) diff --git a/app/javascript/mastodon/locales/nan.json b/app/javascript/mastodon/locales/nan.json index 99b880c61f..57eef0a874 100644 --- a/app/javascript/mastodon/locales/nan.json +++ b/app/javascript/mastodon/locales/nan.json @@ -358,6 +358,7 @@ "follow_suggestions.hints.friends_of_friends": "Tsit ê個人資料tī lí跟tuè ê lâng之間真流行。", "follow_suggestions.hints.most_followed": "Tsit ê個人資料是 {domain} 內,有足tsē跟tuè者ê其中tsit ê。", "follow_suggestions.hints.most_interactions": "Tsit ê個人資料tsi̍t-tsām-á佇 {domain} 有得著真tsē關注。", + "follow_suggestions.hints.similar_to_recently_followed": "Tsit ê個人資料kap lí最近跟tuè ê口座相siâng。", "follow_suggestions.personalized_suggestion": "個人化ê推薦", "follow_suggestions.popular_suggestion": "流行ê推薦", "follow_suggestions.popular_suggestion_longer": "佇{domain} 足有lâng緣", @@ -391,6 +392,9 @@ "hashtag.follow": "跟tuè hashtag", "hashtag.unfollow": "取消跟tuè hashtag", "hashtags.and_other": "……kap 其他 {count, plural, other {# ê}}", + "hints.profiles.followers_may_be_missing": "Tsit ê個人資料ê跟tuè者資訊可能有落勾ê。", + "hints.profiles.follows_may_be_missing": "Tsit ê口座所跟tuè ê ê資訊可能有落勾ê。", + "hints.profiles.posts_may_be_missing": "Tsit ê口座ê tsi̍t kuá PO文可能有落勾ê。", "hints.profiles.see_more_followers": "佇 {domain} 看koh khah tsē跟tuè lí ê", "hints.profiles.see_more_follows": "佇 {domain} 看koh khah tsē lí跟tuè ê", "hints.profiles.see_more_posts": "佇 {domain} 看koh khah tsē ê PO文", @@ -403,6 +407,24 @@ "home.pending_critical_update.link": "看更新內容", "home.pending_critical_update.title": "有重要ê安全更新!", "home.show_announcements": "顯示公告", + "ignore_notifications_modal.disclaimer": "Lí所忽略in ê通知ê用者,Mastodonbē當kā lí通知。忽略通知bē當阻擋訊息ê寄送。", + "ignore_notifications_modal.filter_instead": "改做過濾", + "ignore_notifications_modal.filter_to_act_users": "Lí猶原ē當接受、拒絕猶是檢舉用者", + "ignore_notifications_modal.filter_to_avoid_confusion": "過濾ē當避免可能ê bē分明。", + "ignore_notifications_modal.filter_to_review_separately": "Lí ē當個別檢視所過濾ê通知", + "ignore_notifications_modal.ignore": "Kā通知忽略", + "ignore_notifications_modal.limited_accounts_title": "Kám beh忽略受限制ê口座送來ê通知?", + "ignore_notifications_modal.new_accounts_title": "Kám beh忽略新口座送來ê通知?", + "ignore_notifications_modal.not_followers_title": "Kám beh忽略無跟tuè lí ê口座送來ê通知?", + "ignore_notifications_modal.not_following_title": "Kám beh忽略lí 無跟tuè ê口座送來ê通知?", + "ignore_notifications_modal.private_mentions_title": "忽略ka-kī主動送ê私人提起ê通知?", + "info_button.label": "幫tsān", + "info_button.what_is_alt_text": "

Siánn物是替代文字?

替代文字kā視覺有障礙、網路速度khah慢,á是beh tshuē頂下文ê lâng,提供圖ê敘述。

Lí ē當通過寫明白、簡單kap客觀ê替代文字,替逐家改善容易使用性kap幫tsān理解。

", + "interaction_modal.action.favourite": "Nā beh繼續,lí tio̍h用你ê口座收藏。", + "interaction_modal.action.follow": "Nā beh繼續,lí tio̍h用你ê口座跟tuè。", + "interaction_modal.action.reblog": "Nā beh繼續,lí tio̍h用你ê口座轉送。", + "interaction_modal.action.reply": "Nā beh繼續,lí tio̍h用你ê口座回應。", + "interaction_modal.action.vote": "Nā beh繼續,lí tio̍h用你ê口座投票。", "interaction_modal.go": "行", "interaction_modal.no_account_yet": "Tsit-má iáu bô口座?", "interaction_modal.on_another_server": "佇無kâng ê服侍器", @@ -418,6 +440,34 @@ "intervals.full.minutes": "{number, plural, other {# 分鐘}}", "keyboard_shortcuts.back": "Tńg去", "keyboard_shortcuts.blocked": "開封鎖ê用者ê列單", + "keyboard_shortcuts.boost": "轉送PO文", + "keyboard_shortcuts.column": "揀tsit ê欄", + "keyboard_shortcuts.compose": "揀寫文字ê框仔", + "keyboard_shortcuts.description": "說明", + "keyboard_shortcuts.direct": "phah開私人提起ê欄", + "keyboard_shortcuts.down": "佇列單內kā suá khah 下kha", + "keyboard_shortcuts.enter": "Phah開PO文", + "keyboard_shortcuts.favourite": "收藏PO文", + "keyboard_shortcuts.favourites": "Phah開收藏ê列單", + "keyboard_shortcuts.federated": "Phah開聯邦ê時間線", + "keyboard_shortcuts.heading": "鍵盤ê快速key", + "keyboard_shortcuts.home": "Phah開tshù ê時間線", + "keyboard_shortcuts.hotkey": "快速key", + "keyboard_shortcuts.legend": "顯示tsit篇說明", + "keyboard_shortcuts.local": "Phah開本站ê時間線", + "keyboard_shortcuts.mention": "提起作者", + "keyboard_shortcuts.muted": "Phah開消音ê用者列單", + "keyboard_shortcuts.my_profile": "Phah開lí ê個人資料", + "keyboard_shortcuts.notifications": "Phah開通知欄", + "keyboard_shortcuts.open_media": "Phah開媒體", + "keyboard_shortcuts.pinned": "Phah開釘起來ê PO文列單", + "keyboard_shortcuts.profile": "Phah開作者ê個人資料", + "keyboard_shortcuts.reply": "回應PO文", + "keyboard_shortcuts.requests": "Phah開跟tuè請求ê列單", + "keyboard_shortcuts.search": "揀tshiau-tshuē條á", + "keyboard_shortcuts.spoilers": "顯示/隱藏內容警告", + "keyboard_shortcuts.start": "Phah開「開始用」欄", + "keyboard_shortcuts.toggle_hidden": "顯示/隱藏內容警告後壁ê PO文", "notification.favourite_pm": "{name} kah意lí ê私人提起", "notification.favourite_pm.name_and_others_with_link": "{name} kap{count, plural, other {另外 # ê lâng}}kah意lí ê私人提起", "search_popout.language_code": "ISO語言代碼", diff --git a/app/javascript/mastodon/locales/zh-CN.json b/app/javascript/mastodon/locales/zh-CN.json index bb7ee3c086..b116008fac 100644 --- a/app/javascript/mastodon/locales/zh-CN.json +++ b/app/javascript/mastodon/locales/zh-CN.json @@ -872,7 +872,9 @@ "subscribed_languages.target": "更改 {target} 的订阅语言", "tabs_bar.home": "主页", "tabs_bar.notifications": "通知", + "terms_of_service.effective_as_of": "自 {date} 起生效", "terms_of_service.title": "服务条款", + "terms_of_service.upcoming_changes_on": "将于 {date} 进行变更", "time_remaining.days": "剩余 {number, plural, other {# 天}}", "time_remaining.hours": "剩余 {number, plural, other {# 小时}}", "time_remaining.minutes": "剩余 {number, plural, other {# 分钟}}", diff --git a/config/locales/activerecord.sl.yml b/config/locales/activerecord.sl.yml index 8b05d5d2cd..e4c4fe598f 100644 --- a/config/locales/activerecord.sl.yml +++ b/config/locales/activerecord.sl.yml @@ -55,6 +55,8 @@ sl: too_soon: je prekmalu, naj bo kasneje od %{date} user: attributes: + date_of_birth: + below_limit: ne dosega starostne meje email: blocked: uporablja nedovoljenega ponudnika e-poštnih storitev unreachable: kot kaže ne obstaja diff --git a/config/locales/simple_form.sl.yml b/config/locales/simple_form.sl.yml index 4562b7004b..5d55844aa9 100644 --- a/config/locales/simple_form.sl.yml +++ b/config/locales/simple_form.sl.yml @@ -88,6 +88,7 @@ sl: favicon: WEBP, PNG, GIF ali JPG. Zamenja privzeto ikono spletne strani Mastodon z ikono po meri. mascot: Preglasi ilustracijo v naprednem spletnem vmesniku. media_cache_retention_period: Predstavnostne datoteke iz objav uporabnikov na ostalih strežnikih se začasno hranijo na tem strežniku. Ko je nastavljeno na pozitivno vrednost, bodo predstavnostne datoteke izbrisane po nastavljenem številu dni. Če bo predstavnostna datoteka zahtevana po izbrisu, bo ponovno prenešena, če bo vir še vedno na voljo. Zaradi omejitev pogostosti prejemanja predogledov povezav z drugih strani je priporočljivo to vrednost nastaviti na vsaj 14 dni. V nasprotnem predogledi povezav pred tem časom ne bodo osveženi na zahtevo. + min_age: Med registracijo bodo morali uporabniki potrditi svoj datum rojstva peers_api_enabled: Seznam imen domen, na katere je ta strežnik naletel v fediverzumu. Sem niso vključeni podatki o tem, ali ste v federaciji z danim strežnikom, zgolj to, ali vaš strežnik ve zanj. To uporabljajo storitve, ki zbirajo statistične podatke o federaciji v splošnem smislu. profile_directory: Imenik profilov izpiše vse uporabnike, ki so dovolili, da so v njem navedeni. require_invite_text: Če registracije zahtevajo ročno potrditev, nastavite vnos besedila pod »Zakaj se želite pridružiti?« za obveznega. @@ -145,6 +146,7 @@ sl: min_age: Ne smete biti mlajši od starostne omejitve, ki jo postavljajo zakoni vašega pravosodnega sistema. user: chosen_languages: Ko je označeno, bodo v javnih časovnicah prikazane samo objave v izbranih jezikih + date_of_birth: Prepričati se moramo, da so uporabniki Mastodona stari vsaj %{age} let. Tega podatka ne bomo shranili. role: Vloga določa, katera dovoljenja ima uporabnik. user_role: color: Barva, uporabljena za vlogo po celem up. vmesniku, podana v šestnajstiškem zapisu RGB @@ -270,6 +272,7 @@ sl: favicon: Ikona spletne strani mascot: Maskota po meri (opuščeno) media_cache_retention_period: Obdobje hrambe predpomnilnika predstavnosti + min_age: Spodnja starostna meja peers_api_enabled: Objavi seznam odkritih strežnikov v API-ju profile_directory: Omogoči imenik profilov registrations_mode: Kdo se lahko registrira @@ -341,12 +344,16 @@ sl: admin_email: E-poštni naslov za pravna obvestila arbitration_address: Fizični naslov za arbitražna obvestila arbitration_website: Spletišče za vložitev arbitražnih obvestil + choice_of_law: Izbira prava dmca_address: Fizični naslov za obvestila DMCA ali o avtorskih pravicah dmca_email: E-poštni naslov za obvestila DMCA ali o avtorskih pravicah domain: Domena jurisdiction: Pravna pristojnost min_age: Najmanjša starost user: + date_of_birth_1i: Dan + date_of_birth_2i: Mesec + date_of_birth_3i: Leto role: Vloga time_zone: Časovni pas user_role: diff --git a/config/locales/zh-CN.yml b/config/locales/zh-CN.yml index 12b3aa44d4..457f676e84 100644 --- a/config/locales/zh-CN.yml +++ b/config/locales/zh-CN.yml @@ -315,6 +315,8 @@ zh-CN: new: create: 创建公告 title: 新公告 + preview: + explanation_html: 此电子邮件将发送给 %{display_count} 用户。电子邮件将包含以下文本: publish: 发布 published_msg: 公告已发布! scheduled_for: 定时在 %{time} From ef870007e9b4f0a920e34adcb910d3880df96c7e Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 24 Mar 2025 09:58:15 +0100 Subject: [PATCH 07/13] Fix `CacheBuster` being queued for missing media attachments (#34253) --- app/models/media_attachment.rb | 2 ++ spec/models/media_attachment_spec.rb | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/app/models/media_attachment.rb b/app/models/media_attachment.rb index 605a81c016..04b73e6b2f 100644 --- a/app/models/media_attachment.rb +++ b/app/models/media_attachment.rb @@ -420,6 +420,8 @@ class MediaAttachment < ApplicationRecord @paths_to_cache_bust = MediaAttachment.attachment_definitions.keys.flat_map do |attachment_name| attachment = public_send(attachment_name) + next if attachment.blank? + styles = DEFAULT_STYLES | attachment.styles.keys styles.map { |style| attachment.url(style) } end.compact diff --git a/spec/models/media_attachment_spec.rb b/spec/models/media_attachment_spec.rb index bf818c1e1e..43e9ed087b 100644 --- a/spec/models/media_attachment_spec.rb +++ b/spec/models/media_attachment_spec.rb @@ -302,6 +302,15 @@ RSpec.describe MediaAttachment, :attachment_processing do .to enqueue_sidekiq_job(CacheBusterWorker).with(original_url) .and enqueue_sidekiq_job(CacheBusterWorker).with(small_url) end + + context 'with a missing remote attachment' do + let(:media) { Fabricate(:media_attachment, remote_url: 'https://example.com/foo.png', file: nil) } + + it 'does not queue CacheBusterWorker jobs' do + expect { media.destroy } + .to_not enqueue_sidekiq_job(CacheBusterWorker) + end + end end private From 225b18e74201f3623845ef42e76049ccf4be9d2c Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 24 Mar 2025 10:30:23 +0100 Subject: [PATCH 08/13] Add system spec for account notes (#34206) --- spec/system/account_notes_spec.rb | 51 +++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 spec/system/account_notes_spec.rb diff --git a/spec/system/account_notes_spec.rb b/spec/system/account_notes_spec.rb new file mode 100644 index 0000000000..f8be96be86 --- /dev/null +++ b/spec/system/account_notes_spec.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe 'Account notes', :inline_jobs, :js, :streaming do + include ProfileStories + + let(:email) { 'test@example.com' } + let(:password) { 'password' } + let(:confirmed_at) { Time.zone.now } + let(:finished_onboarding) { true } + + let!(:other_account) { Fabricate(:account) } + + before { as_a_logged_in_user } + + it 'can be written and viewed' do + visit_profile(other_account) + + note_text = 'This is a personal note' + fill_in 'Click to add note', with: note_text + + # This is a bit awkward since there is no button to save the change + # The easiest way is to send ctrl+enter ourselves + find_field(class: 'account__header__account-note__content').send_keys [:control, :enter] + + expect(page) + .to have_css('.account__header__account-note .inline-alert', text: 'SAVED') + + expect(page) + .to have_css('.account__header__account-note__content', text: note_text) + + # Navigate back and forth and ensure the comment is still here + visit root_url + visit_profile(other_account) + + expect(AccountNote.find_by(account: bob.account, target_account: other_account).comment) + .to eq note_text + + expect(page) + .to have_css('.account__header__account-note__content', text: note_text) + end + + def visit_profile(account) + visit short_account_path(account) + + expect(page) + .to have_css('div.app-holder') + .and have_css('form.compose-form') + end +end From 5390edc2aa98813a707f9d60f087d25770542dc5 Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 24 Mar 2025 10:59:05 +0100 Subject: [PATCH 09/13] Change user archive signed URL TTL from 10 seconds to 1 hour (#34254) --- app/controllers/backups_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/backups_controller.rb b/app/controllers/backups_controller.rb index 5df1af5f2f..076d19874b 100644 --- a/app/controllers/backups_controller.rb +++ b/app/controllers/backups_controller.rb @@ -9,13 +9,15 @@ class BackupsController < ApplicationController before_action :authenticate_user! before_action :set_backup + BACKUP_LINK_TIMEOUT = 1.hour.freeze + def download case Paperclip::Attachment.default_options[:storage] when :s3, :azure - redirect_to @backup.dump.expiring_url(10), allow_other_host: true + redirect_to @backup.dump.expiring_url(BACKUP_LINK_TIMEOUT.to_i), allow_other_host: true when :fog if Paperclip::Attachment.default_options.dig(:fog_credentials, :openstack_temp_url_key).present? - redirect_to @backup.dump.expiring_url(Time.now.utc + 10), allow_other_host: true + redirect_to @backup.dump.expiring_url(BACKUP_LINK_TIMEOUT.from_now), allow_other_host: true else redirect_to full_asset_url(@backup.dump.url), allow_other_host: true end From 958953a687dd836cacca952d56a95c4131473159 Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 24 Mar 2025 14:58:37 +0100 Subject: [PATCH 10/13] Refactor spoiler button logic into separate `SpoilerButton` component (#34257) --- .../mastodon/components/media_gallery.jsx | 29 +------- .../mastodon/components/spoiler_button.tsx | 73 +++++++++++++++++++ .../mastodon/features/audio/index.jsx | 20 +---- .../mastodon/features/video/index.jsx | 20 +---- 4 files changed, 82 insertions(+), 60 deletions(-) create mode 100644 app/javascript/mastodon/components/spoiler_button.tsx diff --git a/app/javascript/mastodon/components/media_gallery.jsx b/app/javascript/mastodon/components/media_gallery.jsx index e52e14b1ed..b841745add 100644 --- a/app/javascript/mastodon/components/media_gallery.jsx +++ b/app/javascript/mastodon/components/media_gallery.jsx @@ -12,6 +12,7 @@ import { debounce } from 'lodash'; import { AltTextBadge } from 'mastodon/components/alt_text_badge'; import { Blurhash } from 'mastodon/components/blurhash'; +import { SpoilerButton } from 'mastodon/components/spoiler_button'; import { formatTime } from 'mastodon/features/video'; import { autoPlayGif, displayMedia, useBlurhash } from '../initial_state'; @@ -299,7 +300,7 @@ class MediaGallery extends PureComponent { const { visible } = this.state; const width = this.state.width || defaultWidth; - let children, spoilerButton; + let children; const style = {}; @@ -318,35 +319,11 @@ class MediaGallery extends PureComponent { children = media.map((attachment, i) => ); } - if (uncached) { - spoilerButton = ( - - ); - } else if (!visible) { - spoilerButton = ( - - ); - } - return (
{children} - {(!visible || uncached) && ( -
- {spoilerButton} -
- )} + {(!visible || uncached) && } {(visible && !uncached) && (
diff --git a/app/javascript/mastodon/components/spoiler_button.tsx b/app/javascript/mastodon/components/spoiler_button.tsx new file mode 100644 index 0000000000..3ba2cbc5fa --- /dev/null +++ b/app/javascript/mastodon/components/spoiler_button.tsx @@ -0,0 +1,73 @@ +import { FormattedMessage } from 'react-intl'; + +import classNames from 'classnames'; + +interface Props { + hidden?: boolean; + sensitive: boolean; + uncached?: boolean; + onClick: React.MouseEventHandler; +} + +export const SpoilerButton: React.FC = ({ + hidden = false, + sensitive, + uncached = false, + onClick, +}) => { + let warning; + let action; + + if (uncached) { + warning = ( + + ); + action = ( + + ); + } else if (sensitive) { + warning = ( + + ); + action = ( + + ); + } else { + warning = ( + + ); + action = ( + + ); + } + + return ( +
+ +
+ ); +}; diff --git a/app/javascript/mastodon/features/audio/index.jsx b/app/javascript/mastodon/features/audio/index.jsx index 56c0e524ad..2ce67a94ab 100644 --- a/app/javascript/mastodon/features/audio/index.jsx +++ b/app/javascript/mastodon/features/audio/index.jsx @@ -1,7 +1,7 @@ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; -import { defineMessages, FormattedMessage, injectIntl } from 'react-intl'; +import { defineMessages, injectIntl } from 'react-intl'; import classNames from 'classnames'; @@ -16,6 +16,7 @@ import VisibilityOffIcon from '@/material-icons/400-24px/visibility_off.svg?reac import VolumeOffIcon from '@/material-icons/400-24px/volume_off-fill.svg?react'; import VolumeUpIcon from '@/material-icons/400-24px/volume_up-fill.svg?react'; import { Icon } from 'mastodon/components/icon'; +import { SpoilerButton } from 'mastodon/components/spoiler_button'; import { formatTime, getPointerPosition, fileNameFromURL } from 'mastodon/features/video'; import { Blurhash } from '../../components/blurhash'; @@ -476,14 +477,6 @@ class Audio extends PureComponent { const progress = Math.min((currentTime / duration) * 100, 100); const muted = this.state.muted || volume === 0; - let warning; - - if (sensitive) { - warning = ; - } else { - warning = ; - } - return (
@@ -521,14 +514,7 @@ class Audio extends PureComponent { lang={lang} /> -
- -
+