[ui perf] pause animations in hidden dashboard tabs (#3806)
What changed, and why it matters
This commit is a straightforward user-interface performance fix. It wraps each tab of the app's main dashboard in a Flutter widget called TickerMode, which pauses animations in tabs that are not currently visible. Before the change, a loading spinner on the hidden Charts tab was continuously redrawing the whole dashboard at up to 120 frames per second, wasting battery and causing visual stutter. The change also updates two automated test helpers so they can still find the correct tabs now that each is wrapped in TickerMode. There is no security relevance in this change.
No security action needed. Treat as a normal UI performance improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies lib/new-ui/new_dashboard.dart so the IndexedStack’s children are each wrapped in TickerMode(enabled: i == _selectedPage, child: …). This stops tickers/animations in off-screen tabs, eliminating unnecessary rebuilds caused by a persistent CircularProgressIndicator/loading spinner in the Charts tab’s ChartsInitial state. The integration test robots are updated to unwrap TickerMode when locating NewHomePage and WalletListPage widgets. The change is purely a UI performance optimization and does not alter business logic, network behavior, cryptography, storage, or permissions.
Changed components
lib/new-ui/new_dashboard.dartintegration_test/robots/home_page_robot.dartintegration_test/robots/wallet_list_page_robot.dartInspect captured patch +8 / −3
### integration_test/robots/home_page_robot.dart
@@ -26,7 +26,8 @@ class HomePageRobot extends BaseRobot {
}
final stack = tester.widget<IndexedStack>(stackFinder.first);
- final index = stack.children.indexWhere((child) => child is NewHomePage);
+ final index = stack.children
+ .indexWhere((child) => (child is TickerMode ? child.child : child) is NewHomePage);
return index >= 0 && stack.index == index;
}
### integration_test/robots/wallet_list_page_robot.dart
@@ -41,7 +41,8 @@ class WalletListPageRobot extends BaseRobot {
}
final stack = tester.widget<IndexedStack>(stackFinder.first);
- final index = stack.children.indexWhere((child) => child is WalletListPage);
+ final index = stack.children
+ .indexWhere((child) => (child is TickerMode ? child.child : child) is WalletListPage);
return index >= 0 && stack.index == index;
}
### lib/new-ui/new_dashboard.dart
@@ -84,7 +84,10 @@ class _NewDashboardState extends State<NewDashboard> {
// widget.dashboardPageWidgets[_selectedPage],
IndexedStack(
index: _selectedPage,
- children: widget.dashboardPageWidgets,
+ children: [
+ for (int i = 0; i < widget.dashboardPageWidgets.length; i++)
+ TickerMode(enabled: i == _selectedPage, child: widget.dashboardPageWidgets[i]),
+ ],
),
IgnorePointer(
child: Container(Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.