Skip to content

fix(android): new session bottom sheet follows IME keyboard#1366

Open
Savlgoodman wants to merge 1 commit into
slopus:mainfrom
Savlgoodman:main
Open

fix(android): new session bottom sheet follows IME keyboard#1366
Savlgoodman wants to merge 1 commit into
slopus:mainfrom
Savlgoodman:main

Conversation

@Savlgoodman
Copy link
Copy Markdown

Problem

On Android, when creating a new session and tapping the project/path or worktree row, a bottom sheet opens with a TextInput. The auto-focused text field triggers the software keyboard, but the bottom sheet (rendered inside RNModal) stays anchored to the physical screen bottom — the keyboard covers the input field, the Done button, and the lower portion of the picker list. The screen-level KeyboardAvoidingView cannot help because RNModal lives in a separate native surface.

Fix

Make the Android branch of BottomSheet keyboard-aware by leveraging useReanimatedKeyboardAnimation from react-native-keyboard-controller (already a project dependency, already used in AgentContentView.ios.tsx and PlaceholderContainerView.tsx).

  • Replace React Native Animated.Value with Reanimated useSharedValue for the sheet slide transform
  • Read live IME height via useReanimatedKeyboardAnimation and combine it with the sheet's open/close translateY via useAnimatedStyle
  • The sheet now tracks the keyboard animation continuously, staying above the IME with an 8px gap
  • Replace Animated.spring (which caused a bouncy open animation that blocked input) with withTiming(200ms) for a smooth, responsive transition

No changes to iOS (presentationStyle="formSheet" handles this natively) or Web (uses inline popover).

Before:
*worktree
worktree遮挡
(picker stays visible)
键盘遮挡

After:
{1FCF9CA8-5D84-4746-B21D-DD4F4AB43651}

Files changed

  • packages/happy-app/sources/app/(app)/new/index.tsx — Android BottomSheet component

PathPicker and PickerContent now track IME height via useReanimatedKeyboardAnimation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant