mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-03-25 09:25:50 +00:00
Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: J Wylie <jfuginay@Js-MacBook-Pro-2.local> Co-authored-by: Peter Steinberger <steipete@gmail.com>
2.3 KiB
2.3 KiB
Android Keyboard Fix for Claude Code
Issue #504: Android keyboard covers Claude Code text input
Problem
When Claude Code runs inside a VibeTunnel terminal session on Android Chrome, the on-screen keyboard covers the text input area, preventing users from seeing what they're typing.
Root Cause
While VibeTunnel handles keyboard appearance for its own UI elements, embedded applications like Claude Code running inside the terminal don't benefit from these adjustments. The terminal content remains fixed in position when the keyboard appears.
Solution Implemented
1. Modern Viewport Units
- Added
100dvh(dynamic viewport height) units alongside existing100vh - Dynamic viewport units automatically adjust when the keyboard appears/disappears
- Updated in
index.htmlfor better mobile browser support
2. Interactive Widget Meta Tag
- Added
interactive-widget=resizes-contentto viewport meta tag - This tells Android Chrome to resize the viewport when keyboard appears
- Provides better native handling of keyboard appearance
3. CSS Improvements
- Made terminal viewport scrollable when keyboard is visible
- Added specific styles for
data-keyboard-visible="true"state - Ensured xterm viewport can scroll to show content behind keyboard
- Used
env(keyboard-inset-height)for future-proof keyboard handling
4. Enhanced Keyboard Detection
- Set CSS custom property
--keyboard-heightwith actual keyboard height - Added
data-keyboard-visibleattribute to body element - Dispatch custom events
vibetunnel:keyboard-shownandvibetunnel:keyboard-hidden - These allow embedded apps to react to keyboard state changes
Benefits
- Claude Code (and other embedded apps) can now be scrolled when keyboard appears
- No more hidden input fields on Android devices
- Better visual feedback and smoother transitions
- Future-proof solution using modern CSS and viewport APIs
Testing
- Open VibeTunnel on Android Chrome
- Start a Claude Code session
- Tap on Claude's input field
- Verify that:
- The viewport adjusts when keyboard appears
- You can scroll to see the input field
- Text input remains visible while typing
- Keyboard dismissal restores normal view
Compatibility
- Android Chrome: Full support
- iOS Safari: Improved support (already had better handling)
- Desktop browsers: No impact (mobile-only styles)