{"record":{"id":"184d08cac9580e89","repo":"toeverything/AFFiNE","slug":"visualviewport-is-not-supported","errorCode":null,"errorMessage":"visualViewport is not supported","messagePattern":"visualViewport is not supported","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/frontend/apps/mobile/src/app.tsx","lineNumber":106,"sourceCode":"        HEAVY: [30],\n      }[style];\n      const result = navigator.vibrate?.(pattern);\n      if (!result) {\n        console.warn('vibrate not supported, or user not interacted');\n      }\n      resolve();\n    });\n  },\n  notification: () => Promise.reject('Not supported'),\n  vibrate: () => Promise.reject('Not supported'),\n  selectionStart: () => Promise.reject('Not supported'),\n  selectionChanged: () => Promise.reject('Not supported'),\n  selectionEnd: () => Promise.reject('Not supported'),\n});\nframework.impl(VirtualKeyboardProvider, {\n  onChange: callback => {\n    if (!visualViewport) {\n      console.warn('visualViewport is not supported');\n      return () => {};\n    }\n\n    const listener = () => {\n      if (!visualViewport) return;\n      const windowHeight = window.innerHeight;\n\n      /**\n       * ┌───────────────┐ - window top\n       * │               │\n       * │               │\n       * │               │\n       * │               │\n       * │               │\n       * └───────────────┘ - keyboard top        --\n       * │               │                       │ keyboard height in layout viewport\n       * └───────────────┘ - page(html) bottom   --\n       * │               │                       │ visualViewport.offsetTop","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/frontend/apps/mobile/src/app.tsx#L88-L124","documentation":"Warning logged by the mobile VirtualKeyboardProvider `onChange` when `visualViewport` is undefined — the environment does not expose the VisualViewport API needed to observe keyboard-driven viewport changes, so keyboard-change notifications cannot be delivered to subscribers.","triggerScenarios":"Triggered on mobile when window.visualViewport is unavailable, so the virtual keyboard listener cannot be registered and a no-op unsubscribe is returned.","commonSituations":"Occurs in browsers lacking the VisualViewport API (older WebViews). Keyboard-aware layout adjustments will not work; upgrade the browser/WebView if needed.","solutions":["Feature-detect visualViewport before use.","Provide a non-viewport fallback layout."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b4c8548c09da21b2898443559a5b846f0ccf5dd8","analyzedAt":"2026-08-18T21:16:52.546Z","contentChangedAt":"2026-08-18T21:16:52.546Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}