fix(seerr): align request button focus

This commit is contained in:
edde746
2026-07-12 22:19:42 +02:00
parent b9f828ae88
commit 26d14f7cb0
2 changed files with 13 additions and 3 deletions
+8 -3
View File
@@ -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<SeerrRequestSheet> {
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),
),
),
],
],
@@ -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<FilledButton>(submitFinder).onPressed, isNull);
final focusableSubmit = tester.widget<FocusableButton>(
find.ancestor(of: submitFinder, matching: find.byType(FocusableButton)),
);
expect(focusableSubmit.useBackgroundFocus, isTrue);
await tester.tap(find.text('Season 2'));
await tester.pump();