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 const availableHeight =
20 input.windowHeight -
21 Math.max(0, input.keyboardHeight) -
22 Math.max(0, input.navigationHeaderHeight) -
23 Math.max(0, input.composerOverlapHeight) -
24 PENDING_USER_INPUT_VERTICAL_GAP;
25
26 return Math.min(
27 PENDING_USER_INPUT_MAX_HEIGHT,
28 Math.max(PENDING_USER_INPUT_MIN_HEIGHT, availableHeight),
29 );
30}