Skip to content

Commit

Permalink
Merge remote-tracking branch 'glitch-soc/main' into merge/glitch/2025…
Browse files Browse the repository at this point in the history
…0108

Conflicts:
  app/javascript/flavours/glitch/styles/components.scss
  app/javascript/styles/mastodon/components.scss
  • Loading branch information
neatchee committed Jan 8, 2025
2 parents 6b0e968 + 10e2411 commit 15504e6
Show file tree
Hide file tree
Showing 103 changed files with 810 additions and 235 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-i18n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ permissions:

jobs:
check-i18n:
runs-on: ubuntu-24.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ jobs:

test-libvips:
name: Libvips tests
runs-on: ubuntu-24.04
runs-on: ubuntu-latest

needs:
- build
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admin/software_updates_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class SoftwareUpdatesController < BaseController

def index
authorize :software_update, :index?
@software_updates = SoftwareUpdate.all.sort_by(&:gem_version)
@software_updates = SoftwareUpdate.by_version
end

private
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/concerns/localized.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def http_accept_language
end

def available_locale_or_nil(locale_name)
locale_name.to_sym if locale_name.present? && I18n.available_locales.include?(locale_name.to_sym)
locale_name.to_sym if locale_name.respond_to?(:to_sym) && I18n.available_locales.include?(locale_name.to_sym)
end

def content_locale
Expand Down
42 changes: 3 additions & 39 deletions app/javascript/flavours/glitch/actions/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,25 @@ import { requestNotificationPermission } from '../utils/notifications';
import { fetchFollowRequests } from './accounts';
import {
importFetchedAccount,
importFetchedStatus,
} from './importer';
import { submitMarkers } from './markers';
import { notificationsUpdate } from "./notifications_typed";
import { register as registerPushNotifications } from './push_notifications';
import { saveSettings } from './settings';

export * from "./notifications_typed";

export const NOTIFICATIONS_UPDATE_NOOP = 'NOTIFICATIONS_UPDATE_NOOP';

export const NOTIFICATIONS_FILTER_SET = 'NOTIFICATIONS_FILTER_SET';

export const NOTIFICATIONS_SET_BROWSER_SUPPORT = 'NOTIFICATIONS_SET_BROWSER_SUPPORT';
export const NOTIFICATIONS_SET_BROWSER_PERMISSION = 'NOTIFICATIONS_SET_BROWSER_PERMISSION';

export const NOTIFICATION_REQUESTS_DISMISS_REQUEST = 'NOTIFICATION_REQUESTS_DISMISS_REQUEST';
export const NOTIFICATION_REQUESTS_DISMISS_SUCCESS = 'NOTIFICATION_REQUESTS_DISMISS_SUCCESS';
export const NOTIFICATION_REQUESTS_DISMISS_FAIL = 'NOTIFICATION_REQUESTS_DISMISS_FAIL';

defineMessages({
mention: { id: 'notification.mention', defaultMessage: '{name} mentioned you' },
group: { id: 'notifications.group', defaultMessage: '{count} notifications' },
});

