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:
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:
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, orsrc/components/AlertsPanel.jsxThe feature should:
readSymptomReports()fromSymptomReportButton.jsx.SYMPTOM_REPORT_SUBMITTEDevent so the insight remains live without requiring a page refresh.Example
The UI could display something similar to:
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.jsxReuse the existing: