Adjust mobile keyboard bar flags so Android keeps the executor footer stacked above the nav bar while iOS retains collapse behavior. - extract mobile bar keyboard flag computation into a dedicated utility - keep nav keyboard pinning cross-platform while limiting footer keyboard-collapse to iOS - add focused unit tests for Android/iOS/modal/desktop keyboard flag scenarios - update ExecutorStatusBar keyboard-open test assertion and dashboard guide keyboard behavior notes Files changed: docs/dashboard-guide.md | 2 +- packages/dashboard/app/App.tsx | 23 ++++--- .../__tests__/ExecutorStatusBar.test.tsx | 6 +- .../utils/__tests__/mobileBarKeyboardFlags.test.ts | 73 ++++++++++++++++++++++ .../dashboard/app/utils/mobileBarKeyboardFlags.ts | 36 +++++++++++ 5 files changed, 129 insertions(+), 11 deletions(-) Fusion-Task-Id: FN-5707 Fusion-Task-Lineage: ed01fcb0-d814-4595-9479-5baf97326ae7
37 lines
1.0 KiB
TypeScript
37 lines
1.0 KiB
TypeScript
export interface MobileBarKeyboardFlagsInput {
|
|
isMobile: boolean;
|
|
keyboardOpen: boolean;
|
|
anyModalOpen: boolean;
|
|
isIOS: boolean;
|
|
}
|
|
|
|
export interface MobileBarKeyboardFlags {
|
|
footerHidden: boolean;
|
|
navKeyboardOpen: boolean;
|
|
footerKeyboardOpen: boolean;
|
|
}
|
|
|
|
/**
|
|
* FN-5707: Android uses `interactive-widget=resizes-content`, so the layout
|
|
* viewport shrinks with the keyboard and the footer's normal stacked bottom
|
|
* position remains correct above the mobile nav. Only iOS should apply the
|
|
* footer keyboard-collapse class (`bottom: 0`) used to let the keyboard cover
|
|
* bars when visualViewport shifts independently.
|
|
*/
|
|
export function computeMobileBarKeyboardFlags({
|
|
isMobile,
|
|
keyboardOpen,
|
|
anyModalOpen,
|
|
isIOS,
|
|
}: MobileBarKeyboardFlagsInput): MobileBarKeyboardFlags {
|
|
const footerHidden = isMobile && keyboardOpen && !anyModalOpen && isIOS;
|
|
const navKeyboardOpen = isMobile && keyboardOpen;
|
|
const footerKeyboardOpen = navKeyboardOpen && isIOS;
|
|
|
|
return {
|
|
footerHidden,
|
|
navKeyboardOpen,
|
|
footerKeyboardOpen,
|
|
};
|
|
}
|