add fullHeight prop, fix Android bottom sheet behavior, keyboard handling

Native module:
- Add `fullHeight` prop to BottomSheetView on Android and iOS
- iOS: fullHeight sets detent to .large, skips content observation
- Android: fullHeight uses isFitToContents=false with expandedOffset=statusBarHeight

Android bottom sheet behavior overhaul:
- Switch normal sheets to isFitToContents=false with expandedOffset, enabling
  proper 3-state snapping (half-expanded ↔ expanded ↔ hidden). Previously
  isFitToContents=true prevented settling at half-expanded during gestures,
  making it impossible to swipe back down from expanded.
- preventExpansion sheets keep isFitToContents=true with maxHeight cap, plus
  a state callback safety net that bounces EXPANDED→HALF_EXPANDED. This
  catches an edge case where rapid content resizes during opening can invert
  the expanded/half-expanded offsets, causing the sheet to dismiss.
- Add requestLayout() after maxHeight changes in updateLayout() so the
  FrameLayout actually re-measures (fixes keyboard padding not resizing sheet)
- Set backgroundTint=transparent in the theme to remove Material3 surface
  tint that was visible in gaps between sheet and screen edge

Keyboard handling:
- Remove native keyboard expansion logic (insets listener, isKeyboardVisible
  tracking, manual STATE_EXPANDED on keyboard show)
- Replace with JS-side keyboard padding: ScrollableInner listens for RN
  Keyboard events and adds bottom padding equal to keyboard height
- Generalize useOnKeyboardDidShow → useOnKeyboard(eventName, cb)

Callers:
- Replace minHeight: screenHeight hack with fullHeight: true in EditProfile,
  ChangeHandle, AddAppPassword, ImageAltText, GifAltText, LanguageSelect,
  FollowDialog, GifSelect, StarterPack, Select, NewChat, ShareViaChat,
  DraftsList, WizardEditList, ListAddRemoveUsers, CreateOrEditList
- Remove unused useWindowDimensions imports
- ServerInput: simplify to just preventExpansion (was platform-specific)
- ImageAltTextDialog: remove old {height: 300} keyboard spacer hack

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Samuel Newman
2026-03-01 22:40:44 +02:00
parent e46977ddca
commit 1e8ce36184
26 changed files with 148 additions and 130 deletions
@@ -1,5 +1,5 @@
import {useCallback, useMemo, useState} from 'react'
import {useWindowDimensions, View} from 'react-native'
import {View} from 'react-native'
import Animated, {
FadeIn,
FadeOut,
@@ -53,10 +53,8 @@ export function ChangeHandleDialog({
}: {
control: Dialog.DialogControlProps
}) {
const {height} = useWindowDimensions()
return (
<Dialog.Outer control={control} nativeOptions={{minHeight: height}}>
<Dialog.Outer control={control} nativeOptions={{fullHeight: true}}>
<ChangeHandleDialogInner />
</Dialog.Outer>
)