From 091e7b8936d738544abefead2d411fdc845ed060 Mon Sep 17 00:00:00 2001 From: Levi Date: Sat, 12 Sep 2026 09:28:04 +0800 Subject: [PATCH] fix(ui): keep mobile create task actions in safe area (#1504) --- .../pages/create_task_window_page.dart | 39 ++++++++++--------- .../create_task_window_page_test.dart | 6 ++- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/ui/flutter/lib/features/tasks/presentation/pages/create_task_window_page.dart b/ui/flutter/lib/features/tasks/presentation/pages/create_task_window_page.dart index 55fb3ad1..0e242ec8 100644 --- a/ui/flutter/lib/features/tasks/presentation/pages/create_task_window_page.dart +++ b/ui/flutter/lib/features/tasks/presentation/pages/create_task_window_page.dart @@ -687,24 +687,27 @@ class _CreateTaskWindowPageState extends ConsumerState { ), ), ), - Container( - padding: const EdgeInsets.fromLTRB(24, 12, 24, 20), - decoration: BoxDecoration( - border: Border(top: BorderSide(color: palette.border)), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - CreateTaskActionButtons( - submitting: _creating, - onCancel: _closeWindow, - onSubmit: _confirm, - cancelLabel: context.l10n.cancel, - submitLabel: context.l10n.confirm, - cancelButtonKey: const ValueKey('create-task-cancel-button'), - submitButtonKey: const ValueKey('create-task-confirm-button'), - ), - ], + SafeArea( + top: false, + child: Container( + padding: const EdgeInsets.fromLTRB(24, 12, 24, 20), + decoration: BoxDecoration( + border: Border(top: BorderSide(color: palette.border)), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + CreateTaskActionButtons( + submitting: _creating, + onCancel: _closeWindow, + onSubmit: _confirm, + cancelLabel: context.l10n.cancel, + submitLabel: context.l10n.confirm, + cancelButtonKey: const ValueKey('create-task-cancel-button'), + submitButtonKey: const ValueKey('create-task-confirm-button'), + ), + ], + ), ), ), ], diff --git a/ui/flutter/test/features/tasks/presentation/create_task_window_page_test.dart b/ui/flutter/test/features/tasks/presentation/create_task_window_page_test.dart index 2ca8e88f..c9114bcc 100644 --- a/ui/flutter/test/features/tasks/presentation/create_task_window_page_test.dart +++ b/ui/flutter/test/features/tasks/presentation/create_task_window_page_test.dart @@ -165,7 +165,7 @@ void main() { } }); - testWidgets('mobile create task page starts below the system status bar', (WidgetTester tester) async { + testWidgets('mobile create task page stays within the system safe areas', (WidgetTester tester) async { debugDefaultTargetPlatformOverride = TargetPlatform.android; tester.view.physicalSize = const Size(700, 760); tester.view.devicePixelRatio = 1; @@ -193,6 +193,10 @@ void main() { final contentPadding = tester.widget(find.byKey(const ValueKey('create-task-safe-content'))); expect((contentPadding.padding as EdgeInsets).top, 32); + expect( + tester.getBottomRight(find.byKey(const ValueKey('create-task-confirm-button'))).dy, + lessThanOrEqualTo(tester.view.physicalSize.height / tester.view.devicePixelRatio - 24), + ); } finally { debugDefaultTargetPlatformOverride = null; }