From 26d14f7cb00731335246bc46b663445f0efc4377 Mon Sep 17 00:00:00 2001 From: edde746 <86283021+edde746@users.noreply.github.com> Date: Sun, 12 Jul 2026 22:19:42 +0200 Subject: [PATCH] fix(seerr): align request button focus --- lib/widgets/seerr_request_sheet.dart | 11 ++++++++--- test/widgets/seerr_request_sheet_test.dart | 5 +++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/widgets/seerr_request_sheet.dart b/lib/widgets/seerr_request_sheet.dart index 8c6166f4..de31be5d 100644 --- a/lib/widgets/seerr_request_sheet.dart +++ b/lib/widgets/seerr_request_sheet.dart @@ -5,6 +5,7 @@ import 'package:flutter/material.dart'; import 'package:material_symbols_icons/symbols.dart'; import '../focus/dpad_navigator.dart'; +import '../focus/focusable_button.dart'; import '../i18n/strings.g.dart'; import '../media/media_kind.dart'; import '../models/seerr/seerr_details.dart'; @@ -408,11 +409,15 @@ class _SeerrRequestSheetState extends State { Text(error, style: theme.textTheme.bodySmall?.copyWith(color: theme.colorScheme.error)), ], const SizedBox(height: 16), - FilledButton.icon( + FocusableButton( focusNode: _requestButtonFocusNode, + useBackgroundFocus: true, onPressed: _canSubmit ? _submit : null, - icon: _submitting ? const LoadingIndicatorBox() : const AppIcon(Symbols.download_rounded, fill: 1), - label: Text(t.seerr.request), + child: FilledButton.icon( + onPressed: _canSubmit ? _submit : null, + icon: _submitting ? const LoadingIndicatorBox() : const AppIcon(Symbols.download_rounded, fill: 1), + label: Text(t.seerr.request), + ), ), ], ], diff --git a/test/widgets/seerr_request_sheet_test.dart b/test/widgets/seerr_request_sheet_test.dart index 8beca3ef..695d7707 100644 --- a/test/widgets/seerr_request_sheet_test.dart +++ b/test/widgets/seerr_request_sheet_test.dart @@ -5,6 +5,7 @@ import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:http/http.dart' as http; import 'package:http/testing.dart'; +import 'package:plezy/focus/focusable_button.dart'; import 'package:plezy/i18n/strings.g.dart'; import 'package:plezy/media/media_kind.dart'; import 'package:plezy/models/seerr/seerr_session.dart'; @@ -159,6 +160,10 @@ void main() { // Nothing selected yet: submit disabled. final submitFinder = find.widgetWithText(FilledButton, 'Request'); expect(tester.widget(submitFinder).onPressed, isNull); + final focusableSubmit = tester.widget( + find.ancestor(of: submitFinder, matching: find.byType(FocusableButton)), + ); + expect(focusableSubmit.useBackgroundFocus, isTrue); await tester.tap(find.text('Season 2')); await tester.pump();