Skip to content

Keep the composer above the iOS keyboard in wide layouts - #6492

Merged
ymichael merged 1 commit into
mainfrom
bb/fix-discord-read-cli-issue-thr_zzm4mkzkve
Oct 28, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/fix-discord-read-cli-issue-thr_zzm4mkzkve

Conversation

@ymichael

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

A Discord TestFlight report on an unfolded iPhone Duo showed the on-screen keyboard covering the composer. useMobileVisualViewportHeight resizes the app shell to the visual viewport while the iOS keyboard is open, but AppLayout only enabled it in the compact layout. Wide touch layouts (an unfolded iPhone Duo, iPad landscape) get the desktop layout, so the shell kept its full height when the keyboard opened. Depending on the device, iOS then scrolled the whole page up and pushed the thread header off screen (bb iOS app on iPad), scrolled too little so the composer toolbar stayed behind the keyboard (iPad Safari), or did not scroll at all (the reporter's Duo). The compact-only gate dates from when phone width was the only iOS touch case.

What changed

  • apps/app/src/components/layout/useMobileVisualViewportHeight.ts: removed the enabled parameter, so the hook runs at every width. It already clears its override whenever the layout viewport matches the visual viewport, so desktop browsers, Electron and Android (interactive-widget=resizes-content) get no shell override.
  • apps/app/src/components/layout/AppLayout.tsx: no longer passes isCompactViewport.
  • useMobileVisualViewportHeight.test.tsx: dropped the enabled prop. The "disabled clears overrides" check now checks that unmounting clears them.

How you verified

  • Reproduced on an iPad Air 11-inch (iOS 26.5) simulator in landscape, against a pnpm start:worktree instance, in both the bb iOS app and Safari. There is no iPhone Duo simulator on Xcode 26.6.
    • Before (main): in the bb app the page scrolled up and the header disappeared. In Safari the composer's model and mic row sat behind the keyboard.
    • After: the header and sidebar stay in place, and the whole composer sits directly above the keyboard. The shell returns to full height after the keyboard is hidden and after blur.
  • Headless Chromium at 1280×800: focusing and typing in the composer and resizing the window leave the shell without top/height overrides, and --bb-shell-height stays unset.
  • pnpm exec turbo run typecheck lint --filter=@bb/app passes. pnpm exec turbo run test --filter=@bb/app -- src/components/layout/ src/components/promptbox/FollowUpPromptBox: 17 files, 166 tests pass.

AGENT GENERATED

🤖 Generated with Claude Code

The visual-viewport shell hook only ran in the compact layout, so wide
touch layouts (unfolded iPhone Duo, iPad landscape) kept a full-height
shell when the on-screen keyboard opened. iOS then either panned the page
(pushing the header off screen) or left the composer behind the keyboard.
Run the hook at every width; it is a no-op wherever the layout viewport
already matches the visual viewport.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ymichael
ymichael merged commit 5deb260 into main Oct 28, 2026
30 checks passed
@ymichael
ymichael deleted the bb/fix-discord-read-cli-issue-thr_zzm4mkzkve branch October 28, 2026 22:25
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