Repository navigation
v1.62: eight bug fixes from the code review (pricing, saved plans, clearing readings, rebates, state changes) - #59
Merged
Conversation
…, battery rebate tiers - A built-in plan's saved prices are filled again when a new version of the app changes that plan's published prices. Prices the user changed are kept until then. - "Clear saved meter readings" now works after a Compare (database connections let go when the cache is deleted), removes households imported from NEM12, takes the results off the page and says what happened in the header, where it shows on every tab. - The Ausgrid export allowance is settled one calendar month at a time in Compare and the planner, as month by month and Free? already did, so all of them give the same Amber total. Bill? still settles the bill's own period. - The battery rebate follows the size tiers that started on 1 May 2026 (full to 14 kWh, 60% to 28 kWh, 15% to 50 kWh), and the default rate is the current one ($255 a kWh, was $330). - Removed the ?fakeControlledLoad and ?name=Rick hooks and the modal only they used. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016net8VNmbz2wYZE9p1zt6k
… Start tab wording - escapeHTML escapes quotes too, so a plan name (or NEM12 channel name) with a quote in it can't break out of an attribute. It no longer needs the DOM. - Changing state swaps a built-in plan for one from the new state, name and prices together, and refreshes the results. Rates typed by hand stay. A state with no plans for the site's network clears the old plan and says which state has them. - An Amber site outside NSW opens on its own state's plans rather than an empty NSW list. - Free? counts days by the readings' own dates, so a year is 365 days, not 366 with daylight saving. - The bill check points to the Start tab (was "Setup"), with a link. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016net8VNmbz2wYZE9p1zt6k
…nd wording tidy-ups - A Compare whose readings can't be saved in the browser (storage full) still shows its results and says the readings will download again. IndexedDB transactions reject on abort as well as error, so nothing is left waiting. - Saved settings that are damaged or the wrong shape fall back to the defaults instead of stopping the page loading. Damaged custom plans are left out. - Escape closes the settings and Download menus and returns focus to the button. - The calendar no longer draws a thick "selected" border on every day. - "X 31 days" is now "× 31 days", and month by month names the plan in its Difference column instead of "Other plan". - The "Rebates shrink each year" help no longer says it is used for a replacement battery, which is costed with no rebate. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016net8VNmbz2wYZE9p1zt6k
RickUsingGitHub
marked this pull request as ready for review
November 10, 2026 11:25
RickUsingGitHub
added a commit
that referenced
this pull request
Nov 15, 2026
v1.62: eight bug fixes from the code review (pricing, saved plans, clearing readings, rebates, state changes)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes eight bugs found in a review of the app, adds a few robustness and cosmetic fixes, and removes two debug hooks.
Bug fixes
1. Saved prices no longer override a built-in plan after its prices change
On reload the Compare plan form was filled from the values saved in the browser, so after a price update a returning user kept the old rates under the plan's name (and in its "Every plan" row). The form now remembers a fingerprint of the built-in plan it was filled from (
selectedPlanSig,Amber.templateSignature). If that no longer matches on load, the form is filled again from the current plan. Prices the user changed themselves are kept until the plan itself changes.2. "Clear saved meter readings" works
It always reported "Cache is busy", because database connections were never closed and blocked the delete. Connections now close themselves when the database is being deleted. The action also:
3. Amber's total agrees between the answer, month by month and Free?
The Ausgrid export allowance was pooled over the whole period in Compare and the planner's yearly figure, but applied per month in month by month and Free?. It is now settled one calendar month at a time everywhere (like demand), with part months getting the allowance for their days in the range. Bill? still settles the bill's own period as one settlement (
billPeriod).4. Battery rebate follows the size tiers
The planner applied a flat rebate per kWh to any battery size. Since 1 May 2026 the rebate is the full rate on the first 14 kWh, 60% from 14 to 28 kWh, 15% from 28 to 50 kWh and nothing above. The default rate is also updated from $330 to $255 a kWh (6.8 certificates per usable kWh from 1 May 2026, at about $37.50 each; $330 was the rate before that). A saved, untouched 330 moves to the new default. The breakdown text and help bubble explain the tiers.
5. Quotes in a plan name no longer break the markup
escapeHTMLescaped& < >but not quotes, so a plan name likeMy "special" plan(or a crafted NEM12 channel name) leaked stray attributes where it was used inside an attribute. It now escapes"and'too, and no longer needs the DOM.6. Changing state swaps the plan too
The state selector used to reset the plan to "Enter my own rates" while leaving the old plan's name, heading and prices in the form. Now:
#planStateNote);7. "Setup tab" wording
The bill check told users to add their key "on the Setup tab". It now says Start, with a link that goes there.
8. Free? day count
"Power going to the grid after dark on 306 of 366 days" for a 365-day period: days were counted by local date, and daylight saving added one. They are now counted by the readings' own dates, as elsewhere in the app.
Robustness
abortas well aserror, so a failed write can't leave Compare waiting on "Comparing…".touConfig,demandSettings,feedInWindows,customSupplierPlans,rateType) fall back to the defaults instead of stopping the page loading. Damaged custom plans are left out.Smaller tidy-ups
Debug hooks removed
?fakeControlledLoadand the?name=Rickmenu items ("Save custom plans", "Show stats"), plus the modal only they used.Behaviour changes worth knowing
templates.js. Custom plans are still in localStorage undercustomSupplierPlans.Tests
npm run test:unit: all pass, with new checks for monthly settlement, daily allocation,monthsInRange, the rebate tiers,escapeHTMLand the Free? day count. The planner's "Amber's months within 2 % of its year" is now exact.tests/v162.spec.js(12 tests).Sources for the rebate rules
🤖 Generated with Claude Code
https://claude.ai/code/session_016net8VNmbz2wYZE9p1zt6k