Repository navigation
v1.65: tables that fit, one number format, and a bill check that keeps to itself - #60
Merged
Merged
Conversation
…s to itself
- Compare and Free? tables fit their cards on a computer (the page column is
a little wider, month by month headings wrap and its cells are tighter).
On a phone the answer table hides When and kWh and shows them under What,
so both prices show without swiping; Every plan fits too. Wider tables
scroll in their own box with the first column staying in view, and a note
appears only while part of a table is off-screen.
- Dollars are written one way everywhere ("$1,234.56", a proper minus sign,
whole dollars on Solar+?), percentages have no space before the sign,
dates are written out ("31 Oct 2026") and a plan's rate sits under its
amount as "27.11 c/kWh".
- The bill check loads its own period and leaves the dates at the top and
the Compare results alone. Opening the page on Bill? no longer replaces
the opening This month Compare.
- The table CSV leaves out the "?" help buttons.
- Month by month says "Plan $x cheaper" (the plan's full name made every
row three lines tall).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016net8VNmbz2wYZE9p1zt6k
main gained ESLint and the split of js/app.js into app-*.js after this branch was cut, and took the v1.63 and v1.64 version numbers. - js/app.js: this branch's changes were written against the old single file. They were merged onto the regrouped single file and the same split script was run again, so each change lands in the file its function now lives in (app-results.js, app-bill.js, app-free.js, app-core.js, app.js) without being retyped. loadReadings is in app.js, billChannelData in app-bill.js, scrollBox and syncScrollHints in app-core.js; files that format dollars alias Amber.money. - Lint: demandMonthsHtml keeps its single argument, and monthRow no longer takes the money formatter as a parameter. - Version 1.65 in index.html, constants.js and unit-time.js; tests/v163.spec.js becomes tests/v165.spec.js. - Docs: module map and test counts updated. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016net8VqMzbBJe1deXahjg6
The two layout tests in tests/v165.spec.js passed here and failed on GitHub, on this branch's first commit as well as after the merge. The app uses the system font, and the Ubuntu runner's default (DejaVu Sans) is about 10% wider than the one the layout was measured with: the month table was 55 px too wide on a computer, and on a phone the answer was 3 px and "Every plan" 11 px too wide. - A scroll box whose table doesn't fit is marked data-tight (syncScrollHints), and cells with a group-data-[tight]: class give way before anything scrolls: the month table's Difference column wraps on a computer, and a long word in a plan's name may break in "Every plan". With a font the tables already fit in, nothing changes. - The answer and "Every plan" tables have slightly tighter sides on a phone (px-1.5, was px-2). Reproduced with fontconfig set to DejaVu Sans: 2 failed before, 69 pass after; still 69 with the default font, and the spec passes with Liberation Sans and FreeSans too. No test changed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016net8VqMzbBJe1deXahjg6
RickUsingGitHub
marked this pull request as ready for review
November 11, 2026 01:32
RickUsingGitHub
added a commit
that referenced
this pull request
Nov 15, 2026
v1.65: tables that fit, one number format, and a bill check that keeps to itself
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.
The remaining items from the code review: clipped tables, inconsistent number formatting, and Bill? changing the dates at the top.
Tables
On a computer every Compare and Free? table now fits its card (measured at 1024 px and 1280 px wide):
max-w-5xl, wasmax-w-4xl);On a phone the answer shows both prices without swiping. "When" and "kWh" are hidden and shown under "What" instead. "Every plan" fits as well (the cell says "$386.86 cheaper", with "than Amber" left to the heading).
Tables that are still too wide (month by month and the Free? tables on a phone) scroll inside their own box, not the whole card, with the first column staying in view. A note, "Scroll the table sideways to see every column →", appears only while part of a table is off-screen (
Amber.scrollBox,Amber.syncScrollHints).The answer table has one row shape now (five cells, no column spans), which is what lets columns step aside on a phone.
One format for numbers
Amber.moneyeverywhere. "$1,234.56" with thousands separated and a proper minus sign; whole dollars on Solar+? as before. Never "−$0.00".Amber.formatDate("31 Oct 2026") in the plan-prices note, chart titles and the day picker (which also shows the weekday).Bill? keeps to itself
Opening Bill? with a saved bill used to set the dates at the top to the bill's period and re-run Compare. The bill check now loads its own readings for the bill period (
ensureBillLoaded→loadReadings→state.billData) and leaves the dates and the Compare results alone. If the results on show already cover the bill, they are used.To do this the cache-then-Amber loading was lifted out of
fetchAndCompareintoloadReadings, which both use. Opening the page on Bill? now runs the usual "This month" Compare as well as loading the bill.Smaller things
Not changed: tab names
Bill?, Free? and Solar+? stay as they are. Longer names on a computer ("Bill check", "Free power?", "Solar & battery") were tried and replaced by the short ones in v1.53, so this is left as a deliberate choice.
docs/FRONTEND.mdnow records that.Tests
On the merged result:
npm run lint: clean.npm run test:unit: all pass (new checks forAmber.moneyandAmber.formatDate, plusmain's syntax andAmber.appchecks).tests/v165.spec.jscovers tables fitting on a computer, the phone layout, the formats and the table CSV.tests/billcheck.spec.jsis updated for the bill check's own loading: the dates stay as chosen.npm run build:cssleaves the committedcss/app.cssunchanged.Generated by Claude Code