fix(tv): reveal details without input
This commit is contained in:
@@ -779,21 +779,19 @@ class _MediaDetailScreenState extends State<MediaDetailScreen>
|
||||
|
||||
_tvDetailRevealScheduled = true;
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
_tvDetailStableRailHeight = _tvDetailPendingRailHeight ?? railHeight;
|
||||
_tvDetailRevealScheduled = false;
|
||||
_tvDetailRevealed = true;
|
||||
});
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
_tvDetailStableRailHeight = _tvDetailPendingRailHeight ?? railHeight;
|
||||
_tvDetailRevealScheduled = false;
|
||||
_tvDetailRevealed = true;
|
||||
});
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (!mounted) return;
|
||||
if (focusPrimaryAction) {
|
||||
_playButtonFocusNode.requestFocus();
|
||||
} else {
|
||||
_tvDetailRailKey.currentState?.requestFocus();
|
||||
}
|
||||
});
|
||||
if (focusPrimaryAction) {
|
||||
_playButtonFocusNode.requestFocus();
|
||||
} else {
|
||||
_tvDetailRailKey.currentState?.requestFocus();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -70,6 +70,38 @@ void main() {
|
||||
expect(titleText.style!.fontSize!, lessThan(baseFontSize));
|
||||
});
|
||||
|
||||
testWidgets('TV detail reveals without waiting for directional input', (tester) async {
|
||||
await SettingsService.getInstance();
|
||||
|
||||
final movie = MediaItem(
|
||||
id: 'movie_1',
|
||||
backend: MediaBackend.jellyfin,
|
||||
kind: MediaKind.movie,
|
||||
title: 'Idle Reveal Movie',
|
||||
summary: 'The detail foreground should appear without needing a D-pad frame.',
|
||||
);
|
||||
|
||||
await tester.pumpWidget(
|
||||
TranslationProvider(
|
||||
child: MaterialApp(
|
||||
theme: monoTheme(dark: true),
|
||||
home: MediaDetailScreen(metadata: movie),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final revealGate = find.byWidgetPredicate(
|
||||
(widget) => widget is AnimatedOpacity && widget.duration == const Duration(milliseconds: 160),
|
||||
description: 'TV detail reveal AnimatedOpacity',
|
||||
);
|
||||
expect(revealGate, findsOneWidget);
|
||||
expect(tester.widget<AnimatedOpacity>(revealGate).opacity, 0);
|
||||
|
||||
await tester.pump();
|
||||
|
||||
expect(tester.widget<AnimatedOpacity>(revealGate).opacity, 1);
|
||||
});
|
||||
|
||||
testWidgets('TV detail defaults to first regular season when specials precede it', (tester) async {
|
||||
await SettingsService.getInstance();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user