Skip to content

feat: add indoor vs outdoor air quality comparison (Closes #472) - #524

Open
Kushal-prime wants to merge 2 commits into
Aditya8369:mainfrom
Kushal-prime:feature/indoor-outdoor-comparison
Open

feat: add indoor vs outdoor air quality comparison (Closes #472)#524
Kushal-prime wants to merge 2 commits into
Aditya8369:mainfrom
Kushal-prime:feature/indoor-outdoor-comparison

Conversation

@Kushal-prime

Copy link
Copy Markdown
Contributor

Summary

This PR implements the Indoor vs. Outdoor Air Quality Comparison feature requested in #472.

The feature enables users to manually record indoor air quality readings, compare them with the current outdoor air quality, and receive contextual recommendations to help improve indoor air conditions.

Changes Made

  • Added a new IndoorTracker component.

  • Created a form for entering:

    • PM2.5
    • CO₂
    • VOC
  • Added input validation to ensure only valid values are accepted.

  • Persisted indoor readings to localStorage with a timestamp.

  • Displayed a side-by-side comparison of indoor and outdoor air quality.

  • Reused the existing Recharts library to visualize indoor vs. outdoor PM2.5 values.

  • Generated contextual recommendations based on the comparison (e.g., ventilation suggestions when indoor air quality is worse).

  • Integrated the component into the dashboard without introducing additional API calls.

  • Added unit tests covering validation, persistence, rendering, and comparison behavior.

Technical Details

  • Reused the existing outdoor air quality data supplied by the application.
  • Stored indoor readings under pollution_hub_indoor_aqi in localStorage.
  • Wrapped JSON.parse operations in try/catch to safely handle invalid or missing stored data.
  • No backend, API, or database changes were required.
  • No additional dependencies were introduced.

Testing

  • Form renders correctly
  • Input validation works as expected
  • Indoor readings persist after page refresh
  • Comparison chart renders successfully
  • Contextual recommendations update based on entered values
  • Unit tests pass
  • npm run lint passes
  • npm run build completes successfully

Notes

  • This implementation is fully client-side.
  • Follows the existing React architecture, styling, and Recharts usage.
  • Keeps changes localized to the new component and dashboard integration.
  • Avoids duplicate API requests by consuming the existing outdoor air quality data.

Closes #472

@vercel

vercel Bot commented Aug 2, 2026

Copy link
Copy Markdown

@superman32432432 is attempting to deploy a commit to the Aditya Mahajan's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the ECSoC26 Contributions considered under ECSoC'26 label Aug 2, 2026
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown

Thank You for Your Contribution! 🎉

Hi @Kushal-prime,

Thank you for opening this Pull Request and contributing to our project. We truly appreciate your efforts.

Please make sure that:

  • Your code follows the project's guidelines.
  • You have linked the appropriate issue (if applicable).
  • Screenshots are added for UI/UX changes.
  • Your PR is ready for review.

The maintainer @Aditya8369 will review your PR shortly!

Happy Contributing! 🚀

@Aditya8369

Copy link
Copy Markdown
Owner

@Kushal-prime pls solve conflicts and provide screenshot

@Aditya8369

Copy link
Copy Markdown
Owner

@Kushal-prime ??

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

Labels

ECSoC26 Contributions considered under ECSoC'26 merge-conflicts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Indoor vs. Outdoor Air Quality Comparison

2 participants