The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | const PENDING_USER_INPUT_MAX_HEIGHT = 560; |
| 2 | const PENDING_USER_INPUT_MIN_HEIGHT = 160; |
| 3 | const PENDING_USER_INPUT_VERTICAL_GAP = 12; |
| 4 | |
| 5 | export const ESTIMATED_KEYBOARD_HEIGHT = 336; |
| 6 | |
| 7 | /** Card transitions and feed insets must share timing to avoid drift. */ |
| 8 | export const USER_INPUT_TOGGLE_DURATION_MS = 220; |
| 9 | |
| 10 | export function derivePendingUserInputMaxHeight(input: { |
| 11 | readonly windowHeight: number; |
| 12 | readonly keyboardHeight: number; |
| 13 | readonly navigationHeaderHeight: number; |
| 14 | readonly composerOverlapHeight: number; |
| 15 | }): number { |
| 16 | "worklet"; |
| 17 | const availableHeight = |
| 18 | input.windowHeight - |
| 19 | Math.max(0, input.keyboardHeight) - |
| 20 | Math.max(0, input.navigationHeaderHeight) - |
| 21 | Math.max(0, input.composerOverlapHeight) - |
| 22 | PENDING_USER_INPUT_VERTICAL_GAP; |
| 23 | |
| 24 | return Math.min( |
| 25 | PENDING_USER_INPUT_MAX_HEIGHT, |
| 26 | Math.max(PENDING_USER_INPUT_MIN_HEIGHT, availableHeight), |
| 27 | ); |
| 28 | } |