Skip to content

Commit

Permalink
Merge pull request #2958 from ClearlyClaire/glitch-soc/merge-upstream
Browse files Browse the repository at this point in the history
Merge upstream changes up to 2beab34
  • Loading branch information
ClearlyClaire authored Jan 29, 2025
2 parents b740b17 + 73f599a commit 65caf6c
Show file tree
Hide file tree
Showing 20 changed files with 129 additions and 97 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ GEM
opentelemetry-instrumentation-rack (0.26.0)
opentelemetry-api (~> 1.0)
opentelemetry-instrumentation-base (~> 0.23.0)
opentelemetry-instrumentation-rails (0.35.0)
opentelemetry-instrumentation-rails (0.35.1)
opentelemetry-api (~> 1.0)
opentelemetry-instrumentation-action_mailer (~> 0.4.0)
opentelemetry-instrumentation-action_pack (~> 0.11.0)
Expand Down
14 changes: 11 additions & 3 deletions app/javascript/flavours/glitch/components/load_gap.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { useCallback } from 'react';
import { useCallback, useState } from 'react';

import { useIntl, defineMessages } from 'react-intl';

import MoreHorizIcon from '@/material-icons/400-24px/more_horiz.svg?react';
import { Icon } from 'flavours/glitch/components/icon';
import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator';

