Implement Riverpod AsyncValue UI for catalog/orders/pricing/reports screens - #12
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9e2ade6d52
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| data: (items) => RefreshIndicator( | ||
| key: const Key('catalog_refresh'), | ||
| onRefresh: () => _reload(ref), | ||
| child: ListView.builder( |
There was a problem hiding this comment.
Make refresh list always scrollable
RefreshIndicator only fires when its child can overscroll, but this ListView.builder keeps default physics; when the catalog has no items (or too few items to exceed viewport height), users cannot trigger pull-to-refresh at all. Since the screen advertises pull-to-refresh behavior, add always-scrollable physics (and mirror the same fix in the parallel orders/pricing/reports screens) so refresh works for short/empty datasets.
Useful? React with 👍 / 👎.
Motivation
Text('... screen')with real UI that reads state from Riverpod providers and behaves like production features.AsyncValuestates (loading/error/data) to match existing controllers and test patterns.controller.load()during manual use and automated tests.Description
CatalogScreen,OrdersScreen,PricingScreen, andReportsScreentoConsumerWidgetand importedcore/di/providers.dartandflutter_riverpodto read their respective*StateProviders and controllers.state.when(...)rendering for each screen to show aCircularProgressIndicatorfor loading (*_loading), an error message plus retry button (*_error,*_retry) for errors, and aRefreshIndicator+ListViewof cards for data (*_refresh,*_list,*_item_*).controller.load()viaref.read(...notifier).load(), and added consistent widget keys (*_reload,*_list,*_loading,*_error, etc.) for automation.test/integration/auth_flow_integration_test.dartto wrap the router in aProviderScopeand overrideordersStateProviderwith a test controller so navigation assertions are deterministic, and addedtest/widget/async_feature_screens_test.dartto verify basic loading/error/data/reload behaviors for the modified screens.Testing
git diff --check) which returned no issues for the modified files and staged changes were prepared for commit.dart formatbut thedartbinary is not available in the current environment, so formatting and Dart-based test runs were not executed here.flutterand to capture a Playwright screenshot of a running app, butflutteris not available and there is no running web server, so UI/runtime validation could not be performed in this environment.test/widget/async_feature_screens_test.dartand updatedtest/integration/auth_flow_integration_test.dart), but they were not executed due to the missing Flutter/Dart tooling in this environment.Codex Task