Skip to content

Commit 5147385

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 32ecd71 commit 5147385

2 files changed

Lines changed: 7 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
@@ -44,8 +44,9 @@ function Discussion({ params }: { params: PullRequestParams & { readonly discuss
4444
const target = pullRequestTarget(params);
4545
const navigation = useNavigation();
4646
const insets = useSafeAreaInsets();
47-
const keyboardVisible = useKeyboardState((state) => state.isVisible);
48-
const bottomInset = keyboardVisible ? 8 : Math.max(insets.bottom, 12);
47+
// A hardware keyboard can leave the IME visible with no height, which lifts nothing.
48+
const keyboardLiftsComposer = useKeyboardState((state) => state.isVisible && state.height > 0);
49+
const bottomInset = keyboardLiftsComposer ? 8 : Math.max(insets.bottom, 12);
4950
const activity = useEnvironmentQuery(composerPullRequests.activity(target));
5051
const detail = useEnvironmentQuery(composerPullRequests.detail(target));
5152
const permissions = usePullRequestPermissions(params, detail.data);

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,10 @@ function ThreadDetailBody(props: ThreadDetailScreenProps) {
511511
? alignedBottomInset - THREAD_COMPOSER_BOTTOM_GUTTER
512512
: Math.max(bottomSafeArea, 12)) - (hasSidebarTabBar ? 3 : 0),
513513
);
514-
const composerKeyboardOffset = composerBottomInset;
514+
// A hardware keyboard can leave the IME visible with no height. Nothing lifts the
515+
// composer then, so cancelling its padding would drop it under the taskbar.
516+
const composerKeyboardOffset =
517+
isKeyboardVisible && liveKeyboardHeight === 0 ? 0 : composerBottomInset;
515518
const contentPresentationKind = props.contentPresentation.kind;
516519
const realThreadSyncLabel = (() => {
517520
switch (props.threadSyncStatus) {

0 commit comments

Comments
 (0)