fix: Remove LEFT-to-sidebar from hubs
This commit is contained in:
@@ -179,12 +179,6 @@ class _DiscoverScreenState extends State<DiscoverScreen>
|
||||
return false;
|
||||
}
|
||||
|
||||
/// Navigate to the sidebar (called when user presses left at leftmost item)
|
||||
void _navigateToSidebar() {
|
||||
final focusScope = MainScreenFocusScope.of(context);
|
||||
focusScope?.focusSidebar();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
@@ -1040,7 +1034,6 @@ class _DiscoverScreenState extends State<DiscoverScreen>
|
||||
onRemoveFromContinueWatching: _refreshContinueWatching,
|
||||
isInContinueWatching: true,
|
||||
onVerticalNavigation: (isUp) => _handleVerticalNavigation(0, isUp),
|
||||
onNavigateLeft: _navigateToSidebar,
|
||||
onNavigateUp: () {
|
||||
_heroFocusNode.requestFocus();
|
||||
_scrollController.animateTo(0, duration: const Duration(milliseconds: 200), curve: Curves.easeOut);
|
||||
@@ -1059,7 +1052,6 @@ class _DiscoverScreenState extends State<DiscoverScreen>
|
||||
onRefresh: updateItem,
|
||||
// Hub index is i + 1 if continue watching exists, otherwise i
|
||||
onVerticalNavigation: (isUp) => _handleVerticalNavigation(_onDeck.isNotEmpty ? i + 1 : i, isUp),
|
||||
onNavigateLeft: _navigateToSidebar,
|
||||
onNavigateUp: (i == 0 && _onDeck.isEmpty) ? () {
|
||||
_heroFocusNode.requestFocus();
|
||||
_scrollController.animateTo(0, duration: const Duration(milliseconds: 200), curve: Curves.easeOut);
|
||||
|
||||
@@ -7,7 +7,6 @@ import '../../../mixins/item_updatable.dart';
|
||||
import '../../../models/plex_hub.dart';
|
||||
import '../../../models/plex_metadata.dart';
|
||||
import '../../../widgets/hub_section.dart';
|
||||
import '../../main_screen.dart';
|
||||
import 'base_library_tab.dart';
|
||||
|
||||
/// Recommended tab for library screen
|
||||
@@ -136,12 +135,6 @@ class _LibraryRecommendedTabState extends BaseLibraryTabState<PlexHub, LibraryRe
|
||||
return false;
|
||||
}
|
||||
|
||||
/// Navigate to the sidebar (called when user presses left at leftmost item)
|
||||
void _navigateToSidebar() {
|
||||
final focusScope = MainScreenFocusScope.of(context);
|
||||
focusScope?.focusSidebar();
|
||||
}
|
||||
|
||||
/// Focus the first item in the first hub (for tab activation)
|
||||
@override
|
||||
void focusFirstItem() {
|
||||
@@ -170,7 +163,6 @@ class _LibraryRecommendedTabState extends BaseLibraryTabState<PlexHub, LibraryRe
|
||||
onRemoveFromContinueWatching: isContinueWatching ? _refreshContinueWatching : null,
|
||||
onVerticalNavigation: (isUp) => _handleVerticalNavigation(index, isUp),
|
||||
onBack: widget.onBack,
|
||||
onNavigateLeft: _navigateToSidebar,
|
||||
onNavigateUp: index == 0 ? widget.onBack : null,
|
||||
);
|
||||
},
|
||||
|
||||
@@ -39,10 +39,6 @@ class HubSection extends StatefulWidget {
|
||||
/// Used to navigate focus back to the tab bar.
|
||||
final VoidCallback? onBack;
|
||||
|
||||
/// Called when the user presses LEFT while at the leftmost item.
|
||||
/// Used to navigate focus to the side navigation rail.
|
||||
final VoidCallback? onNavigateLeft;
|
||||
|
||||
/// Called when the user presses UP while at the topmost item (first hub).
|
||||
/// Used to navigate focus to the tab bar.
|
||||
final VoidCallback? onNavigateUp;
|
||||
@@ -57,7 +53,6 @@ class HubSection extends StatefulWidget {
|
||||
this.showServerName = false,
|
||||
this.onVerticalNavigation,
|
||||
this.onBack,
|
||||
this.onNavigateLeft,
|
||||
this.onNavigateUp,
|
||||
});
|
||||
|
||||
@@ -182,10 +177,8 @@ class HubSectionState extends State<HubSection> {
|
||||
HubFocusMemory.setForHub(widget.hub.hubKey, _focusedIndex);
|
||||
_scrollToIndex(_focusedIndex);
|
||||
setState(() {});
|
||||
} else if (widget.onNavigateLeft != null) {
|
||||
// At leftmost item - navigate to sidebar
|
||||
widget.onNavigateLeft!();
|
||||
}
|
||||
// At leftmost item: do nothing, but consume event to prevent focus escape
|
||||
return KeyEventResult.handled;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user