The Great Unjanking of the Sheets (#9973)

This commit is contained in:
Samuel Newman
2026-03-09 22:53:32 +02:00
committed by GitHub
parent 18d7e775f6
commit aa897f55a0
27 changed files with 318 additions and 196 deletions
+2 -6
View File
@@ -1,5 +1,5 @@
import {useState} from 'react'
import {TouchableOpacity, useWindowDimensions, View} from 'react-native'
import {TouchableOpacity, View} from 'react-native'
import {msg} from '@lingui/core/macro'
import {useLingui} from '@lingui/react'
import {Plural, Trans} from '@lingui/react/macro'
@@ -23,7 +23,6 @@ import {CircleInfo_Stroke2_Corner0_Rounded as CircleInfo} from '#/components/ico
import {PlusSmall_Stroke2_Corner0_Rounded as Plus} from '#/components/icons/Plus'
import {GifEmbed} from '#/components/Post/Embed/ExternalEmbed/Gif'
import {Text} from '#/components/Typography'
import {IS_ANDROID} from '#/env'
import {AltTextReminder} from './photos/Gallery'
export function GifAltTextDialog({
@@ -69,7 +68,6 @@ export function GifAltTextDialogLoaded({
const {_} = useLingui()
const t = useTheme()
const [altTextDraft, setAltTextDraft] = useState(altText || vendorAltText)
const {height: minHeight} = useWindowDimensions()
return (
<>
<TouchableOpacity
@@ -110,7 +108,7 @@ export function GifAltTextDialogLoaded({
onClose={() => {
onSubmit(altTextDraft)
}}
nativeOptions={{minHeight}}>
nativeOptions={{fullHeight: true}}>
<Dialog.Handle />
<AltTextInner
vendorAltText={vendorAltText}
@@ -226,8 +224,6 @@ function AltTextInner({
</View>
</View>
<Dialog.Close />
{/* Maybe fix this later -h */}
{IS_ANDROID ? <View style={{height: 300}} /> : null}
</Dialog.ScrollableInner>
)
}
@@ -167,7 +167,7 @@ export function DraftsListDialog({
)
return (
<Dialog.Outer control={control}>
<Dialog.Outer control={control} nativeOptions={{fullHeight: true}}>
{/* We really really need to figure out a nice, consistent API for doing a header cross-platform -sfn */}
{IS_NATIVE && header}
<Dialog.InnerFlatList
@@ -6,7 +6,6 @@ import {useLingui} from '@lingui/react'
import {Plural, Trans} from '@lingui/react/macro'
import {MAX_ALT_TEXT} from '#/lib/constants'
import {useIsKeyboardVisible} from '#/lib/hooks/useIsKeyboardVisible'
import {enforceLen} from '#/lib/strings/helpers'
import {type ComposerImage} from '#/state/gallery'
import {AltTextCounterWrapper} from '#/view/com/composer/AltTextCounterWrapper'
@@ -17,7 +16,7 @@ import {type DialogControlProps} from '#/components/Dialog'
import * as TextField from '#/components/forms/TextField'
import {CircleInfo_Stroke2_Corner0_Rounded as CircleInfo} from '#/components/icons/CircleInfo'
import {Text} from '#/components/Typography'
import {IS_ANDROID, IS_LIQUID_GLASS, IS_WEB} from '#/env'
import {IS_LIQUID_GLASS, IS_WEB} from '#/env'
type Props = {
control: Dialog.DialogOuterProps['control']
@@ -32,7 +31,6 @@ export const ImageAltTextDialog = ({
onChange,
sourceViewTag,
}: Props): React.ReactNode => {
const {height: minHeight} = useWindowDimensions()
const [altText, setAltText] = useState(image.alt)
return (
@@ -44,7 +42,7 @@ export const ImageAltTextDialog = ({
alt: enforceLen(altText, MAX_ALT_TEXT, true),
})
}}
nativeOptions={{minHeight, sourceViewTag}}>
nativeOptions={{fullHeight: true, sourceViewTag}}>
<Dialog.Handle />
<ImageAltTextInner
control={control}
@@ -71,8 +69,6 @@ const ImageAltTextInner = ({
const t = useTheme()
const {width: screenWidth} = useWindowDimensions()
const [isKeyboardVisible] = useIsKeyboardVisible()
const imageStyle = useMemo<ImageStyle>(() => {
const maxWidth = IS_WEB
? 450
@@ -179,8 +175,6 @@ const ImageAltTextInner = ({
</Button>
</AltTextCounterWrapper>
</View>
{/* Maybe fix this later -h */}
{IS_ANDROID && isKeyboardVisible ? <View style={{height: 300}} /> : null}
</Dialog.ScrollableInner>
)
}