Skip to content

Commit 77d125c

Browse files
PR Batch Testerclaude
andcommitted
fix(mobile): Android composer stays above the taskbar with a hardware keyboard
With a hardware keyboard the IME is visible but has no height above the navigation bar or taskbar. The keyboard library still reports progress 1, so the thread composer's sticky view applied its full "opened" offset and cancelled the bottom safe-area padding with nothing lifting it, leaving the button row under the taskbar. Only cancel the padding when the keyboard has height. The PR discussion reply bar dropped its inset on visibility alone and gets the same check. Refs #21684 Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 05b697f commit 77d125c

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

‎apps/mobile/src/features/pull-requests/PullRequestDiscussionScreen.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ function Discussion({ params }: { params: PullRequestParams & { readonly discuss
4343
const target = pullRequestTarget(params);
4444
const navigation = useNavigation();
4545
const insets = useSafeAreaInsets();
46-
const keyboardVisible = useKeyboardState((state) => state.isVisible);
47-
const bottomInset = keyboardVisible ? 8 : Math.max(insets.bottom, 12);
46+
// A hardware keyboard can leave the IME visible with no height, which lifts nothing.
47+
const keyboardLiftsComposer = useKeyboardState((state) => state.isVisible && state.height > 0);
48+
const bottomInset = keyboardLiftsComposer ? 8 : Math.max(insets.bottom, 12);
4849
const activity = useEnvironmentQuery(composerPullRequests.activity(target));
4950
const detail = useEnvironmentQuery(composerPullRequests.detail(target));
5051
const permissions = usePullRequestPermissions(params, detail.data);

‎apps/mobile/src/features/threads/ThreadDetailScreen.tsx‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,14 +540,19 @@ export const ThreadDetailScreen = function ThreadDetailScreen(props: ThreadDetai
540540
const [endFollowEnabled, setEndFollowEnabled] = useState(true);
541541
// Android Back hides the keyboard without blurring. Keep its safe-area padding
542542
// fixed through the animation and cancel it with matching composer/list offsets.
543+
// A hardware keyboard can leave the IME visible with no height: nothing lifts the
544+
// composer then, so cancelling the padding would drop it under the taskbar.
543545
const bottomBarInset = useDuoBottomBarInset();
544546
const composerBottomInset =
545547
Platform.OS === "ios" && (composerExpanded || composerFocused)
546548
? 0
547549
: bottomBarInset !== undefined
548550
? bottomBarInset - THREAD_COMPOSER_BOTTOM_GUTTER
549551
: Math.max(insets.bottom, 12);
550-
const composerKeyboardOffset = Platform.OS === "android" ? composerBottomInset : 0;
552+
const composerKeyboardOffset =
553+
Platform.OS === "android" && !(isKeyboardVisible && liveKeyboardHeight === 0)
554+
? composerBottomInset
555+
: 0;
551556
const contentPresentationKind = props.contentPresentation.kind;
552557
const realThreadSyncLabel = (() => {
553558
switch (props.threadSyncStatus) {

0 commit comments

Comments
 (0)