feat(logging): report important keyboard events

This commit is contained in:
2026-07-01 18:45:03 +08:00
parent ae6578923b
commit b59da8f7e4
4 changed files with 49 additions and 11 deletions
+9 -5
View File
@@ -66,10 +66,14 @@ export function useKeyboardHeight({
const environment = getKeyboardAdaptEnvironment();
if (!shouldEnableKeyboardAdaptation(environment)) {
resetInputLiftVar();
log.debug("[keyboard] disabled", {
const payload = {
reason: "not-android-facebook-fallback-device",
environment,
});
};
log.debug("[keyboard] disabled", payload);
if (environment.isAndroid && environment.isFacebookInAppBrowser) {
log.important("info", "[keyboard] disabled", payload);
}
return;
}
@@ -81,7 +85,7 @@ export function useKeyboardHeight({
let lastInputLift = -1;
const focusedAt = active ? performance.now() : 0;
log.debug("[keyboard] environment", environment);
log.important("info", "[keyboard] environment", environment);
const clearTimers = () => {
timeoutIds.forEach((id) => window.clearTimeout(id));
@@ -98,7 +102,7 @@ export function useKeyboardHeight({
lastInputLift = nextLift;
setInputLiftVar(nextLift);
log.debug("[keyboard] apply", {
log.important("info", "[keyboard] apply", {
reason,
inputLift: nextLift,
fallback: nextLift === FALLBACK_INPUT_LIFT_PX,
@@ -113,7 +117,7 @@ export function useKeyboardHeight({
applyLift(0, reason);
blurKeyboardTarget(targetRef?.current);
onKeyboardDismissRef.current?.();
log.debug("[keyboard] released", {
log.important("info", "[keyboard] released", {
reason,
snapshot: formatSnapshot(readKeyboardSnapshot()),
});