Skip to content

feat(web): the dashboard takes the iOS app's palette - #1857

Merged
frahlg merged 1 commit into
masterfrom
web-ios-palette
Oct 25, 2026
Merged

frahlg merged 1 commit into
masterfrom
web-ios-palette

Conversation

@frahlg

@frahlg frahlg commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Why

Fredrik, 25 October 2026: the web app should take the iOS design, step by step, and the box page and the web app should take the iOS palette together ("Båda, i par"). They share color tokens: scripts/check-token-drift.mjs in srcfl/ftw-webapp holds them equal.

This is the box half. The web app half is srcfl/ftw-webapp#109. Merge both together.

The palette

From the iOS app (ftw-app appleApp/FTWCharts/Theme.xcassets), light / dark:

Role Light Dark
ground / raised / hairline F5F6F8 / FFFFFF / DCE0E7 05080F / 0B111C / 1B2433
ink / ink2 / ink3 0A0F1A / 545E70 / 677184 EEF3FF / 9AA5B8 / 727D90
solar 8A6C00 FFE14D
battery storing (and its level) / giving 00739A / A35700 18D9FF / FFB000
grid, both ways C2186F FF5FA8
car 6A48D8 B69CFF
live (a state) / alarm (a state) 2F7A00 / D70015 83F52C / FF453A
  • Energy and state are apart. The red/green names used to mark both the grid's direction and ok/failed. Every use was classified: grid direction stays on the energy role, which is now one pink both ways, with the sign and the word saying buy or sell. ok, connected and done → --live. Failed, refused, blocked and danger buttons → --alarm. New in both files: --live, --alarm, --energy-gives.
  • The accent is ink, as the iPhone's tint: primary buttons are ink with the ground for text (--on-accent). About 15 places that hard-coded black or white text on the accent now read --on-accent.
  • Prices are levels of ink, never red or green. Negative prices stay solar.
  • Freshness: --fresh-live is --live, and --fresh-stale is ink2.

Before and after, the box page against the home box (read only) and the web app on the demo:

Choices a reviewer may want to change

  1. Warnings that need no action now use --alarm in some places: control warnings (as the iOS control sheet does), the forecast's "waiting for data", and "charger saved with warnings". "Unconfirmed" in Plan could be ink2 instead.
  2. The fuse bar no longer turns yellow at 70 %. It stays grid like the iOS meter, and turns alarm from 90 %.
  3. Accent used as a warning now shows ink: the plan "warn" badge, editor warnings, WARN log lines and diagnostics "degraded".

Not done yet

Canvases and palettes with raw hex values do not read roles, so they keep the old colours. This covers the box's plan.js price bars (green/red) and charge/discharge, the energy-history.js series, heating.js, BATTERY_PALETTE/EV_PALETTE in app.js, and some raw rgba in style.css. The webapp's stats page has its own palette. These are the next step.

Open PRs that touch the same files

These will need a rebase after this merges: #1832 (style.css, lan-auth.js), #1792 and #1789 (app.js), #1751 (energy-flow-readings.js), #1547 (style.css). Most of the overlap is single colour lines.

Checks

  • npm test: 886/886. Palette assertions in web/theme-unification.test.mjs and web/header-status-marks.test.mjs are updated, and a new test checks grid, gives, live and alarm in both themes.
  • make verify passes.
  • Against the web app branch, check-token-drift.mjs reports 35 vendored token names checked in both themes, with no drift.
  • In the browser, against the home box through a GET-only proxy that refuses /api/config: Overview in dark and light, before and after. The repository asks a person to inspect the rendered page before merge.

🤖 Generated with Claude Code

theme.css now carries the phone's colours: a blue-black ground, ink for
the interface, one grid hue both ways, solar, a battery that stores in
cyan and gives in orange, a violet car, and two states, --live and
--alarm. --green and --red now alias those states; energy keeps the -e
names.

Every use of a red, green or amber name is sorted into energy or state.
States (ok, connected, done, failed, blocked, danger buttons, warnings
that need action) move to --live or --alarm; warnings that need no
action move to ink2. Battery, car and solar flows that sat on the grid
names move to their own hue. Prices and savings become ink levels.
Text on an accent fill reads --on-accent, now that the accent is ink.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-25T17:34:35.673737Z 6d8e870 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@frahlg
frahlg merged commit 286ac14 into master Oct 25, 2026
17 checks passed
frahlg added a commit that referenced this pull request Nov 11, 2026
* feat(web): the charts take the iOS app's palette

The canvases and chart palettes that kept raw hex after #1857 now read
colour roles. window.ftwThemeColors gains the energy and state roles
(solar, stores, gives, grid, car, live, alarm), and app.js's chart
colours gain the same, so every canvas draws in the theme it shows.

- Plan: prices are ink by tercile (32/50/80 %), tariff and VAT fainter
  ink3. The battery stores in cyan and gives in orange, the car is
  violet, the home is ink, the now line is ink. Plan marks draw at 75 %,
  as on the phone.
- History: home use is ink, solar amber, and the grid one pink both
  ways, so export hangs below the zero line.
- Live chart and 24 h battery chart: grid, solar, home, every battery in
  the storing hue and every car in violet, each a step fainter when a
  site has several. BATTERY_PALETTE and EV_PALETTE are gone. The 24 h
  chart redraws when the theme changes.
- Diagnose chart, heating charts (ink levels told apart by dash), the
  car plan timeline and the legends follow.
- style.css: diagnostics reasons, driver warning card, status bar,
  setup banner, fuse bars, plan tooltip and the remaining white
  overlays move to roles. Scrims and shadows stay black.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(web): tell export apart, and keep alarm for failures

Review fixes on the chart palette.

- Live Energy view: export draws dashed and unfilled in the one grid
  pink, with a dashed legend swatch and tooltip mark.
- Alarm only for refused, failed or blocked: an unsaved Home Assistant
  change gets its own ink class (ha-pending), and the first-run setup
  banner and the optimiser fallback box go to ink. "Plan stale", the
  failed driver card and HA "not connected" stay alarm.
- History: one step serves both sides of zero and both sides take whole
  steps, so a day that sells more than any bar above zero still has a
  gridline and a label under it. A "sold" caption under the zero line
  says what the unsigned lower labels count.
- Plan: tariff and VAT slices rise to 35 % and 20 % ink3, and the
  legend swatches match.
- The 24 h battery chart redraws from the items it last drew when the
  theme changes, rather than fetching again.
- Heating: the return line takes a dash, so it parts from supply.
- Tests: the live chart maps each role to the same token as the shared
  resolver; export larger than every bar above zero reaches the lowest
  gridline with no minus sign; live export is dashed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@frahlg
frahlg deleted the web-ios-palette branch November 11, 2026 09:23
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.

1 participant