Skip to content

[FEATURE] Add symptom-report and AQI correlation insight #1154

Description

@Suprita736

Feature Summary

Add a small insight card that compares recent community symptom reports with the current AQI reading.

The insight should show users how many symptom reports were submitted today versus yesterday alongside the current AQI, helping them understand the local context of the data already being collected.

Problem Statement

The application already collects and stores community symptom reports through SymptomReportButton.jsx, and the current AQI is available elsewhere in the application.

However, these two sources of information are currently presented separately.

Users have no quick way to see whether there has been an increase or decrease in community symptom reports while viewing the current air-quality conditions.

For example:

14 symptom reports today vs. 3 yesterday — Current AQI: 187

This would make the existing symptom-report data more useful without requiring a new backend or data source.

Proposed Solution

Add a compact symptom/AQI insight section to an appropriate existing health or alert UI, such as:

  • src/components/HealthAdvisory.jsx, or
  • src/components/AlertsPanel.jsx

The feature should:

  • Read existing reports using readSymptomReports() from SymptomReportButton.jsx.
  • Bucket reports into today and yesterday based on their existing timestamps/date values.
  • Display the number of reports submitted today.
  • Display the number of reports submitted yesterday for comparison.
  • Display the current AQI alongside the report counts.
  • Update automatically when a new symptom report is submitted.
  • Subscribe to the existing SYMPTOM_REPORT_SUBMITTED event so the insight remains live without requiring a page refresh.
  • Handle zero reports gracefully.
  • Handle missing or invalid timestamps without crashing.
  • Reuse the application's existing AQI display/classification patterns.

Example

The UI could display something similar to:

Community Health Insight
14 symptom reports today vs. 3 yesterday
Current AQI: 187

The wording should describe the relationship as an observation or comparison and must not imply that AQI directly causes the reported symptoms.

Implementation Details

src/components/SymptomReportButton.jsx

Reuse the existing:

readSymptomReports()

Activity

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

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions