Repository navigation
feat(now): the home as the iPhone's ring - #110
Merged
Merged
Conversation
Now draws the house as the iOS app does (Ring / Quiet): what the home uses in the middle of a ring, each other node as text on the ground in its corner, and the quarter facing it lit from its middle out, longer with more power. A wave of light runs along a lit arc toward the home or away from it. Only readings the box confirms live glow or move; a cache or a quiet source is a still arc in ink. Reduced motion holds the light still and draws a chevron. The numbers are the phone's: ring.ts ports FlowPlan/RingGeometry from NowFlow.swift, ring-motion.ts ports Follow/Light/RingMotion from Flow.swift, and EnergyRing.svelte draws it on one canvas with the labels as buttons. Taps open the same sheets as before. The loop runs only while an arc is live and flowing, or 2.4 s after a change, and only while Now is on screen. FLOW_IDLE_W now lives in flow.ts with a test holding it to the box's value, so the first chunk no longer loads the box's hero component for one number: 17 kB smaller, 5 kB gzipped, than main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
ftw-webapp | 29edffa | Commit Preview URL Branch Preview URL |
Oct 25 2026, 06:38 PM |
From the review of #110: - The ring and its glow get their own room: at a wide column (a large root font) the label box shrank below the 300 px ring and clipped it. The label box now spans the ring there, so labels keep to its corners. - A missing house reading is "—, no reading", not a live 0 W (FlowReadings.load is now number | null). - A folded node with one device missing is not live, and a placeholder opens nothing unless it carries a control mark, as the box's hero did. - A reading that is not a number counts as none. - Now keys the ring by what it draws (ringKey: quantised figures), so a 1 W wobble repaints nothing. Colours are read once per theme with one probe canvas, not on every changed tick. - A hidden view's width of 0 is ignored, so the first frame back is not drawn at 360 px. Tests: the status snapshot must reach the ring and a stale one must not (a control mark and a house use only the snapshot carries); the loop runs while a live arc flows and rests on a hidden page or tab; a recording 2D context shows a live arc glowing in its colour and a cache drawn in ink at no more than 0.35. The old hero's control-mark tests now run against the ring. Each new test fails on the mutant it names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Step 2 of taking the iOS design to the web app (Fredrik, 25 October 2026: "Steg för steg"). Step 1 was the tabs (#108) and the palette (#109).
What changes
Now draws the house as the iOS app does (Ring / Quiet, chosen 24 October 2026):
ringFill: a fifth at 0.6 kW, half at 1.8 kW, nine tenths at 6 kW).srcStatenot live) is a still arc in ink. Under reduced motion the light holds still and a chevron shows the direction.agg-…).How
src/lib/state/ring.tsportsFlowPlan,RingGeometry,ringFillandquantisedfromNowFlow.swift/Flow.swift. It also foldsFlowReadingsinto nodes.src/lib/state/ring-motion.tsportsFollow,LightandRingMotion. These are plain values stepped once per frame, so tests can run them.src/views/EnergyRing.sveltedraws on one canvas, with conic-gradient stops ten to a wavelength as on iOS. The labels are buttons.Now.sveltefeeds the ring only while it is the view on screen. It replaces the nodes only when what they show changes.FLOW_IDLE_W(42 W) now lives inflow.ts, with a test holding it equal to the box's value. The first chunk no longer loads the box's hero component for that one number: index chunk 243 102 → 225 985 bytes (86.5 → 81.3 kB gzipped) against main.The box's own page still uses
<ftw-energy-flow>. Moving it to the ring is a separate pair of PRs once this one has been lived with.Not kept from the old hero
Evidence
ftwSim.fault({sourceStates: {'inverter.sungrow': 'stale'}}): every arc still and in ink, labels in ink;ring.test.ts,ring-motion.test.ts,EnergyRing.svelte.test.ts;svelte-checkpasses with 0 errors, andvite buildsucceeds.check:statsandbuild:statsneed the Cloudflare types, so CI runs them.After review (29edffa)
An agent review found no fault in signs, colours or the frame loop. It did find these, all fixed:
FlowReadings.loadis nownumber | null, and the hub shows "—, no reading".ringKey, quantised figures), and colours are read once per theme.The review also called some tests vacuous; they now prove their claims:
tests/control-proof-bubbles.test.ts) now run against the ring (EnergyRing.marks.svelte.test.ts).Left as follow-ups:
withLoadpointEvstill subtracts the car from the house load. The phone stopped doing that ("Core owns the house load").🤖 Generated with Claude Code