From b0c4a6ed9db10683fb787c8a1ddda23a8b27c95e Mon Sep 17 00:00:00 2001 From: Ankit Date: Fri, 16 Jan 2026 12:27:43 +0530 Subject: [PATCH 1/4] fix: prevent mobile toolbar from being hidden behind keyboard on Android - Improved keyboard height calculation to prioritize viewInsets.bottom when keyboard is visible - Added 8px safety margin on Android to account for keyboard toolbar - Ensures toolbar stays visible above the keyboard in all scenarios Fixes #8433 --- .../appflowy_mobile_toolbar.dart | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mobile_toolbar_v3/appflowy_mobile_toolbar.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mobile_toolbar_v3/appflowy_mobile_toolbar.dart index 787ccfda9f5cf..d83207240da1e 100644 --- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mobile_toolbar_v3/appflowy_mobile_toolbar.dart +++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mobile_toolbar_v3/appflowy_mobile_toolbar.dart @@ -407,16 +407,23 @@ class _MobileToolbarState extends State<_MobileToolbar> var keyboardHeight = height; if (defaultTargetPlatform == TargetPlatform.android) { if (!showingMenu) { - // take the max value of the keyboard height and the view padding - // to make sure the toolbar is above the keyboard - keyboardHeight = max( - keyboardHeight, - MediaQuery.of(context).viewInsets.bottom, - ); + final viewInsetsBottom = MediaQuery.of(context).viewInsets.bottom; + // Always use viewInsets when keyboard is visible to ensure accurate positioning + // This prevents the toolbar from being hidden behind the keyboard + if (viewInsetsBottom > 0) { + keyboardHeight = viewInsetsBottom; + } else { + // Use cached height when keyboard is hiding + keyboardHeight = max(keyboardHeight, viewInsetsBottom); + } } } if (keyboardHeight > 0) { _globalCachedKeyboardHeight = keyboardHeight; + // Add small safety margin on Android to account for keyboard toolbar + if (defaultTargetPlatform == TargetPlatform.android) { + keyboardHeight += 8.0; + } } return SizedBox( height: keyboardHeight, From f72b0016b1c52fb3929a3930dfb7e1652a66e532 Mon Sep 17 00:00:00 2001 From: Ankit Date: Fri, 16 Jan 2026 12:43:00 +0530 Subject: [PATCH 2/4] fix: improve settings shortcuts UI consistency and layout (#8222) - Add hover effect to reset button (icon and text change to primary color) - Change shortcut tile layout from Expanded to Flexible for better spacing - Fixes inconsistent button hover behavior - Improves visual alignment by reducing blank space in shortcut tiles --- .../settings/pages/settings_shortcuts_view.dart | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/settings_shortcuts_view.dart b/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/settings_shortcuts_view.dart index 3730f5e22f188..c64da035e768a 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/settings_shortcuts_view.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/settings_shortcuts_view.dart @@ -153,23 +153,28 @@ class _ResetButton extends StatelessWidget { behavior: HitTestBehavior.translucent, onTap: onReset, child: FlowyHover( - child: Padding( + builder: (context, isHovering) => Padding( padding: const EdgeInsets.symmetric( vertical: 4.0, horizontal: 6, ), child: Row( children: [ - const FlowySvg( + FlowySvg( FlowySvgs.restore_s, - size: Size.square(20), + size: const Size.square(20), + color: isHovering + ? Theme.of(context).colorScheme.primary + : AFThemeExtension.of(context).strongText, ), const HSpace(6), SizedBox( height: 16, child: FlowyText.regular( LocaleKeys.settings_shortcutsPage_actions_resetDefault.tr(), - color: AFThemeExtension.of(context).strongText, + color: isHovering + ? Theme.of(context).colorScheme.primary + : AFThemeExtension.of(context).strongText, ), ), ], @@ -327,7 +332,7 @@ class _ShortcutSettingTileState extends State { child: Row( children: [ const HSpace(8), - Expanded( + Flexible( child: Padding( padding: const EdgeInsets.only(right: 10), child: FlowyText.regular( @@ -339,7 +344,7 @@ class _ShortcutSettingTileState extends State { ), ), ), - Expanded( + Flexible( child: isEditing ? _renderKeybindEditor() : _renderKeybindings(isHovering), From 488e48b3c73cc39318c372d156a9ef9c0fe4da34 Mon Sep 17 00:00:00 2001 From: Ankit Date: Fri, 16 Jan 2026 14:54:29 +0530 Subject: [PATCH 3/4] fix(settings): improve shortcuts reset button hover and tile layout --- .../settings/pages/settings_shortcuts_view.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/settings_shortcuts_view.dart b/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/settings_shortcuts_view.dart index c64da035e768a..6438b98361647 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/settings_shortcuts_view.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/settings_shortcuts_view.dart @@ -153,6 +153,10 @@ class _ResetButton extends StatelessWidget { behavior: HitTestBehavior.translucent, onTap: onReset, child: FlowyHover( + style: HoverStyle( + hoverColor: Theme.of(context).colorScheme.secondaryContainer, + borderRadius: Corners.s6Border, + ), builder: (context, isHovering) => Padding( padding: const EdgeInsets.symmetric( vertical: 4.0, @@ -344,7 +348,7 @@ class _ShortcutSettingTileState extends State { ), ), ), - Flexible( + Expanded( child: isEditing ? _renderKeybindEditor() : _renderKeybindings(isHovering), From 76d95004da74f7c3e04c5bd0667b800074f6eb66 Mon Sep 17 00:00:00 2001 From: Ankit Date: Fri, 16 Jan 2026 15:42:44 +0530 Subject: [PATCH 4/4] fix(toolbar): use cached keyboard height and clarify safety margin --- .../mobile_toolbar_v3/appflowy_mobile_toolbar.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mobile_toolbar_v3/appflowy_mobile_toolbar.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mobile_toolbar_v3/appflowy_mobile_toolbar.dart index d83207240da1e..695bf66222fa8 100644 --- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mobile_toolbar_v3/appflowy_mobile_toolbar.dart +++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mobile_toolbar_v3/appflowy_mobile_toolbar.dart @@ -414,12 +414,14 @@ class _MobileToolbarState extends State<_MobileToolbar> keyboardHeight = viewInsetsBottom; } else { // Use cached height when keyboard is hiding - keyboardHeight = max(keyboardHeight, viewInsetsBottom); + keyboardHeight = max(keyboardHeight, _globalCachedKeyboardHeight); } } } if (keyboardHeight > 0) { + // Only cache the raw height without safety padding _globalCachedKeyboardHeight = keyboardHeight; + // Add small safety margin on Android to account for keyboard toolbar if (defaultTargetPlatform == TargetPlatform.android) { keyboardHeight += 8.0;