Improved history diff

This commit is contained in:
xmflsct 2023-01-04 23:12:18 +01:00
parent 06324ee51a
commit bb9fa0c752
5 changed files with 37 additions and 8 deletions

View File

@ -1,4 +1,5 @@
Enjoy toooting! This version includes following improvements and fixes:
- Auto fetch remote content in conversations!
- Allowing adding more context of reports
- Option to disable autoplay gif
- Hide boosts from users

View File

@ -1,4 +1,5 @@
toooting愉快此版本包括以下改进和修复
- 主动获取对话的远程内容
- 可添加举报细节
- 新增暂停自动播放gif动画选项
- 隐藏用户的转嘟

View File

@ -7,11 +7,11 @@ import { useTranslation } from 'react-i18next'
import StatusContext from '../Context'
const HeaderSharedApplication: React.FC = () => {
const { status } = useContext(StatusContext)
const { status, isConversation } = useContext(StatusContext)
const { colors } = useTheme()
const { t } = useTranslation('componentTimeline')
return status?.application?.name && status.application.name !== 'Web' ? (
return !isConversation && status?.application?.name && status.application.name !== 'Web' ? (
<CustomText
fontStyle='S'
accessibilityRole='link'

View File

@ -50,6 +50,17 @@ const ContentView: React.FC<{
const changesContent = withoutBoundary
? diffChars(removeHTML(prevItem?.content || item.content), removeHTML(item.content))
: diffWords(removeHTML(prevItem?.content || item.content), removeHTML(item.content))
const changesPoll = item.poll
? item.poll.options.map((option, index) =>
withoutBoundary
? prevItem?.poll?.options[index].title
? diffChars(prevItem?.poll?.options[index].title, option.title)
: undefined
: prevItem?.poll?.options[index].title
? diffWords(prevItem?.poll?.options[index].title, option.title)
: undefined
)
: null
return (
// @ts-ignore
@ -92,12 +103,28 @@ const ContentView: React.FC<{
paddingTop: StyleConstants.Font.LineHeight.M - StyleConstants.Font.Size.M,
marginRight: StyleConstants.Spacing.S
}}
name='Circle'
name={item.poll?.multiple ? 'Square' : 'Circle'}
size={StyleConstants.Font.Size.M}
color={colors.disabled}
color={
prevItem?.poll?.multiple !== item.poll?.multiple ? colors.red : colors.disabled
}
/>
<CustomText style={{ flex: 1 }}>
<ParseEmojis content={option.title} emojis={item.poll?.emojis} />
<CustomText style={{ flex: 1, color: colors.primaryDefault }}>
{changesPoll?.[index]?.length ? (
changesPoll[index]?.map(({ value, added, removed }, index) => (
<ParseEmojis
key={index}
content={value}
emojis={item.poll?.emojis}
style={{
color: added ? colors.green : removed ? colors.red : undefined,
textDecorationLine: removed ? 'line-through' : undefined
}}
/>
))
) : (
<ParseEmojis content={option.title} emojis={item.poll?.emojis} />
)}
</CustomText>
</View>
</View>

View File

@ -368,7 +368,7 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
})
: null}
{/* <CustomText
children={data?.body[index - 1]?._level}
children={finalData.current[index - 1]?._level}
style={{ position: 'absolute', top: 4, left: 4, color: colors.red }}
/>
<CustomText
@ -376,7 +376,7 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
style={{ position: 'absolute', top: 20, left: 4, color: colors.yellow }}
/>
<CustomText
children={data?.body[index + 1]?._level}
children={finalData.current[index + 1]?._level}
style={{ position: 'absolute', top: 36, left: 4, color: colors.green }}
/> */}
</View>