User Interface low complexity mobile
1
Dependencies
0
Dependents
0
Entities
0
Integrations

Description

Shows the status of an in-progress aggregation computation, providing visual feedback when Supabase RPC functions are executing. Displays warnings if data gaps or deduplication anomalies are detected during aggregation.

Feature: Bufdir Data Aggregation

aggregation-progress-indicator

Summaries

This UI component ensures coordinators always know the status of data aggregation operations, preventing confusion or duplicate submissions during the Bufdir reporting workflow. When aggregation computations take time to execute — as they do with large datasets spanning full reporting periods — clear progress feedback reassures users the system is working, reducing support contacts and preventing coordinators from abandoning or repeating the process. Warning banners for deduplication anomalies give coordinators early notice of data quality issues that could affect report accuracy, allowing them to resolve problems before submission rather than after. The retry option on failure ensures coordinators can self-recover from transient errors without IT intervention, supporting operational independence and reducing support burden across the organization.

This is a low-complexity mobile UI component with a single dependency on the Bufdir aggregation service, making it straightforward to develop and test. It is, however, on the critical path for the Bufdir reporting feature — coordinators cannot proceed to export without passing through this feedback state.

Testing should cover three primary states: loading (spinner visible, actions disabled), complete (metrics rendered, export unlocked), and error (error message displayed with retry button active). The deduplication warning path requires test fixtures that simulate conflict scenarios from the aggregation service. Because this component appears at a high-stakes moment in the workflow (just before export), UX review is recommended to ensure warning messages are clear and actionable rather than alarming. No backend provisioning is required beyond what the aggregation service already needs.

This Flutter widget manages a simple state machine with four display states driven by the `BufdirAggregationService`: loading (`showAggregationLoading()`), complete (`showAggregationComplete(result)`), error (`showAggregationError(error)`), and warning (`showDeduplicationWarning(conflicts)`). The `onRetryPressed(callback)` interface accepts a callback to re-trigger the aggregation computation from the parent widget or ViewModel, keeping retry logic out of the indicator itself. State transitions should be driven by a Cubit or StreamBuilder bound to the aggregation service's status stream. The deduplication warning state is non-blocking — it should display alongside (not replace) the complete state, since conflicted data may still be exportable with coordinator acknowledgment.

Error messages should be human-readable and avoid exposing raw Supabase RPC error codes. Loading state should disable downstream export actions in the parent screen to prevent premature submission.

Responsibilities

  • Display loading state while aggregation queries execute
  • Show warning banners for detected deduplication conflicts
  • Provide retry option on aggregation failure

Interfaces

showAggregationLoading()
showAggregationComplete(result)
showAggregationError(error)
showDeduplicationWarning(conflicts)
onRetryPressed(callback)

Relationships

Dependencies (1)

Components this component depends on