const messages = defineMessages({
load_more: { id: 'status.load_more', defaultMessage: 'Load more' },
Expand All @@ -17,19 +18,26 @@ interface Props<T> {

export const LoadGap = <T,>({ disabled, param, onClick }: Props<T>) => {
const intl = useIntl();
const [loading, setLoading] = useState(false);

const handleClick = useCallback(() => {
setLoading(true);
onClick(param);
}, [param, onClick]);
}, [setLoading, param, onClick]);

return (
<button
className='load-more load-gap'
disabled={disabled}
onClick={handleClick}
aria-label={intl.formatMessage(messages.load_more)}
title={intl.formatMessage(messages.load_more)}
>
<Icon id='ellipsis-h' icon={MoreHorizIcon} />
{loading ? (
<LoadingIndicator />
) : (
<Icon id='ellipsis-h' icon={MoreHorizIcon} />
)}
</button>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ const guessLanguage = (text) => {

export const debouncedGuess = debounce((text, setGuess) => {
setGuess(guessLanguage(text));
}, 500, { leading: true, trailing: true });
}, 500, { maxWait: 1500, leading: true, trailing: true });
19 changes: 14 additions & 5 deletions app/javascript/flavours/glitch/styles/components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4105,23 +4105,27 @@ a.status-card {
}

.load-more {
display: block;
display: flex;
align-items: center;
justify-content: center;
color: $dark-text-color;
background-color: transparent;
border: 0;
font-size: inherit;
text-align: center;
line-height: inherit;
margin: 0;
width: 100%;
padding: 15px;
box-sizing: border-box;
width: 100%;
clear: both;
text-decoration: none;

&:hover {
background: var(--on-surface-color);
}

.icon {
width: 22px;
height: 22px;
}
}

.load-gap {
Expand Down Expand Up @@ -4643,6 +4647,7 @@ a.status-card {
justify-content: center;
}

.load-more .loading-indicator,
.button .loading-indicator {
position: static;
transform: none;
Expand All @@ -4654,6 +4659,10 @@ a.status-card {
}
}

.load-more .loading-indicator .circular-progress {
color: lighten($ui-base-color, 26%);
}

.circular-progress {
color: lighten($ui-base-color, 26%);
animation: 1.4s linear 0s infinite normal none running simple-rotate;
Expand Down
14 changes: 11 additions & 3 deletions app/javascript/mastodon/components/load_gap.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { useCallback } from 'react';
import { useCallback, useState } from 'react';

import { useIntl, defineMessages } from 'react-intl';

import MoreHorizIcon from '@/material-icons/400-24px/more_horiz.svg?react';
import { Icon } from 'mastodon/components/icon';
import { LoadingIndicator } from 'mastodon/components/loading_indicator';

const messages = defineMessages({
load_more: { id: 'status.load_more', defaultMessage: 'Load more' },
Expand All @@ -17,19 +18,26 @@ interface Props<T> {

export const LoadGap = <T,>({ disabled, param, onClick }: Props<T>) => {
const intl = useIntl();
const [loading, setLoading] = useState(false);

const handleClick = useCallback(() => {
setLoading(true);
onClick(param);
}, [param, onClick]);
}, [setLoading, param, onClick]);

return (
<button
className='load-more load-gap'
disabled={disabled}
onClick={handleClick}
aria-label={intl.formatMessage(messages.load_more)}
title={intl.formatMessage(messages.load_more)}
>
<Icon id='ellipsis-h' icon={MoreHorizIcon} />
{loading ? (
<LoadingIndicator />
) : (
<Icon id='ellipsis-h' icon={MoreHorizIcon} />
)}
</button>
);
};
2 changes: 1 addition & 1 deletion app/javascript/mastodon/components/status.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ class Status extends ImmutablePureComponent {
const { onToggleHidden } = this.props;
const status = this._properStatus();

if (status.get('matched_filters')) {
if (this.props.status.get('matched_filters')) {
const expandedBecauseOfCW = !status.get('hidden') || status.get('spoiler_text').length === 0;
const expandedBecauseOfFilter = this.state.showDespiteFilter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ const guessLanguage = (text) => {

export const debouncedGuess = debounce((text, setGuess) => {
setGuess(guessLanguage(text));
}, 500, { leading: true, trailing: true });
}, 500, { maxWait: 1500, leading: true, trailing: true });
4 changes: 4 additions & 0 deletions app/javascript/mastodon/locales/sk.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@
"alert.unexpected.message": "Vyskytla sa nečakaná chyba.",
"alert.unexpected.title": "Ups!",
"alt_text_badge.title": "Alternatívny popis",
"alt_text_modal.add_text_from_image": "Pridaj text z obrázka",
"alt_text_modal.cancel": "Zrušiť",
"alt_text_modal.done": "Hotovo",
"announcement.announcement": "Oznámenie",
"annual_report.summary.archetype.oracle": "Veštec",
"annual_report.summary.followers.followers": "sledovatelia",
Expand Down Expand Up @@ -378,6 +381,7 @@
"ignore_notifications_modal.not_followers_title": "Nevšímať si oznámenia od ľudí, ktorí ťa nenasledujú?",
"ignore_notifications_modal.not_following_title": "Nevšímať si oznámenia od ľudí, ktorých nenasleduješ?",
"ignore_notifications_modal.private_mentions_title": "Nevšímať si oznámenia o nevyžiadaných súkromných spomínaniach?",
"info_button.label": "Pomoc",
"interaction_modal.action.favourite": "Pre pokračovanie si musíš obľúbiť zo svojho účtu.",
"interaction_modal.action.follow": "Pre pokračovanie musíš nasledovať zo svojho účtu.",
"interaction_modal.action.reply": "Pre pokračovanie musíš odpovedať s tvojho účtu.",
Expand Down
19 changes: 14 additions & 5 deletions app/javascript/styles/mastodon/components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4028,23 +4028,27 @@ a.status-card {
}

.load-more {
display: block;
display: flex;
align-items: center;
justify-content: center;
color: $dark-text-color;
background-color: transparent;
border: 0;
font-size: inherit;
text-align: center;
line-height: inherit;
margin: 0;
width: 100%;
padding: 15px;
box-sizing: border-box;
width: 100%;
clear: both;
text-decoration: none;

&:hover {
background: var(--on-surface-color);
}

.icon {
width: 22px;
height: 22px;
}
}

.load-gap {
Expand Down Expand Up @@ -4421,6 +4425,7 @@ a.status-card {
justify-content: center;
}

.load-more .loading-indicator,
.button .loading-indicator {
position: static;
transform: none;
Expand All @@ -4432,6 +4437,10 @@ a.status-card {
}
}

.load-more .loading-indicator .circular-progress {
color: lighten($ui-base-color, 26%);
}

.circular-progress {
color: lighten($ui-base-color, 26%);
animation: 1.4s linear 0s infinite normal none running simple-rotate;
Expand Down
5 changes: 4 additions & 1 deletion app/lib/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,11 @@ def initialize(verb, url, **options)
max_hops: 3,
on_redirect: ->(response, request) { re_sign_on_redirect(response, request) },
},
}.merge(options).merge(
socket_class: use_proxy? || @allow_local ? ProxySocket : Socket,
}.merge(options)
timeout_class: PerOperationWithDeadline,
timeout_options: TIMEOUT
)
@options = @options.merge(proxy_url) if use_proxy?
@headers = {}

Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/invites/_invite.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.input-copy
.input-copy__wrapper
= copyable_input value: public_invite_url(invite_code: invite.code)
%button{ type: :button }= t('generic.copy')
%button.button{ type: :button }= t('generic.copy')

%td
.name-tag
Expand Down
2 changes: 1 addition & 1 deletion app/views/invites/_invite.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.input-copy
.input-copy__wrapper
= copyable_input value: public_invite_url(invite_code: invite.code)
%button{ type: :button }= t('generic.copy')
%button.button{ type: :button }= t('generic.copy')

- if invite.valid_for_use?
%td
Expand Down
3 changes: 2 additions & 1 deletion app/views/mail_subscriptions/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
= form.hidden_field :type,
value: params[:type]
= form.button t('mail_subscriptions.unsubscribe.action'),
type: :submit
type: :submit,
class: 'btn'
5 changes: 3 additions & 2 deletions app/views/oauth/authorizations/new.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
= form.hidden_field :scope,
value: @pre_auth.scope
= form.button t('doorkeeper.authorizations.buttons.authorize'),
type: :submit
type: :submit,
class: 'btn'

= form_with url: oauth_authorization_path, method: :delete do |form|
= form.hidden_field :client_id,
Expand All @@ -52,4 +53,4 @@
value: @pre_auth.scope
= form.button t('doorkeeper.authorizations.buttons.deny'),
type: :submit,
class: 'negative'
class: 'btn negative'
2 changes: 1 addition & 1 deletion app/views/oauth/authorizations/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
.input-copy
.input-copy__wrapper
= copyable_input value: params[:code], class: 'oauth-code'
%button{ type: :button }= t('generic.copy')
%button.button{ type: :button }= t('generic.copy')
4 changes: 2 additions & 2 deletions app/views/settings/verifications/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
.input-copy.lead
.input-copy__wrapper
= copyable_input value: link_to('Mastodon', ActivityPub::TagManager.instance.url_for(@account), rel: :me)
%button{ type: :button }= t('generic.copy')
%button.button{ type: :button }= t('generic.copy')

%p.lead= t('verification.extra_instructions_html')

Expand Down Expand Up @@ -60,7 +60,7 @@
.input-copy.lead
.input-copy__wrapper
= copyable_input value: tag.meta(name: 'fediverse:creator', content: "@#{@account.local_username_and_domain}")
%button{ type: :button }= t('generic.copy')
%button.button{ type: :button }= t('generic.copy')

%p.lead= t('author_attribution.then_instructions')

Expand Down
1 change: 1 addition & 0 deletions config/locales/nn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,7 @@ nn:
too_fast: Skjemaet ble sendt inn for raskt, prøv på nytt.
use_security_key: Bruk sikkerhetsnøkkel
user_agreement_html: Eg godtek <a href="%{terms_of_service_path}" target="_blank">bruksvilkåra</a> og <a href="%{privacy_policy_path}" target="_blank">personvernvllkåra</a>
user_privacy_agreement_html: Eg har lese og godtar <a href="%{privacy_policy_path}" target="_blank">personvernerklæringa</a>
author_attribution:
example_title: Eksempeltekst
hint_html: Skriv du nyhende eller blogginnlegg utanfor Mastodon? Her kan du kontrollera korleis du blir kreditert når artiklane dine blir delte på Mastodon.
Expand Down
68 changes: 0 additions & 68 deletions spec/controllers/admin/email_domain_blocks_controller_spec.rb

This file was deleted.

Loading

0 comments on commit 65caf6c

Please sign in to comment.