From 44951de8f52c51ce8057d915cf69fcc16b8613cb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Feb 2026 19:17:30 +0000 Subject: [PATCH 1/2] Initial plan From b9e298851ba68992dcf35efdf86ea96bac0fd7c9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Feb 2026 19:19:49 +0000 Subject: [PATCH 2/2] Add 30-second debounce to tab refresh in HomeShell Co-authored-by: derkauzigekoala <79001016+derkauzigekoala@users.noreply.github.com> --- lib/screens/home_shell.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/screens/home_shell.dart b/lib/screens/home_shell.dart index 1a0590e..e833375 100644 --- a/lib/screens/home_shell.dart +++ b/lib/screens/home_shell.dart @@ -15,6 +15,8 @@ class _HomeShellState extends State { int _currentIndex = 0; final _collectionsKey = GlobalKey(); final _scanKey = GlobalKey(); + final Map _lastRefreshed = {}; + static const _refreshDebounce = Duration(seconds: 30); late final List _pages = [ CollectionsScreen(key: _collectionsKey), @@ -24,10 +26,13 @@ class _HomeShellState extends State { void _onTabSelected(int i) { setState(() => _currentIndex = i); + final now = DateTime.now(); + final last = _lastRefreshed[i]; + if (last != null && now.difference(last) < _refreshDebounce) return; + _lastRefreshed[i] = now; if (i == 0) { _collectionsKey.currentState?.refresh(); - } - if (i == 1) { + } else if (i == 1) { _scanKey.currentState?.refresh(); } }