Skip to content

Commit

Permalink
Merge pull request #2841 from ClearlyClaire/glitch-soc/merge-upstream
Browse files Browse the repository at this point in the history
Merge upstream changes up to a021dee
  • Loading branch information
ClearlyClaire authored Sep 12, 2024
2 parents 1436db3 + e2c101e commit 7cfa8bb
Show file tree
Hide file tree
Showing 64 changed files with 501 additions and 163 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ GEM
nokogiri (1.16.7)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
oj (3.16.5)
oj (3.16.6)
bigdecimal (>= 3.0)
ostruct (>= 0.2)
omniauth (2.1.2)
Expand Down
12 changes: 7 additions & 5 deletions app/javascript/flavours/glitch/components/status_prepend.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,13 @@ export default class StatusPrepend extends PureComponent {

return !type ? null : (
<aside className={type === 'reblogged_by' || type === 'featured' ? 'status__prepend' : 'notification__message'}>
<Icon
className={`status__prepend-icon ${type === 'favourite' ? 'star-icon' : ''}`}
id={iconId}
icon={iconComponent}
/>
<div className='status__prepend__icon'>
<Icon
className={type === 'favourite' ? 'star-icon' : null}
id={iconId}
icon={iconComponent}
/>
</div>
<Message />
{children}
</aside>
Expand Down
50 changes: 50 additions & 0 deletions app/javascript/flavours/glitch/components/status_thread_label.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { FormattedMessage } from 'react-intl';

import ReplyIcon from '@/material-icons/400-24px/reply.svg?react';
import { Icon } from 'flavours/glitch/components/icon';
import { DisplayedName } from 'flavours/glitch/features/notifications_v2/components/displayed_name';
import { useAppSelector } from 'flavours/glitch/store';

export const StatusThreadLabel: React.FC<{
accountId: string;
inReplyToAccountId: string;
}> = ({ accountId, inReplyToAccountId }) => {
const inReplyToAccount = useAppSelector((state) =>
state.accounts.get(inReplyToAccountId),
);

let label;

if (accountId === inReplyToAccountId) {
label = (
<FormattedMessage
id='status.continued_thread'
defaultMessage='Continued thread'
/>
);
} else if (inReplyToAccount) {
label = (
<FormattedMessage
id='status.replied_to'
defaultMessage='Replied to {name}'
values={{ name: <DisplayedName accountIds={[inReplyToAccountId]} /> }}
/>
);
} else {
label = (
<FormattedMessage
id='status.replied_in_thread'
defaultMessage='Replied in thread'
/>
);
}

return (
<div className='status__prepend'>
<div className='status__prepend__icon'>
<Icon id='reply' icon={ReplyIcon} />
</div>
{label}
</div>
);
};
22 changes: 18 additions & 4 deletions app/javascript/flavours/glitch/styles/components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1776,15 +1776,29 @@ body > [data-popper-placement] {
.status__prepend {
padding: 8px 14px; // glitch: reduced padding
padding-bottom: 0;
display: inline-flex;
gap: 10px;
display: flex;
align-items: center;
gap: 8px;
font-size: 14px;
line-height: 22px;
font-weight: 500;
color: $dark-text-color;

.status__display-name strong {
color: $dark-text-color;
&__icon {
display: flex;
align-items: center;
justify-content: center;
flex: 0 0 auto;

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

a {
color: inherit;
text-decoration: none;
}

> span {
Expand Down
17 changes: 6 additions & 11 deletions app/javascript/mastodon/components/status.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { HotKeys } from 'react-hotkeys';
import AlternateEmailIcon from '@/material-icons/400-24px/alternate_email.svg?react';
import PushPinIcon from '@/material-icons/400-24px/push_pin.svg?react';
import RepeatIcon from '@/material-icons/400-24px/repeat.svg?react';
import ReplyIcon from '@/material-icons/400-24px/reply.svg?react';
import { ContentWarning } from 'mastodon/components/content_warning';
import { FilterWarning } from 'mastodon/components/filter_warning';
import { Icon } from 'mastodon/components/icon';
Expand All @@ -34,6 +33,7 @@ import { getHashtagBarForStatus } from './hashtag_bar';
import { RelativeTimestamp } from './relative_timestamp';
import StatusActionBar from './status_action_bar';
import StatusContent from './status_content';
import { StatusThreadLabel } from './status_thread_label';
import { VisibilityIcon } from './visibility_icon';

const domParser = new DOMParser();
Expand Down Expand Up @@ -413,7 +413,7 @@ class Status extends ImmutablePureComponent {
if (featured) {
prepend = (
<div className='status__prepend'>
<div className='status__prepend-icon-wrapper'><Icon id='thumb-tack' icon={PushPinIcon} className='status__prepend-icon' /></div>
<div className='status__prepend__icon'><Icon id='thumb-tack' icon={PushPinIcon} /></div>
<FormattedMessage id='status.pinned' defaultMessage='Pinned post' />
</div>
);
Expand All @@ -422,7 +422,7 @@ class Status extends ImmutablePureComponent {

prepend = (
<div className='status__prepend'>
<div className='status__prepend-icon-wrapper'><Icon id='retweet' icon={RepeatIcon} className='status__prepend-icon' /></div>
<div className='status__prepend__icon'><Icon id='retweet' icon={RepeatIcon} /></div>
<FormattedMessage id='status.reblogged_by' defaultMessage='{name} boosted' values={{ name: <a onClick={this.handlePrependAccountClick} data-id={status.getIn(['account', 'id'])} data-hover-card-account={status.getIn(['account', 'id'])} href={`/@${status.getIn(['account', 'acct'])}`} className='status__display-name muted'><bdi><strong dangerouslySetInnerHTML={display_name_html} /></bdi></a> }} />
</div>
);
Expand All @@ -434,18 +434,13 @@ class Status extends ImmutablePureComponent {
} else if (status.get('visibility') === 'direct') {
prepend = (
<div className='status__prepend'>
<div className='status__prepend-icon-wrapper'><Icon id='at' icon={AlternateEmailIcon} className='status__prepend-icon' /></div>
<div className='status__prepend__icon'><Icon id='at' icon={AlternateEmailIcon} /></div>
<FormattedMessage id='status.direct_indicator' defaultMessage='Private mention' />
</div>
);
} else if (showThread && status.get('in_reply_to_id') && status.get('in_reply_to_account_id') === status.getIn(['account', 'id'])) {
const display_name_html = { __html: status.getIn(['account', 'display_name_html']) };

} else if (showThread && status.get('in_reply_to_id')) {
prepend = (
<div className='status__prepend'>
<div className='status__prepend-icon-wrapper'><Icon id='reply' icon={ReplyIcon} className='status__prepend-icon' /></div>
<FormattedMessage id='status.replied_to' defaultMessage='Replied to {name}' values={{ name: <a onClick={this.handlePrependAccountClick} data-id={status.getIn(['account', 'id'])} data-hover-card-account={status.getIn(['account', 'id'])} href={`/@${status.getIn(['account', 'acct'])}`} className='status__display-name muted'><bdi><strong dangerouslySetInnerHTML={display_name_html} /></bdi></a> }} />
</div>
<StatusThreadLabel accountId={status.getIn(['account', 'id'])} inReplyToAccountId={status.get('in_reply_to_account_id')} />
);
}

Expand Down
50 changes: 50 additions & 0 deletions app/javascript/mastodon/components/status_thread_label.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { FormattedMessage } from 'react-intl';

import ReplyIcon from '@/material-icons/400-24px/reply.svg?react';
import { Icon } from 'mastodon/components/icon';
import { DisplayedName } from 'mastodon/features/notifications_v2/components/displayed_name';
import { useAppSelector } from 'mastodon/store';

export const StatusThreadLabel: React.FC<{
accountId: string;
inReplyToAccountId: string;
}> = ({ accountId, inReplyToAccountId }) => {
const inReplyToAccount = useAppSelector((state) =>
state.accounts.get(inReplyToAccountId),
);

let label;

if (accountId === inReplyToAccountId) {
label = (
<FormattedMessage
id='status.continued_thread'
defaultMessage='Continued thread'
/>
);
} else if (inReplyToAccount) {
label = (
<FormattedMessage
id='status.replied_to'
defaultMessage='Replied to {name}'
values={{ name: <DisplayedName accountIds={[inReplyToAccountId]} /> }}
/>
);
} else {
label = (
<FormattedMessage
id='status.replied_in_thread'
defaultMessage='Replied in thread'
/>
);
}

return (
<div className='status__prepend'>
<div className='status__prepend__icon'>
<Icon id='reply' icon={ReplyIcon} />
</div>
{label}
</div>
);
};
2 changes: 2 additions & 0 deletions app/javascript/mastodon/locales/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,7 @@
"status.bookmark": "Marca",
"status.cancel_reblog_private": "Desfés l'impuls",
"status.cannot_reblog": "No es pot impulsar aquest tut",
"status.continued_thread": "Continuació del fil",
"status.copy": "Copia l'enllaç al tut",
"status.delete": "Elimina",
"status.detailed_status": "Vista detallada de la conversa",
Expand Down Expand Up @@ -813,6 +814,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.replied_in_thread": "Respost al fil",
"status.replied_to": "En resposta a {name}",
"status.reply": "Respon",
"status.replyAll": "Respon al fil",
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/mastodon/locales/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,7 @@
"status.bookmark": "Bogmærk",
"status.cancel_reblog_private": "Fjern boost",
"status.cannot_reblog": "Dette indlæg kan ikke fremhæves",
"status.continued_thread": "Fortsat tråd",
"status.copy": "Kopiér link til indlæg",
"status.delete": "Slet",
"status.detailed_status": "Detaljeret samtalevisning",
Expand Down Expand Up @@ -813,6 +814,7 @@
"status.reblogs.empty": "Ingen har endnu fremhævet dette indlæg. Når nogen gør, vil det fremgå hér.",
"status.redraft": "Slet og omformulér",
"status.remove_bookmark": "Fjern bogmærke",
"status.replied_in_thread": "Svaret i tråd",
"status.replied_to": "Besvarede {name}",
"status.reply": "Besvar",
"status.replyAll": "Besvar alle",
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/mastodon/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,7 @@
"status.bookmark": "Beitrag als Lesezeichen setzen",
"status.cancel_reblog_private": "Beitrag nicht mehr teilen",
"status.cannot_reblog": "Dieser Beitrag kann nicht geteilt werden",
"status.continued_thread": "Fortgeführter Thread",
"status.copy": "Link zum Beitrag kopieren",
"status.delete": "Beitrag löschen",
"status.detailed_status": "Detaillierte Ansicht der Unterhaltung",
Expand Down Expand Up @@ -813,6 +814,7 @@
"status.reblogs.empty": "Diesen Beitrag hat bisher noch niemand geteilt. Sobald es jemand tut, wird das Profil hier erscheinen.",
"status.redraft": "Löschen und neu erstellen",
"status.remove_bookmark": "Lesezeichen entfernen",
"status.replied_in_thread": "Antwortete im Thread",
"status.replied_to": "Antwortete {name}",
"status.reply": "Antworten",
"status.replyAll": "Allen antworten",
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/mastodon/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,7 @@
"status.bookmark": "Bookmark",
"status.cancel_reblog_private": "Unboost",
"status.cannot_reblog": "This post cannot be boosted",
"status.continued_thread": "Continued thread",
"status.copy": "Copy link to post",
"status.delete": "Delete",
"status.detailed_status": "Detailed conversation view",
Expand Down Expand Up @@ -813,6 +814,7 @@
"status.reblogs.empty": "No one has boosted this post yet. When someone does, they will show up here.",
"status.redraft": "Delete & re-draft",
"status.remove_bookmark": "Remove bookmark",
"status.replied_in_thread": "Replied in thread",
"status.replied_to": "Replied to {name}",
"status.reply": "Reply",
"status.replyAll": "Reply to thread",
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/mastodon/locales/es-AR.json
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,7 @@
"status.bookmark": "Marcar",
"status.cancel_reblog_private": "Quitar adhesión",
"status.cannot_reblog": "No se puede adherir a este mensaje",
"status.continued_thread": "Continuación de hilo",
"status.copy": "Copiar enlace al mensaje",
"status.delete": "Eliminar",
"status.detailed_status": "Vista de conversación detallada",
Expand Down Expand Up @@ -813,6 +814,7 @@
"status.reblogs.empty": "Todavía nadie adhirió a este mensaje. Cuando alguien lo haga, se mostrará acá.",
"status.redraft": "Eliminar mensaje original y editarlo",
"status.remove_bookmark": "Quitar marcador",
"status.replied_in_thread": "Respuesta en hilo",
"status.replied_to": "Respondió a {name}",
"status.reply": "Responder",
"status.replyAll": "Responder al hilo",
Expand Down
4 changes: 3 additions & 1 deletion app/javascript/mastodon/locales/fi.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"about.blocks": "Moderoidut palvelimet",
"about.contact": "Yhteystiedot:",
"about.contact": "Yhteydenotto:",
"about.disclaimer": "Mastodon on vapaa avoimen lähdekoodin ohjelmisto ja Mastodon gGmbH:n tavaramerkki.",
"about.domain_blocks.no_reason_available": "Syy ei ole tiedossa",
"about.domain_blocks.preamble": "Mastodonin avulla voi yleensä tarkastella minkä tahansa fediversumiin kuuluvan palvelimen sisältöä ja olla yhteyksissä eri palvelinten käyttäjien kanssa. Nämä poikkeukset koskevat yksin tätä palvelinta.",
Expand Down Expand Up @@ -780,6 +780,7 @@
"status.bookmark": "Lisää kirjanmerkki",
"status.cancel_reblog_private": "Peru tehostus",
"status.cannot_reblog": "Tätä julkaisua ei voi tehostaa",
"status.continued_thread": "Jatkoi ketjua",
"status.copy": "Kopioi linkki julkaisuun",
"status.delete": "Poista",
"status.detailed_status": "Yksityiskohtainen keskustelunäkymä",
Expand Down Expand Up @@ -813,6 +814,7 @@
"status.reblogs.empty": "Kukaan ei ole vielä tehostanut tätä julkaisua. Kun joku tekee niin, tulee hän tähän näkyviin.",
"status.redraft": "Poista ja palauta muokattavaksi",
"status.remove_bookmark": "Poista kirjanmerkki",
"status.replied_in_thread": "Vastasi ketjuun",
"status.replied_to": "Vastaus käyttäjälle {name}",
"status.reply": "Vastaa",
"status.replyAll": "Vastaa ketjuun",
Expand Down
12 changes: 7 additions & 5 deletions app/javascript/mastodon/locales/gl.json
Original file line number Diff line number Diff line change
Expand Up @@ -223,16 +223,16 @@
"domain_block_modal.title": "Bloquear dominio?",
"domain_block_modal.you_will_lose_followers": "Vanse eliminar todas as túas seguidoras deste servidor.",
"domain_block_modal.you_wont_see_posts": "Non verás publicacións ou notificacións das usuarias deste servidor.",
"domain_pill.activitypub_lets_connect": "Permíteche conectar e interactuar con persoas non só de Mastodon, se non tamén con outras apps sociais.",
"domain_pill.activitypub_lets_connect": "Permíteche conectar e interactuar con persoas non só de Mastodon, se non tamén con outras sociais.",
"domain_pill.activitypub_like_language": "ActivityPub é algo así como o idioma que Mastodon fala con outras redes sociais.",
"domain_pill.server": "Servidor",
"domain_pill.their_handle": "O seu alcume:",
"domain_pill.their_server": "O seu fogar dixital, onde están as súas publicacións.",
"domain_pill.their_username": "O seu identificador único no seu servidor. É posible atopar usuarias co mesmo nome de usuaria en diferentes servidores.",
"domain_pill.username": "Nome de usuaria",
"domain_pill.whats_in_a_handle": "As partes do alcume?",
"domain_pill.who_they_are": "O alcume dinos quen é esa persoa e onde está, para que poidas interactuar con ela en toda a web social de <button>plataformas ActivityPub</button>.",
"domain_pill.who_you_are": "Como o teu alcume informa de quen es e onde estás, as persoas poden interactuar contigo desde toda a web social de <button>plataformas ActivityPub</button>.",
"domain_pill.who_they_are": "O alcume dinos quen é esa persoa e onde está, para que poidas interactuar con ela en toda a web social das <button>plataformas ActivityPub</button>.",
"domain_pill.who_you_are": "Como o teu alcume informa de quen es e onde estás, as persoas poden interactuar contigo desde toda a web social das <button>plataformas ActivityPub</button>.",
"domain_pill.your_handle": "O teu alcume:",
"domain_pill.your_server": "O teu fogar dixital, onde están as túas publicacións. Non é do teu agrado? Podes cambiar de servidor cando queiras levando as túas seguidoras contigo.",
"domain_pill.your_username": "O teu identificador único neste servidor. É posible que atopes usuarias co mesmo nome de usuaria en outros servidores.",
Expand Down Expand Up @@ -272,7 +272,7 @@
"empty_column.list": "Aínda non hai nada nesta listaxe. Cando as usuarias incluídas na listaxe publiquen mensaxes, amosaranse aquí.",
"empty_column.lists": "Aínda non tes listaxes. Cando crees unha, amosarase aquí.",
"empty_column.mutes": "Aínda non silenciaches a ningúnha usuaria.",
"empty_column.notification_requests": "Todo ben! Nada por aquí. Cando recibas novas notificación aparecerán aquí seguindo o criterio dos teus axustes.",
"empty_column.notification_requests": "Todo ben! Nada por aquí. Cando recibas novas notificacións aparecerán aquí seguindo o criterio dos teus axustes.",
"empty_column.notifications": "Aínda non tes notificacións. Aparecerán cando outras persoas interactúen contigo.",
"empty_column.public": "Nada por aquí! Escribe algo de xeito público, ou segue de xeito manual usuarias doutros servidores para ir enchéndoo",
"error.unexpected_crash.explanation": "Debido a un erro no noso código ou a unha compatilidade co teu navegador, esta páxina non pode ser amosada correctamente.",
Expand Down Expand Up @@ -641,7 +641,7 @@
"onboarding.steps.publish_status.title": "Escribe a túa primeira publicación",
"onboarding.steps.setup_profile.body": "Ao engadir información ao teu perfil é máis probable que teñas máis interaccións.",
"onboarding.steps.setup_profile.title": "Personaliza o perfil",
"onboarding.steps.share_profile.body": "Dille ás amizades como poden atoparte en Mastodon!",
"onboarding.steps.share_profile.body": "Dille ás amizades como poden atoparte en Mastodon.",
"onboarding.steps.share_profile.title": "Comparte o teu perfil en Mastodon",
"onboarding.tips.2fa": "<strong>Sabes que?</strong> Podes protexer a túa conta configurando un segundo factor de autenticación nos axustes. Funciona con calquera app TOTP, non precisas un número de teléfono!",
"onboarding.tips.accounts_from_other_servers": "<strong>Sabes que?</strong> Como Mastodon é descentralizado, algúns perfís que atopes estarán en servidores diferentes ao teu. Pero podes interactuar igualmente con eles! O seu servidor é o que ven despois da @ no seu identificador!",
Expand Down Expand Up @@ -780,6 +780,7 @@
"status.bookmark": "Marcar",
"status.cancel_reblog_private": "Desfacer compartido",
"status.cannot_reblog": "Esta publicación non pode ser promovida",
"status.continued_thread": "Continua co fío",
"status.copy": "Copiar ligazón á publicación",
"status.delete": "Eliminar",
"status.detailed_status": "Vista detallada da conversa",
Expand Down Expand Up @@ -813,6 +814,7 @@
"status.reblogs.empty": "Aínda ninguén promoveu esta publicación. Cando alguén o faga, amosarase aquí.",
"status.redraft": "Eliminar e reescribir",
"status.remove_bookmark": "Eliminar marcador",
"status.replied_in_thread": "Respondeu nun fío",
"status.replied_to": "Respondeu a {name}",
"status.reply": "Responder",
"status.replyAll": "Responder ao tema",
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/mastodon/locales/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,7 @@
"status.bookmark": "סימניה",
"status.cancel_reblog_private": "הסרת הדהוד",
"status.cannot_reblog": "לא ניתן להדהד חצרוץ זה",
"status.continued_thread": "שרשור מתמשך",
"status.copy": "העתק/י קישור להודעה זו",
"status.delete": "מחיקה",
"status.detailed_status": "תצוגת שיחה מפורטת",
Expand Down Expand Up @@ -813,6 +814,7 @@
"status.reblogs.empty": "עוד לא הידהדו את ההודעה הזו. כאשר זה יקרה, ההדהודים יופיעו כאן.",
"status.redraft": "מחיקה ועריכה מחדש",
"status.remove_bookmark": "הסרת סימניה",
"status.replied_in_thread": "תגובה לשרשור",
"status.replied_to": "בתגובה לחשבון {name}",
"status.reply": "תגובה",
"status.replyAll": "תגובה לשרשור",
Expand Down
Loading

0 comments on commit 7cfa8bb

Please sign in to comment.