fix(chat): scope keyboard avoidance to Facebook IAB

This commit is contained in:
2026-07-16 16:41:02 +08:00
parent aa801a3e18
commit 514297f469
4 changed files with 55 additions and 23 deletions
@@ -38,7 +38,7 @@ describe("resolveChatKeyboardInset", () => {
});
});
it("uses the visual viewport occlusion without an extra gap", () => {
it("uses the visual viewport occlusion with the target gap", () => {
expect(
resolveChatKeyboardInset(
baseline,
@@ -46,7 +46,7 @@ describe("resolveChatKeyboardInset", () => {
),
).toEqual({
keyboardVisible: true,
bottomInset: 300,
bottomInset: 308,
source: "visual-viewport",
});
});
@@ -62,7 +62,7 @@ describe("resolveChatKeyboardInset", () => {
),
).toEqual({
keyboardVisible: true,
bottomInset: 320,
bottomInset: 328,
source: "virtual-keyboard",
});
});
@@ -83,8 +83,8 @@ describe("resolveChatKeyboardInset", () => {
describe("resolveChatKeyboardFallbackInset", () => {
it("scales with viewport height and remains bounded", () => {
expect(resolveChatKeyboardFallbackInset(500)).toBe(260);
expect(resolveChatKeyboardFallbackInset(800)).toBe(336);
expect(resolveChatKeyboardFallbackInset(1_200)).toBe(380);
expect(resolveChatKeyboardFallbackInset(500)).toBe(268);
expect(resolveChatKeyboardFallbackInset(800)).toBe(344);
expect(resolveChatKeyboardFallbackInset(1_200)).toBe(388);
});
});