Skip to content

v1.65: tables that fit, one number format, and a bill check that keeps to itself - #60

Merged
RickUsingGitHub merged 3 commits into
mainfrom
claude/ecstatic-brown-95vo21
Nov 11, 2026
Merged

RickUsingGitHub merged 3 commits into
mainfrom
claude/ecstatic-brown-95vo21

Conversation

@RickUsingGitHub

@RickUsingGitHub RickUsingGitHub commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

The remaining items from the code review: clipped tables, inconsistent number formatting, and Bill? changing the dates at the top.

Brought up to date with main (10 Nov). This was opened as v1.63 before ESLint (#61) and the app.js split (#62) merged, and they took v1.63 and v1.64. It is now v1.65, merged with main:

  • Its js/app.js 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, without being retyped: the answer and month tables in app-results.js, the bill check's own loading in app-bill.js, the Free? tables in app-free.js, scrollBox / syncScrollHints in app-core.js, and loadReadings in app.js. I checked that the merge carries exactly the lines this pull request added and removed.
  • Two lint fixes on top: demandMonthsHtml keeps its single argument, and monthRow no longer takes the money formatter as a parameter (its file uses Amber.money).
  • tests/v163.spec.js is now tests/v165.spec.js. No assertion changed.

Tables

On a computer every Compare and Free? table now fits its card (measured at 1024 px and 1280 px wide):

  • the page column is a little wider (max-w-5xl, was max-w-4xl);
  • month by month keeps all eleven columns: its headings wrap onto two lines and its cells are tighter. It was 1,357 px wide in a 784 px card, with Amber, the plan and Difference off-screen;
  • in the answer, a plan's rate sits under its amount instead of beside it.

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

  • Dollars: Amber.money everywhere. "$1,234.56" with thousands separated and a proper minus sign; whole dollars on Solar+? as before. Never "−$0.00".
  • Percentages: no space before the sign on Solar+? ("20%", was "20 %"), matching the other tabs.
  • Dates: written out with Amber.formatDate ("31 Oct 2026") in the plan-prices note, chart titles and the day picker (which also shows the weekday).
  • Rates: "27.11 c/kWh" (was "(27.11c/kWh)").
  • kWh in the Compare tables have thousands separated.

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 fetchAndCompare into loadReadings, which both use. Opening the page on Bill? now runs the usual "This month" Compare as well as loading the bill.

Smaller things

  • The table CSV download leaves out the "?" help buttons and the phone-only lines.
  • Month by month says "Plan $x cheaper". v1.62 put the plan's full name there, which made every row three lines tall with real plan names.

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.md now records that.

Tests

On the merged result:

  • npm run lint: clean.
  • npm run test:unit: all pass (new checks for Amber.money and Amber.formatDate, plus main's syntax and Amber.app checks).
  • Playwright: 69 pass. tests/v165.spec.js covers tables fitting on a computer, the phone layout, the formats and the table CSV. tests/billcheck.spec.js is updated for the bill check's own loading: the dates stay as chosen.
  • npm run build:css leaves the committed css/app.css unchanged.

Generated by Claude Code

…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
@RickUsingGitHub RickUsingGitHub changed the title v1.63: tables that fit, one number format, and a bill check that keeps to itself v1.65: tables that fit, one number format, and a bill check that keeps to itself Nov 10, 2026
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
RickUsingGitHub marked this pull request as ready for review November 11, 2026 01:32
@RickUsingGitHub
RickUsingGitHub merged commit e817ba0 into main Nov 11, 2026
1 check passed
@RickUsingGitHub
RickUsingGitHub deleted the claude/ecstatic-brown-95vo21 branch 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
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.

2 participants