Mastodon does not offer the functionality to group notifications like Twitter does, therefore the best solution is to collapse more content by default, assuming users roughly remember what they have tooted
This commit is contained in:
xmflsct 2022-12-10 23:24:41 +01:00
parent 36bbe5bdbd
commit 1ece7b3fe3
2 changed files with 14 additions and 4 deletions

View File

@ -108,7 +108,10 @@ const TimelineNotifications: React.FC<Props> = ({
paddingLeft: highlighted ? 0 : StyleConstants.Avatar.M + StyleConstants.Spacing.S
}}
>
<TimelineContent setSpoilerExpanded={setSpoilerExpanded} />
<TimelineContent
notificationOwnToot={['favourite', 'reblog'].includes(notification.type)}
setSpoilerExpanded={setSpoilerExpanded}
/>
<TimelinePoll />
<TimelineAttachment />
<TimelineCard />

View File

@ -6,10 +6,11 @@ import { useSelector } from 'react-redux'
import StatusContext from './Context'
export interface Props {
notificationOwnToot?: boolean
setSpoilerExpanded?: React.Dispatch<React.SetStateAction<boolean>>
}
const TimelineContent: React.FC<Props> = ({ setSpoilerExpanded }) => {
const TimelineContent: React.FC<Props> = ({ notificationOwnToot = false, setSpoilerExpanded }) => {
const { status, highlighted, disableDetails } = useContext(StatusContext)
if (!status || typeof status.content !== 'string' || !status.content.length) return null
@ -38,7 +39,13 @@ const TimelineContent: React.FC<Props> = ({ setSpoilerExpanded }) => {
emojis={status.emojis}
mentions={status.mentions}
tags={status.tags}
numberOfLines={instanceAccount.preferences['reading:expand:spoilers'] ? 999 : 1}
numberOfLines={
instanceAccount.preferences['reading:expand:spoilers']
? notificationOwnToot
? 2
: 999
: 1
}
expandHint={t('shared.content.expandHint')}
setSpoilerExpanded={setSpoilerExpanded}
highlighted={highlighted}
@ -53,7 +60,7 @@ const TimelineContent: React.FC<Props> = ({ setSpoilerExpanded }) => {
emojis={status.emojis}
mentions={status.mentions}
tags={status.tags}
numberOfLines={highlighted ? 999 : undefined}
numberOfLines={highlighted ? 999 : notificationOwnToot ? 2 : undefined}
disableDetails={disableDetails}
/>
)}