From 6aabad9df3b689e9e5ced6db2578e5bab34f47b4 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 2 May 2023 12:47:16 -0500 Subject: [PATCH 01/11] List: prevent long content overflow --- app/soapbox/components/list.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/soapbox/components/list.tsx b/app/soapbox/components/list.tsx index e1b8cdcd9..b56e0e6a7 100644 --- a/app/soapbox/components/list.tsx +++ b/app/soapbox/components/list.tsx @@ -56,8 +56,7 @@ const ListItem: React.FC = ({ label, hint, children, onClick, onSelec return ( = ({ label, hint, children, onClick, onSelec {onClick ? ( - + {children} From 9776cc9623f7268360400ec220de25214e0bb04d Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 2 May 2023 12:50:55 -0500 Subject: [PATCH 02/11] Settings: truncate long usernames --- app/soapbox/features/settings/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/soapbox/features/settings/index.tsx b/app/soapbox/features/settings/index.tsx index 77bb22ef8..6ebc8eacf 100644 --- a/app/soapbox/features/settings/index.tsx +++ b/app/soapbox/features/settings/index.tsx @@ -74,7 +74,7 @@ const Settings = () => { - {displayName} + {displayName} From a38bc912c74a106f8f82665438503a13584353c1 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 2 May 2023 12:51:12 -0500 Subject: [PATCH 03/11] EditProfile: prevent crash with account.source is not available --- app/soapbox/features/edit-profile/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/soapbox/features/edit-profile/index.tsx b/app/soapbox/features/edit-profile/index.tsx index 8483a171e..f45d75afa 100644 --- a/app/soapbox/features/edit-profile/index.tsx +++ b/app/soapbox/features/edit-profile/index.tsx @@ -124,7 +124,7 @@ const accountToCredentials = (account: Account): AccountCredentials => { discoverable: account.discoverable, bot: account.bot, display_name: account.display_name, - note: account.source.get('note'), + note: account.source.get('note', ''), locked: account.locked, fields_attributes: [...account.source.get>('fields', ImmutableList()).toJS()], stranger_notifications: account.getIn(['pleroma', 'notification_settings', 'block_from_strangers']) === true, From be41c78030e0c85363a8fc289cbabcfa4bbeaca5 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 2 May 2023 13:08:11 -0500 Subject: [PATCH 04/11] UserPanel: truncate long acct --- app/soapbox/features/ui/components/user-panel.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/soapbox/features/ui/components/user-panel.tsx b/app/soapbox/features/ui/components/user-panel.tsx index 68165ba24..b6af761a1 100644 --- a/app/soapbox/features/ui/components/user-panel.tsx +++ b/app/soapbox/features/ui/components/user-panel.tsx @@ -71,7 +71,7 @@ const UserPanel: React.FC = ({ accountId, action, badges, domain }) - + @{getAcct(account, fqn)} From ca2dffd9c34023810636f8fa598893fb1862c6dd Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 2 May 2023 13:09:58 -0500 Subject: [PATCH 05/11] ProfileInfoPanel: truncate long username while loading --- app/soapbox/features/ui/components/profile-info-panel.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/soapbox/features/ui/components/profile-info-panel.tsx b/app/soapbox/features/ui/components/profile-info-panel.tsx index 6d407eaab..39128561d 100644 --- a/app/soapbox/features/ui/components/profile-info-panel.tsx +++ b/app/soapbox/features/ui/components/profile-info-panel.tsx @@ -120,7 +120,7 @@ const ProfileInfoPanel: React.FC = ({ account, username }) => - + @{username} From ac9653a89f5e502e803cfd627b6ef7273b635220 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 2 May 2023 13:12:57 -0500 Subject: [PATCH 06/11] UserPanel: truncate long display name --- app/soapbox/features/ui/components/user-panel.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/soapbox/features/ui/components/user-panel.tsx b/app/soapbox/features/ui/components/user-panel.tsx index b6af761a1..08642d801 100644 --- a/app/soapbox/features/ui/components/user-panel.tsx +++ b/app/soapbox/features/ui/components/user-panel.tsx @@ -59,7 +59,7 @@ const UserPanel: React.FC = ({ accountId, action, badges, domain }) - + {verified && } From 9f2540c5c3c96f08fbae47da8d61357a4697dfdb Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 2 May 2023 13:14:45 -0500 Subject: [PATCH 07/11] Modal: truncate long title --- app/soapbox/components/ui/modal/modal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/soapbox/components/ui/modal/modal.tsx b/app/soapbox/components/ui/modal/modal.tsx index 98b001f4c..d7f29303f 100644 --- a/app/soapbox/components/ui/modal/modal.tsx +++ b/app/soapbox/components/ui/modal/modal.tsx @@ -102,7 +102,7 @@ const Modal = React.forwardRef(({ 'flex-row-reverse': closePosition === 'left', })} > -

+

{title}

From 626ddfda807d958e4f5d05ef9b394233c9dcde16 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 2 May 2023 13:28:42 -0500 Subject: [PATCH 08/11] Truncate long usernames in modals --- app/soapbox/actions/moderation.tsx | 2 +- app/soapbox/components/status-action-bar.tsx | 10 +++++----- app/soapbox/features/account/components/header.tsx | 4 ++-- .../features/compose/components/search-results.tsx | 4 ++-- .../features/ui/components/modals/mute-modal.tsx | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/soapbox/actions/moderation.tsx b/app/soapbox/actions/moderation.tsx index c236a2986..cd08fcd2f 100644 --- a/app/soapbox/actions/moderation.tsx +++ b/app/soapbox/actions/moderation.tsx @@ -142,7 +142,7 @@ const deleteStatusModal = (intl: IntlShape, statusId: string, afterConfirm = () dispatch(openModal('CONFIRM', { icon: require('@tabler/icons/trash.svg'), heading: intl.formatMessage(messages.deleteStatusHeading), - message: intl.formatMessage(messages.deleteStatusPrompt, { acct }), + message: intl.formatMessage(messages.deleteStatusPrompt, { acct: {acct} }), confirm: intl.formatMessage(messages.deleteStatusConfirm), onConfirm: () => { dispatch(deleteStatus(statusId)).then(() => { diff --git a/app/soapbox/components/status-action-bar.tsx b/app/soapbox/components/status-action-bar.tsx index 585cc32d9..0f4adb552 100644 --- a/app/soapbox/components/status-action-bar.tsx +++ b/app/soapbox/components/status-action-bar.tsx @@ -258,8 +258,8 @@ const StatusActionBar: React.FC = ({ dispatch(openModal('CONFIRM', { icon: require('@tabler/icons/ban.svg'), - heading: , - message: @{account.get('acct')} }} />, + heading: , + message: @{account.acct} }} />, confirm: intl.formatMessage(messages.blockConfirm), onConfirm: () => dispatch(blockAccount(account.id)), secondary: intl.formatMessage(messages.blockAndReport), @@ -313,7 +313,7 @@ const StatusActionBar: React.FC = ({ dispatch(openModal('CONFIRM', { heading: intl.formatMessage(messages.deleteHeading), - message: intl.formatMessage(messages.deleteFromGroupMessage, { name: account.username }), + message: intl.formatMessage(messages.deleteFromGroupMessage, { name: {account.username} }), confirm: intl.formatMessage(messages.deleteConfirm), onConfirm: () => dispatch(groupDeleteStatus((status.group as Group).id, status.id)), })); @@ -324,7 +324,7 @@ const StatusActionBar: React.FC = ({ dispatch(openModal('CONFIRM', { heading: intl.formatMessage(messages.kickFromGroupHeading), - message: intl.formatMessage(messages.kickFromGroupMessage, { name: account.username }), + message: intl.formatMessage(messages.kickFromGroupMessage, { name: {account.username} }), confirm: intl.formatMessage(messages.kickFromGroupConfirm), onConfirm: () => dispatch(groupKick((status.group as Group).id, account.id)), })); @@ -335,7 +335,7 @@ const StatusActionBar: React.FC = ({ dispatch(openModal('CONFIRM', { heading: intl.formatMessage(messages.blockFromGroupHeading), - message: intl.formatMessage(messages.blockFromGroupMessage, { name: account.username }), + message: intl.formatMessage(messages.blockFromGroupMessage, { name: {account.username} }), confirm: intl.formatMessage(messages.blockFromGroupConfirm), onConfirm: () => dispatch(groupBlock((status.group as Group).id, account.id)), })); diff --git a/app/soapbox/features/account/components/header.tsx b/app/soapbox/features/account/components/header.tsx index 4a589a328..fbdfc3181 100644 --- a/app/soapbox/features/account/components/header.tsx +++ b/app/soapbox/features/account/components/header.tsx @@ -130,7 +130,7 @@ const Header: React.FC = ({ account }) => { dispatch(openModal('CONFIRM', { icon: require('@tabler/icons/ban.svg'), heading: , - message: @{account.acct} }} />, + message: @{account.acct} }} />, confirm: intl.formatMessage(messages.blockConfirm), onConfirm: () => dispatch(blockAccount(account.id)), secondary: intl.formatMessage(messages.blockAndReport), @@ -215,7 +215,7 @@ const Header: React.FC = ({ account }) => { const unfollowModal = getSettings(getState()).get('unfollowModal'); if (unfollowModal) { dispatch(openModal('CONFIRM', { - message: @{account.acct} }} />, + message: @{account.acct} }} />, confirm: intl.formatMessage(messages.removeFromFollowersConfirm), onConfirm: () => dispatch(removeFromFollowers(account.id)), })); diff --git a/app/soapbox/features/compose/components/search-results.tsx b/app/soapbox/features/compose/components/search-results.tsx index 1729def21..0962f7429 100644 --- a/app/soapbox/features/compose/components/search-results.tsx +++ b/app/soapbox/features/compose/components/search-results.tsx @@ -238,11 +238,11 @@ const SearchResults = () => { {filterByAccount ? ( - + {account} }} /> diff --git a/app/soapbox/features/ui/components/modals/mute-modal.tsx b/app/soapbox/features/ui/components/modals/mute-modal.tsx index 5c8dd603e..90f32ec35 100644 --- a/app/soapbox/features/ui/components/modals/mute-modal.tsx +++ b/app/soapbox/features/ui/components/modals/mute-modal.tsx @@ -60,7 +60,7 @@ const MuteModal = () => { @{account.acct} }} + values={{ name: @{account.acct} }} />
From a065df0941a959e8810000896b5e694e15136f41 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 2 May 2023 13:32:31 -0500 Subject: [PATCH 09/11] ReplyIndicator: use Markup component, horizontal scrolling of code blocks, etc --- .../features/compose/components/reply-indicator.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/soapbox/features/compose/components/reply-indicator.tsx b/app/soapbox/features/compose/components/reply-indicator.tsx index a7b762778..fdc7c359b 100644 --- a/app/soapbox/features/compose/components/reply-indicator.tsx +++ b/app/soapbox/features/compose/components/reply-indicator.tsx @@ -2,7 +2,8 @@ import clsx from 'clsx'; import React from 'react'; import AttachmentThumbs from 'soapbox/components/attachment-thumbs'; -import { Stack, Text } from 'soapbox/components/ui'; +import Markup from 'soapbox/components/markup'; +import { Stack } from 'soapbox/components/ui'; import AccountContainer from 'soapbox/containers/account-container'; import { isRtl } from 'soapbox/rtl'; @@ -45,8 +46,8 @@ const ReplyIndicator: React.FC = ({ className, status, hideActi hideActions={hideActions} /> - Date: Tue, 2 May 2023 13:33:55 -0500 Subject: [PATCH 10/11] CHANGELOG: overflow fixes --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b27bae103..9932eeb1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - 18n: fixed Chinese language being detected from the browser. - Conversations: fixed pagination (Mastodon). - Compatibility: fix version parsing for Friendica. +- UI: fixed various overflow issues related to long usernames. +- UI: fixed display of Markdown code blocks in the reply indicator. ## [3.2.0] - 2023-02-15 From 7aac5ccc3404b63291bf5eb544114f6645477110 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 2 May 2023 13:38:47 -0500 Subject: [PATCH 11/11] Add support for Ditto --- CHANGELOG.md | 1 + app/soapbox/utils/features.ts | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9932eeb1f..f83896efc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Posts: Support posts filtering on recent Mastodon versions - Reactions: Support custom emoji reactions - Compatbility: Support Mastodon v2 timeline filters. +- Compatbility: Preliminary support for Ditto backend. - Posts: Support dislikes on Friendica. - UI: added a character counter to some textareas. diff --git a/app/soapbox/utils/features.ts b/app/soapbox/utils/features.ts index 9c5a68bda..04749b5db 100644 --- a/app/soapbox/utils/features.ts +++ b/app/soapbox/utils/features.ts @@ -16,6 +16,12 @@ const overrides = custom('features'); /** Truthy array convenience function */ const any = (arr: Array): boolean => arr.some(Boolean); +/** + * Ditto, a Nostr server with Mastodon API. + * @see {@link https://gitlab.com/soapbox-pub/ditto} + */ +export const DITTO = 'Ditto'; + /** * Friendica, decentralized social platform implementing multiple federation protocols. * @see {@link https://friendi.ca/} @@ -137,6 +143,7 @@ const getInstanceFeatures = (instance: Instance) => { v.software === PLEROMA && gte(v.version, '2.4.50'), v.software === TAKAHE && gte(v.version, '0.6.1'), v.software === TRUTHSOCIAL, + v.software === DITTO, ]), /**