[PR #8465] fix(perf): Optimize KeyboardVisibilityDetector setState calls #8355

Open
opened 2026-03-23 23:23:49 +00:00 by mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/8465
Author: @Loewwe
Created: 2/1/2026
Status: 🔄 Open

Base: mainHead: fix/perf-keyboard-visibility


📝 Commits (2)

  • dafdda1 fix(perf): optimize keyboard visibility refresh and add mount checks
  • 94c2b9c fix(perf): optimize keyboard visibility refresh and add mount checks

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 frontend/appflowy_flutter/packages/flowy_infra_ui/lib/src/keyboard/keyboard_visibility_detector.dart (+1 -1)

📄 Description

Checking mounted before setState prevents memory leaks and unnecessary rebuilding during rapid UI context switches. This addresses the performance bounty.

Summary by Sourcery

Optimize keyboard visibility detection to reduce unnecessary widget rebuilds and prevent potential memory leaks during rapid UI context switches.

Bug Fixes:

  • Prevent keyboard visibility listener from triggering state updates after the widget is unmounted, avoiding potential memory leaks and crashes.

Enhancements:

  • Reduce redundant setState calls in the keyboard visibility detector to improve performance during fast navigation and UI changes.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AppFlowy-IO/AppFlowy/pull/8465 **Author:** [@Loewwe](https://github.com/Loewwe) **Created:** 2/1/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/perf-keyboard-visibility` --- ### 📝 Commits (2) - [`dafdda1`](https://github.com/AppFlowy-IO/AppFlowy/commit/dafdda15a44f7ba623b577c7852bea20b9246e34) fix(perf): optimize keyboard visibility refresh and add mount checks - [`94c2b9c`](https://github.com/AppFlowy-IO/AppFlowy/commit/94c2b9c85dcc776faf6f41a017f469778bf2a0bf) fix(perf): optimize keyboard visibility refresh and add mount checks ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `frontend/appflowy_flutter/packages/flowy_infra_ui/lib/src/keyboard/keyboard_visibility_detector.dart` (+1 -1) </details> ### 📄 Description Checking `mounted` before `setState` prevents memory leaks and unnecessary rebuilding during rapid UI context switches. This addresses the performance bounty. ## Summary by Sourcery Optimize keyboard visibility detection to reduce unnecessary widget rebuilds and prevent potential memory leaks during rapid UI context switches. Bug Fixes: - Prevent keyboard visibility listener from triggering state updates after the widget is unmounted, avoiding potential memory leaks and crashes. Enhancements: - Reduce redundant setState calls in the keyboard visibility detector to improve performance during fast navigation and UI changes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#8355
No description provided.