Open History to see the last commit
1const PENDING_USER_INPUT_MAX_HEIGHT = 560;
2const PENDING_USER_INPUT_MIN_HEIGHT = 160;
3const PENDING_USER_INPUT_VERTICAL_GAP = 12;
4
5export const ESTIMATED_KEYBOARD_HEIGHT = 336;
6
7/**
8 * One clock for the questionnaire expand/collapse choreography: the card's
9 * enter/exit and the feed-inset glide must share it or they visibly drift.
10 */
11export const USER_INPUT_TOGGLE_DURATION_MS = 220;
12
13export function derivePendingUserInputMaxHeight(input: {
14 readonly windowHeight: number;
15 readonly keyboardHeight: number;
16 readonly navigationHeaderHeight: number;
17 readonly composerOverlapHeight: number;
18}): number {
19 "worklet";
20 const availableHeight =
21 input.windowHeight -
22 Math.max(0, input.keyboardHeight) -
23 Math.max(0, input.navigationHeaderHeight) -
24 Math.max(0, input.composerOverlapHeight) -
25 PENDING_USER_INPUT_VERTICAL_GAP;
26
27 return Math.min(
28 PENDING_USER_INPUT_MAX_HEIGHT,
29 Math.max(PENDING_USER_INPUT_MIN_HEIGHT, availableHeight),
30 );
31}