fix: hero not being focused

This commit is contained in:
edde746
2026-02-08 12:38:50 +01:00
parent 7f0666afbc
commit e915df0490
2 changed files with 9 additions and 0 deletions
+1
View File
@@ -543,6 +543,7 @@ class _DiscoverScreenState extends State<DiscoverScreen>
if (!_isAutoScrollPaused) {
_startAutoScroll();
}
_focusTopBoundary();
}
// Helper method to calculate visible dot range (max 5 dots)
+8
View File
@@ -522,6 +522,14 @@ class _MainScreenState extends State<MainScreen> with RouteAware, WindowListener
void _focusContent() {
setState(() => _isSidebarFocused = false);
_contentFocusScope.requestFocus();
// When content regains focus while on Discover, focus the hero section
if (_currentIndex == 0 && !_isOffline) {
WidgetsBinding.instance.addPostFrameCallback((_) {
if (_discoverKey.currentState case final TabVisibilityAware aware) {
aware.onTabShown();
}
});
}
// When content regains focus while on Libraries, retry focusing the active tab
if (_currentIndex == 1 && !_isOffline) {
WidgetsBinding.instance.addPostFrameCallback((_) {