Skip to content

Add estimated water usage tracking to token usage display#11

Merged
rajbos merged 4 commits intomainfrom
copilot/fix-b094bdbe-dca1-4347-b45b-4c9457257bf6
Sep 28, 2025
Merged

Add estimated water usage tracking to token usage display#11
rajbos merged 4 commits intomainfrom
copilot/fix-b094bdbe-dca1-4347-b45b-4c9457257bf6

Conversation

Copy link
Contributor

Copilot AI commented Sep 26, 2025

  • Add water usage estimation constants and interface updates
  • Implement water usage calculation in calculateDetailedStats method
  • Add water usage display to status bar tooltip
  • Add water usage display to detailed HTML panel
  • Add calculation explanation for water usage estimation
  • Test the implementation and verify all displays work correctly
  • Remove package-lock.json from changeset per review feedback

✅ Implementation Complete

Water Usage Estimation Feature Successfully Added

Key Features Implemented:

  • Estimation Rate: 0.3 liters per 1000 tokens (based on data center water usage research)
  • Status Bar Tooltip: Shows "Water Est.: X.XXXL" for both today and monthly usage
  • Detailed Panel: New table row with 💧 icon showing water usage across time periods
  • Projection: Includes yearly projection based on current month usage
  • Documentation: Added calculation explanation describing data center water usage

Technical Implementation:

  • Updated DetailedStats interface with waterUsage: number field
  • Added waterUsagePer1kTokens = 0.3 constant
  • Integrated water calculation alongside existing CO₂ calculations
  • Updated HTML generation with proper formatting (3 decimal places)
  • All code compiles successfully with no lint errors
  • Removed unnecessary package-lock.json changes per review feedback

UI Integration:

  • Tooltip displays water usage below CO₂ estimates
  • Detail panel shows water row between CO₂ and tree equivalent rows
  • Consistent styling and formatting with existing metrics
  • Clear explanation in "Calculation & Estimates" section

The feature provides users with insight into their environmental impact beyond just CO₂, helping them understand the water resources consumed by their AI usage.

Original prompt

This section details on the original issue you should resolve

<issue_title>Show the estimated water usage</issue_title>
<issue_description>show in the flyout and the detail panel the estimated liters of water used with the tokens.

Also add the info how that calculation is done</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #10

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits September 26, 2025 22:29
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
Copilot AI changed the title [WIP] Show the estimated water usage Add estimated water usage tracking to token usage display Sep 26, 2025
Copilot AI requested a review from rajbos September 26, 2025 22:36
@rajbos
Copy link
Owner

rajbos commented Sep 28, 2025

@copilot remove the package.json from this changeset, that change is not needed

Copy link
Contributor Author

Copilot AI commented Sep 28, 2025

@copilot remove the package.json from this changeset, that change is not needed

Removed package-lock.json from the changeset. The file has been reverted to its original state before my changes, keeping only the water usage feature implementation in src/extension.ts.

@rajbos rajbos marked this pull request as ready for review September 28, 2025 09:28
@rajbos rajbos merged commit 06d43cf into main Sep 28, 2025
9 checks passed
@rajbos rajbos deleted the copilot/fix-b094bdbe-dca1-4347-b45b-4c9457257bf6 branch September 28, 2025 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show the estimated water usage

2 participants

Comments