export function updateNotifications(notification, intlMessages, intlLocale) {
return (dispatch, getState) => {
const activeFilter = getState().getIn(['settings', 'notifications', 'quickFilter', 'active']);
const showInColumn = activeFilter === 'all' ? getState().getIn(['settings', 'notifications', 'shows', notification.type], true) : activeFilter === notification.type;
const showAlert = getState().getIn(['settings', 'notifications', 'alerts', notification.type], true);
const playSound = getState().getIn(['settings', 'notifications', 'sounds', notification.type], true);

Expand All @@ -57,24 +47,9 @@ export function updateNotifications(notification, intlMessages, intlLocale) {

dispatch(submitMarkers());

if (showInColumn) {
dispatch(importFetchedAccount(notification.account));

if (notification.status) {
dispatch(importFetchedStatus(notification.status));
}

if (notification.report) {
dispatch(importFetchedAccount(notification.report.target_account));
}

dispatch(notificationsUpdate({ notification, playSound: playSound && !filtered}));
} else if (playSound && !filtered) {
dispatch({
type: NOTIFICATIONS_UPDATE_NOOP,
meta: { sound: 'boop' },
});
}
// `notificationsUpdate` is still used in `user_lists` and `relationships` reducers
dispatch(importFetchedAccount(notification.account));
dispatch(notificationsUpdate({ notification, playSound: playSound && !filtered}));

// Desktop notifications
if (typeof window.Notification !== 'undefined' && showAlert && !filtered) {
Expand All @@ -93,17 +68,6 @@ export function updateNotifications(notification, intlMessages, intlLocale) {

const noOp = () => {};

export function setFilter (filterType) {
return dispatch => {
dispatch({
type: NOTIFICATIONS_FILTER_SET,
path: ['notifications', 'quickFilter', 'active'],
value: filterType,
});
dispatch(saveSettings());
};
}

// Browser support
export function setupBrowserNotifications() {
return dispatch => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import { Permalink } from 'flavours/glitch/components/permalink';

export const MentionsPlaceholder = ({ status }) => {
if (status.get('spoiler_text').length === 0 || !status.get('mentions')) {
if (status.get('spoiler_text').length === 0 || !status.get('mentions') || status.get('mentions').isEmpty()) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { defineMessages, injectIntl } from 'react-intl';
import { connect } from 'react-redux';

import { openModal } from 'flavours/glitch/actions/modal';
import { fetchNotifications } from 'flavours/glitch/actions/notification_groups';
import { fetchNotifications , setNotificationsFilter } from 'flavours/glitch/actions/notification_groups';

import { showAlert } from '../../../actions/alerts';
import { setFilter, requestBrowserPermission } from '../../../actions/notifications';
import { requestBrowserPermission } from '../../../actions/notifications';
import { changeAlerts as changePushNotifications } from '../../../actions/push_notifications';
import { changeSetting } from '../../../actions/settings';
import ColumnSettings from '../components/column_settings';
Expand Down Expand Up @@ -43,7 +43,7 @@ const mapDispatchToProps = (dispatch) => ({
}
} else if (path[0] === 'quickFilter') {
dispatch(changeSetting(['notifications', ...path], checked));
dispatch(setFilter('all'));
dispatch(setNotificationsFilter('all'));
} else if (path[0] === 'alerts' && checked && typeof window.Notification !== 'undefined' && Notification.permission !== 'granted') {
if (checked && typeof window.Notification !== 'undefined' && Notification.permission !== 'granted') {
dispatch(requestBrowserPermission((permission) => {
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/flavours/glitch/styles/components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,7 @@ body > [data-popper-placement] {
}
}

.status__content.status__content--collapsed .status__content__text {
.status__content.status__content--collapsed {
max-height: 20px * 15; // 15 lines is roughly above 500 characters
}

Expand Down Expand Up @@ -1643,7 +1643,7 @@ body > [data-popper-placement] {
padding: 0 10px;

.detailed-status__display-name {
color: color.adjust($inverted-text-color, $lightness: 16%);
color: $dark-text-color;

span {
display: inline;
Expand Down
42 changes: 3 additions & 39 deletions app/javascript/mastodon/actions/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,25 @@ import { requestNotificationPermission } from '../utils/notifications';
import { fetchFollowRequests } from './accounts';
import {
importFetchedAccount,
importFetchedStatus,
} from './importer';
import { submitMarkers } from './markers';
import { notificationsUpdate } from "./notifications_typed";
import { register as registerPushNotifications } from './push_notifications';
import { saveSettings } from './settings';

export * from "./notifications_typed";

export const NOTIFICATIONS_UPDATE_NOOP = 'NOTIFICATIONS_UPDATE_NOOP';

export const NOTIFICATIONS_FILTER_SET = 'NOTIFICATIONS_FILTER_SET';

export const NOTIFICATIONS_SET_BROWSER_SUPPORT = 'NOTIFICATIONS_SET_BROWSER_SUPPORT';
export const NOTIFICATIONS_SET_BROWSER_PERMISSION = 'NOTIFICATIONS_SET_BROWSER_PERMISSION';

export const NOTIFICATION_REQUESTS_DISMISS_REQUEST = 'NOTIFICATION_REQUESTS_DISMISS_REQUEST';
export const NOTIFICATION_REQUESTS_DISMISS_SUCCESS = 'NOTIFICATION_REQUESTS_DISMISS_SUCCESS';
export const NOTIFICATION_REQUESTS_DISMISS_FAIL = 'NOTIFICATION_REQUESTS_DISMISS_FAIL';

defineMessages({
mention: { id: 'notification.mention', defaultMessage: '{name} mentioned you' },
group: { id: 'notifications.group', defaultMessage: '{count} notifications' },
});

export function updateNotifications(notification, intlMessages, intlLocale) {
return (dispatch, getState) => {
const activeFilter = getState().getIn(['settings', 'notifications', 'quickFilter', 'active']);
const showInColumn = activeFilter === 'all' ? getState().getIn(['settings', 'notifications', 'shows', notification.type], true) : activeFilter === notification.type;
const showAlert = getState().getIn(['settings', 'notifications', 'alerts', notification.type], true);
const playSound = getState().getIn(['settings', 'notifications', 'sounds', notification.type], true);

Expand All @@ -57,24 +47,9 @@ export function updateNotifications(notification, intlMessages, intlLocale) {

dispatch(submitMarkers());

if (showInColumn) {
dispatch(importFetchedAccount(notification.account));

if (notification.status) {
dispatch(importFetchedStatus(notification.status));
}

if (notification.report) {
dispatch(importFetchedAccount(notification.report.target_account));
}

dispatch(notificationsUpdate({ notification, playSound: playSound && !filtered}));
} else if (playSound && !filtered) {
dispatch({
type: NOTIFICATIONS_UPDATE_NOOP,
meta: { sound: 'boop' },
});
}
// `notificationsUpdate` is still used in `user_lists` and `relationships` reducers
dispatch(importFetchedAccount(notification.account));
dispatch(notificationsUpdate({ notification, playSound: playSound && !filtered}));

// Desktop notifications
if (typeof window.Notification !== 'undefined' && showAlert && !filtered) {
Expand All @@ -93,17 +68,6 @@ export function updateNotifications(notification, intlMessages, intlLocale) {

const noOp = () => {};

export function setFilter (filterType) {
return dispatch => {
dispatch({
type: NOTIFICATIONS_FILTER_SET,
path: ['notifications', 'quickFilter', 'active'],
value: filterType,
});
dispatch(saveSettings());
};
}

// Browser support
export function setupBrowserNotifications() {
return dispatch => {
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/mastodon/containers/compose_container.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Provider } from 'react-redux';

import { fetchCustomEmojis } from 'mastodon/actions/custom_emojis';
import { fetchServer } from 'mastodon/actions/server';
import { hydrateStore } from 'mastodon/actions/store';
import { Router } from 'mastodon/components/router';
import Compose from 'mastodon/features/standalone/compose';
Expand All @@ -13,6 +14,7 @@ if (initialState) {
}

store.dispatch(fetchCustomEmojis());
store.dispatch(fetchServer());

const ComposeContainer = () => (
<IntlProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { defineMessages, injectIntl } from 'react-intl';
import { connect } from 'react-redux';

import { openModal } from 'mastodon/actions/modal';
import { fetchNotifications } from 'mastodon/actions/notification_groups';
import { fetchNotifications , setNotificationsFilter } from 'mastodon/actions/notification_groups';

import { showAlert } from '../../../actions/alerts';
import { setFilter, requestBrowserPermission } from '../../../actions/notifications';
import { requestBrowserPermission } from '../../../actions/notifications';
import { changeAlerts as changePushNotifications } from '../../../actions/push_notifications';
import { changeSetting } from '../../../actions/settings';
import ColumnSettings from '../components/column_settings';
Expand Down Expand Up @@ -43,7 +43,7 @@ const mapDispatchToProps = (dispatch) => ({
}
} else if (path[0] === 'quickFilter') {
dispatch(changeSetting(['notifications', ...path], checked));
dispatch(setFilter('all'));
dispatch(setNotificationsFilter('all'));
} else if (path[0] === 'alerts' && checked && typeof window.Notification !== 'undefined' && Notification.permission !== 'granted') {
if (checked && typeof window.Notification !== 'undefined' && Notification.permission !== 'granted') {
dispatch(requestBrowserPermission((permission) => {
Expand Down
4 changes: 3 additions & 1 deletion app/javascript/mastodon/locales/az.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,5 +240,7 @@
"dismissable_banner.community_timeline": "Bunlar, hesabları {domain} serverində yerləşən insanların ən son ictimai paylaşımlarıdır.",
"dismissable_banner.dismiss": "Bağla",
"dismissable_banner.explore_links": "Bu xəbərlər bu gün fediversedə ən çox paylaşılır. Daha fərqli insanlar tərəfindən dərc edilən daha yeni xəbərlər daha yuxarıda sıralanır.",
"dismissable_banner.explore_statuses": "Fediversedən olan bu paylaşımlar bu gün maraq qazanır. Daha çox gücləndirici və bəyənmə olan daha yeni paylaşımlar daha yuxarıda sıralanır."
"dismissable_banner.explore_statuses": "Fediversedən olan bu paylaşımlar bu gün maraq qazanır. Daha çox gücləndirici və bəyənmə olan daha yeni paylaşımlar daha yuxarıda sıralanır.",
"domain_block_modal.block_account_instead": "@{name} istifadəçisini blokla",
"domain_block_modal.they_can_interact_with_old_posts": "Bu serverdən olan insanlar köhnə paylaşımlarınızla əlaqə qura bilər."
}
2 changes: 2 additions & 0 deletions app/javascript/mastodon/locales/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@
"keyboard_shortcuts.toggle_hidden": "Показване/скриване на текст зад предупреждение на съдържание",
"keyboard_shortcuts.toggle_sensitivity": "Показване/скриване на мултимедията",
"keyboard_shortcuts.toot": "Начало на нова публикация",
"keyboard_shortcuts.translate": "за превод на публикация",
"keyboard_shortcuts.unfocus": "Разфокусиране на текстовото поле за съставяне/търсене",
"keyboard_shortcuts.up": "Преместване нагоре в списъка",
"lightbox.close": "Затваряне",
Expand Down Expand Up @@ -836,6 +837,7 @@
"status.reblogs.empty": "Още никого не е подсилвал публикацията. Подсилващият ще се покаже тук.",
"status.redraft": "Изтриване и преработване",
"status.remove_bookmark": "Премахване на отметката",
"status.remove_favourite": "Премахване от любими",
"status.replied_in_thread": "Отговорено в нишката",
"status.replied_to": "В отговор до {name}",
"status.reply": "Отговор",
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/mastodon/locales/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@
"keyboard_shortcuts.toggle_hidden": "Mostra/amaga el text marcat com a sensible",
"keyboard_shortcuts.toggle_sensitivity": "Mostra/amaga contingut",
"keyboard_shortcuts.toot": "Escriu un nou tut",
"keyboard_shortcuts.translate": "per a traduir una publicació",
"keyboard_shortcuts.unfocus": "Descentra l'àrea de composició de text/cerca",
"keyboard_shortcuts.up": "Apuja a la llista",
"lightbox.close": "Tanca",
Expand Down Expand Up @@ -836,6 +837,7 @@
"status.reblogs.empty": "Encara no ha impulsat ningú aquest tut. Quan algú ho faci, apareixerà aquí.",
"status.redraft": "Esborra i reescriu",
"status.remove_bookmark": "Elimina el marcador",
"status.remove_favourite": "Elimina dels preferits",
"status.replied_in_thread": "Respost al fil",
"status.replied_to": "En resposta a {name}",
"status.reply": "Respon",
Expand Down
Loading

0 comments on commit 15504e6

Please sign in to comment.