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
74 lines
2.0 KiB
TypeScript
74 lines
2.0 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { computeMobileBarKeyboardFlags } from "../mobileBarKeyboardFlags";
|
|
|
|
describe("computeMobileBarKeyboardFlags", () => {
|
|
it("keeps footer rendered and uncollapsed on Android when keyboard is open", () => {
|
|
const flags = computeMobileBarKeyboardFlags({
|
|
isMobile: true,
|
|
keyboardOpen: true,
|
|
anyModalOpen: false,
|
|
isIOS: false,
|
|
});
|
|
|
|
expect(flags.footerKeyboardOpen).toBe(false);
|
|
expect(flags.footerHidden).toBe(false);
|
|
expect(flags.navKeyboardOpen).toBe(true);
|
|
});
|
|
|
|
it("hides and collapses footer on iOS when keyboard is open and no modal is open", () => {
|
|
const flags = computeMobileBarKeyboardFlags({
|
|
isMobile: true,
|
|
keyboardOpen: true,
|
|
anyModalOpen: false,
|
|
isIOS: true,
|
|
});
|
|
|
|
expect(flags.footerHidden).toBe(true);
|
|
expect(flags.navKeyboardOpen).toBe(true);
|
|
expect(flags.footerKeyboardOpen).toBe(true);
|
|
});
|
|
|
|
it("keeps footer visible when iOS keyboard is open over a modal", () => {
|
|
const flags = computeMobileBarKeyboardFlags({
|
|
isMobile: true,
|
|
keyboardOpen: true,
|
|
anyModalOpen: true,
|
|
isIOS: true,
|
|
});
|
|
|
|
expect(flags.footerHidden).toBe(false);
|
|
expect(flags.footerKeyboardOpen).toBe(true);
|
|
expect(flags.navKeyboardOpen).toBe(true);
|
|
});
|
|
|
|
it("returns all false when keyboard is closed", () => {
|
|
const flags = computeMobileBarKeyboardFlags({
|
|
isMobile: true,
|
|
keyboardOpen: false,
|
|
anyModalOpen: false,
|
|
isIOS: true,
|
|
});
|
|
|
|
expect(flags).toEqual({
|
|
footerHidden: false,
|
|
navKeyboardOpen: false,
|
|
footerKeyboardOpen: false,
|
|
});
|
|
});
|
|
|
|
it("returns all false when not mobile", () => {
|
|
const flags = computeMobileBarKeyboardFlags({
|
|
isMobile: false,
|
|
keyboardOpen: true,
|
|
anyModalOpen: false,
|
|
isIOS: true,
|
|
});
|
|
|
|
expect(flags).toEqual({
|
|
footerHidden: false,
|
|
navKeyboardOpen: false,
|
|
footerKeyboardOpen: false,
|
|
});
|
|
});
|
|
});
|