Skip to content

Commit

Permalink
Merge pull request #2826 from ClearlyClaire/glitch-soc/merge-upstream
Browse files Browse the repository at this point in the history
Merge upstream changes up to e38ce3b
  • Loading branch information
ClearlyClaire authored Aug 26, 2024
2 parents ccd7eb3 + 8f678a3 commit 11014ac
Show file tree
Hide file tree
Showing 73 changed files with 579 additions and 319 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/test-ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,24 @@ jobs:
with:
onlyProduction: 'true'

- name: Cache assets from compilation
uses: actions/cache@v4
with:
path: |
public/assets
public/packs
public/packs-test
tmp/cache/webpacker
key: ${{ matrix.mode }}-assets-${{ github.head_ref || github.ref_name }}-${{ github.sha }}
restore-keys: |
${{ matrix.mode }}-assets-${{ github.head_ref || github.ref_name }}-${{ github.sha }}
${{ matrix.mode }}-assets-${{ github.head_ref || github.ref_name }}
${{ matrix.mode }}-assets-main
${{ matrix.mode }}-assets
- name: Precompile assets
# Previously had set this, but it's not supported
# export NODE_OPTIONS=--openssl-legacy-provider
run: |-
./bin/rails assets:precompile
bin/rails assets:precompile
- name: Archive asset artifacts
run: |
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ The following changelog entries focus on changes visible to users, administrator
- **Change colors throughout the web UI** (#29522, #29584, #29653, #29779, #29803, #29809, #29808, #29828, #31034, #31168, #31266, #31348, #31349, #31361, and #31510 by @ClearlyClaire, @Gargron, @renchap, and @vmstan)
- **Change onboarding prompt to follow suggestions carousel in web UI** (#28878 and #29272 by @Gargron)
- **Change email templates** (#28416, #28755, #28814, #29064, #28883, #29470, #29607, #29761, #29760, and #29879 by @ClearlyClaire, @Gargron, @hteumeuleu, and @mjankowski)\
All emails to end-users have been completely redesigned with a fresh new look, providing more information while making them easier to reand and keeping maximum compatibility across mail clients.
All emails to end-users have been completely redesigned with a fresh new look, providing more information while making them easier to read and keeping maximum compatibility across mail clients.
- **Change follow recommendations algorithm** (#28314, #28433, #29017, #29108, #29306, #29550, #29619, and #31474 by @ClearlyClaire, @Gargron, @kernal053, @mjankowski, and @wheatear-dev)\
This replaces the “past interactions” recommendation algorithm with a “friends of friends” algorithm that suggests accounts followed by people you follow, and a “similar profiles” algorithm that suggests accounts with a profile similar to your most recent follows.\
In addition, the implementation has been significantly reworked, and all follow recommendations are now dismissable.\
Expand Down
12 changes: 6 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,14 @@ GEM
blurhash (0.1.7)
bootsnap (1.18.4)
msgpack (~> 1.2)
brakeman (6.1.2)
brakeman (6.2.1)
racc
browser (5.3.1)
brpoplpush-redis_script (0.1.3)
concurrent-ruby (~> 1.0, >= 1.0.5)
redis (>= 1.0, < 6)
builder (3.3.0)
bundler-audit (0.9.1)
bundler-audit (0.9.2)
bundler (>= 1.2.0, < 3)
thor (~> 1.0)
capybara (3.40.0)
Expand Down Expand Up @@ -432,7 +432,7 @@ GEM
mime-types-data (3.2024.0702)
mini_mime (1.1.5)
mini_portile2 (2.8.7)
minitest (5.24.1)
minitest (5.25.1)
msgpack (1.7.2)
multi_json (1.15.0)
multipart-post (2.4.0)
Expand Down Expand Up @@ -466,7 +466,7 @@ GEM
addressable (~> 2.8)
nokogiri (~> 1.12)
omniauth (~> 2.1)
omniauth-rails_csrf_protection (1.0.1)
omniauth-rails_csrf_protection (1.0.2)
actionpack (>= 4.2)
omniauth (~> 2.0)
omniauth-saml (2.1.0)
Expand Down Expand Up @@ -695,7 +695,7 @@ GEM
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
rexml (3.3.4)
rexml (3.3.6)
strscan
rotp (6.3.0)
rouge (4.2.1)
Expand Down Expand Up @@ -832,7 +832,7 @@ GEM
unicode-display_width (>= 1.1.1, < 3)
terrapin (1.0.1)
climate_control
test-prof (1.4.0)
test-prof (1.4.1)
thor (1.3.1)
tilt (2.3.0)
timeout (0.4.1)
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def locale_direction
def html_title
safe_join(
[content_for(:page_title).to_s.chomp, title]
.select(&:present?),
.compact_blank,
' - '
)
end
Expand Down
1 change: 0 additions & 1 deletion app/javascript/flavours/glitch/actions/account_notes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ export const submitAccountNote = createDataLoadingThunk(
({ accountId, note }: { accountId: string; note: string }) =>
apiSubmitAccountNote(accountId, note),
(relationship) => ({ relationship }),
{ skipLoading: true },
);
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ export const loadingBarMiddleware = (
let isRejected = false;

if (
isAsyncThunkAction(action)
// TODO: once we get the first use-case for it, add a check for skipLoading
isAsyncThunkAction(action) &&
'useLoadingBar' in action.meta &&
action.meta.useLoadingBar
) {
if (isThunkActionPending(action)) isPending = true;
else if (isThunkActionFulfilled(action)) isFulfilled = true;
Expand Down
19 changes: 12 additions & 7 deletions app/javascript/flavours/glitch/store/typed_functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface AsyncThunkRejectValue {
}

interface AppMeta {
skipLoading?: boolean;
useLoadingBar?: boolean;
}

export const createAppAsyncThunk = createAsyncThunk.withTypes<{
Expand All @@ -34,7 +34,7 @@ interface AppThunkConfig {
type AppThunkApi = Pick<GetThunkAPI<AppThunkConfig>, 'getState' | 'dispatch'>;

interface AppThunkOptions {
skipLoading?: boolean;
useLoadingBar?: boolean;
}

const createBaseAsyncThunk = createAsyncThunk.withTypes<AppThunkConfig>();
Expand All @@ -54,15 +54,20 @@ export function createThunk<Arg = void, Returned = void>(
const result = await creator(arg, { dispatch, getState });

return fulfillWithValue(result, {
skipLoading: options.skipLoading,
useLoadingBar: options.useLoadingBar,
});
} catch (error) {
return rejectWithValue({ error }, { skipLoading: true });
return rejectWithValue(
{ error },
{
useLoadingBar: options.useLoadingBar,
},
);
}
},
{
getPendingMeta() {
if (options.skipLoading) return { skipLoading: true };
if (options.useLoadingBar) return { useLoadingBar: true };
return {};
},
},
Expand Down Expand Up @@ -148,7 +153,7 @@ export function createDataLoadingThunk<
* You can also omit this parameter and pass `thunkOptions` directly
* @param maybeThunkOptions
* Additional Mastodon specific options for the thunk. Currently supports:
* - `skipLoading` to avoid showing the loading bar when the request is in progress
* - `useLoadingBar` to display a loading bar while this action is pending. Defaults to true.
* @returns The created thunk
*/
export function createDataLoadingThunk<
Expand Down Expand Up @@ -198,6 +203,6 @@ export function createDataLoadingThunk<
return undefined as Returned;
else return result;
},
thunkOptions,
{ useLoadingBar: thunkOptions?.useLoadingBar ?? true },
);
}
1 change: 0 additions & 1 deletion app/javascript/mastodon/actions/account_notes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ export const submitAccountNote = createDataLoadingThunk(
({ accountId, note }: { accountId: string; note: string }) =>
apiSubmitAccountNote(accountId, note),
(relationship) => ({ relationship }),
{ skipLoading: true },
);
7 changes: 7 additions & 0 deletions app/javascript/mastodon/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@
"confirmations.unfollow.confirm": "إلغاء المتابعة",
"confirmations.unfollow.message": "متأكد من أنك تريد إلغاء متابعة {name} ؟",
"confirmations.unfollow.title": "إلغاء متابعة المستخدم؟",
"content_warning.hide": "إخفاء المنشور",
"content_warning.show": "إظهار على أي حال",
"conversation.delete": "احذف المحادثة",
"conversation.mark_as_read": "اعتبرها كمقروءة",
"conversation.open": "اعرض المحادثة",
Expand Down Expand Up @@ -297,6 +299,7 @@
"filter_modal.select_filter.subtitle": "استخدم فئة موجودة أو قم بإنشاء فئة جديدة",
"filter_modal.select_filter.title": "تصفية هذا المنشور",
"filter_modal.title.status": "تصفية منشور",
"filter_warning.matches_filter": "يطابق عامل التصفية \"{title}\"",
"filtered_notifications_banner.title": "الإشعارات المصفاة",
"firehose.all": "الكل",
"firehose.local": "هذا الخادم",
Expand Down Expand Up @@ -500,11 +503,14 @@
"notification.update": "عدّلَ {name} منشورًا",
"notification_requests.accept": "موافقة",
"notification_requests.dismiss": "تخطي",
"notification_requests.edit_selection": "تعديل",
"notification_requests.exit_selection": "تمّ",
"notification_requests.explainer_for_limited_account": "تم تصفية الإشعارات من هذا الحساب لأن الحساب تم تقييده من قبل مشرف.",
"notification_requests.notifications_from": "إشعارات من {name}",
"notification_requests.title": "الإشعارات المصفاة",
"notifications.clear": "مسح الإشعارات",
"notifications.clear_confirmation": "متأكد من أنك تود مسح جميع الإشعارات الخاصة بك و المتلقاة إلى حد الآن ؟",
"notifications.clear_title": "أترغب في مسح الإشعارات؟",
"notifications.column_settings.admin.report": "التبليغات الجديدة:",
"notifications.column_settings.admin.sign_up": "التسجيلات الجديدة:",
"notifications.column_settings.alert": "إشعارات سطح المكتب",
Expand Down Expand Up @@ -713,6 +719,7 @@
"server_banner.about_active_users": "الأشخاص الذين يستخدمون هذا الخادم خلال الأيام الثلاثين الأخيرة (المستخدمون النشطون شهريًا)",
"server_banner.active_users": "مستخدم نشط",
"server_banner.administered_by": "يُديره:",
"server_banner.is_one_of_many": "{domain} هو واحد من بين العديد من خوادم ماستدون المستقلة التي يمكنك استخدامها للمشاركة في الفديفرس.",
"server_banner.server_stats": "إحصائيات الخادم:",
"sign_in_banner.create_account": "أنشئ حسابًا",
"sign_in_banner.sign_in": "تسجيل الدخول",
Expand Down
8 changes: 8 additions & 0 deletions app/javascript/mastodon/locales/be.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@
"confirmations.unfollow.confirm": "Адпісацца",
"confirmations.unfollow.message": "Вы ўпэўненыя, што хочаце адпісацца ад {name}?",
"confirmations.unfollow.title": "Адпісацца ад карыстальніка?",
"content_warning.hide": "Схаваць допіс",
"content_warning.show": "Усё адно паказаць",
"conversation.delete": "Выдаліць размову",
"conversation.mark_as_read": "Адзначыць прачытаным",
"conversation.open": "Прагледзець размову",
Expand Down Expand Up @@ -299,6 +301,7 @@
"filter_modal.select_filter.subtitle": "Скарыстайцеся існуючай катэгорыяй або стварыце новую",
"filter_modal.select_filter.title": "Фільтраваць гэты допіс",
"filter_modal.title.status": "Фільтраваць допіс",
"filter_warning.matches_filter": "Адпавядае фільтру \"{title}\"",
"filtered_notifications_banner.pending_requests": "Ад {count, plural, =0 {# людзей якіх} one {# чалавека якіх} few {# чалавек якіх} many {# людзей якіх} other {# чалавека якіх}} вы магчыма ведаеце",
"filtered_notifications_banner.title": "Адфільтраваныя апавяшчэнні",
"firehose.all": "Усе",
Expand Down Expand Up @@ -355,6 +358,7 @@
"home.pending_critical_update.link": "Прагледзець абнаўленні",
"home.pending_critical_update.title": "Даступна крытычнае абнаўленне бяспекі!",
"home.show_announcements": "Паказаць аб'явы",
"ignore_notifications_modal.not_following_title": "Ігнараваць апавяшчэнні ад людзей на якіх вы не падпісаны?",
"interaction_modal.description.favourite": "Маючы ўліковы запіс Mastodon, вы можаце ўпадабаць гэты допіс, каб паведаміць аўтару, што ён вам падабаецца, і захаваць яго на будучыню.",
"interaction_modal.description.follow": "Маючы акаўнт у Mastodon, вы можаце падпісацца на {name}, каб бачыць яго/яе допісы ў сваёй хатняй стужцы.",
"interaction_modal.description.reblog": "З уліковым запісам Mastodon, вы можаце пашырыць гэты пост, каб падзяліцца ім са сваімі падпісчыкамі.",
Expand Down Expand Up @@ -504,7 +508,11 @@
"notification.status": "Новы допіс ад {name}",
"notification.update": "Допіс {name} адрэдагаваны",
"notification_requests.accept": "Прыняць",
"notification_requests.confirm_accept_multiple.title": "Прыняць запыты на апавяшчэнні?",
"notification_requests.confirm_dismiss_multiple.title": "Адхіліць запыты на апавяшчэнні?",
"notification_requests.dismiss": "Адхіліць",
"notification_requests.edit_selection": "Рэдагаваць",
"notification_requests.exit_selection": "Гатова",
"notification_requests.maximize": "Разгарнуць",
"notification_requests.minimize_banner": "Згарнуць банер адфільтраваных апавяшчэнняў",
"notification_requests.notifications_from": "Апавяшчэнні ад {name}",
Expand Down
1 change: 1 addition & 0 deletions app/javascript/mastodon/locales/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
"confirmations.unfollow.confirm": "Без следване",
"confirmations.unfollow.message": "Наистина ли искате да не следвате {name}?",
"confirmations.unfollow.title": "Спирате ли да следвате потребителя?",
"content_warning.hide": "Скриване на публ.",
"conversation.delete": "Изтриване на разговора",
"conversation.mark_as_read": "Маркиране като прочетено",
"conversation.open": "Преглед на разговора",
Expand Down
Loading

0 comments on commit 11014ac

Please sign in to comment.