Skip to content

Implement Riverpod AsyncValue UI for catalog/orders/pricing/reports screens - #12

Merged
Faifor merged 1 commit into
mainfrom
codex/implement-asyncvalue-handling-in-screens
Mar 9, 2026
Merged

Implement Riverpod AsyncValue UI for catalog/orders/pricing/reports screens#12
Faifor merged 1 commit into
mainfrom
codex/implement-asyncvalue-handling-in-screens

Conversation

@Faifor

@Faifor Faifor commented Mar 9, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Replace placeholder screens that only showed Text('... screen') with real UI that reads state from Riverpod providers and behaves like production features.
  • Provide consistent handling for AsyncValue states (loading/error/data) to match existing controllers and test patterns.
  • Add simple user actions (reload/pull-to-refresh/retry) so screens can trigger controller.load() during manual use and automated tests.
  • Make widget keys and UX deterministic for existing integration and widget tests that rely on specific finders.

Description

  • Converted CatalogScreen, OrdersScreen, PricingScreen, and ReportsScreen to ConsumerWidget and imported core/di/providers.dart and flutter_riverpod to read their respective *StateProviders and controllers.
  • Implemented state.when(...) rendering for each screen to show a CircularProgressIndicator for loading (*_loading), an error message plus retry button (*_error, *_retry) for errors, and a RefreshIndicator + ListView of cards for data (*_refresh, *_list, *_item_*).
  • Added an AppBar reload button in each screen that calls controller.load() via ref.read(...notifier).load(), and added consistent widget keys (*_reload, *_list, *_loading, *_error, etc.) for automation.
  • Updated test/integration/auth_flow_integration_test.dart to wrap the router in a ProviderScope and override ordersStateProvider with a test controller so navigation assertions are deterministic, and added test/widget/async_feature_screens_test.dart to verify basic loading/error/data/reload behaviors for the modified screens.

Testing

  • Ran repository checks (git diff --check) which returned no issues for the modified files and staged changes were prepared for commit.
  • Attempted to run dart format but the dart binary is not available in the current environment, so formatting and Dart-based test runs were not executed here.
  • Attempted to query flutter and to capture a Playwright screenshot of a running app, but flutter is not available and there is no running web server, so UI/runtime validation could not be performed in this environment.
  • New widget and integration tests were added (see test/widget/async_feature_screens_test.dart and updated test/integration/auth_flow_integration_test.dart), but they were not executed due to the missing Flutter/Dart tooling in this environment.

Codex Task

@Faifor
Faifor merged commit 512e60f into main Mar 9, 2026
0 of 2 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant