Skip to content

iPhone: the plan says why in the same sentence (plan pass 1) - #57

Merged
frahlg merged 1 commit into
mainfrom
claude/ios-plan-why
Oct 14, 2026
Merged

frahlg merged 1 commit into
mainfrom
claude/ios-plan-why

Conversation

@frahlg

@frahlg frahlg commented Oct 14, 2026

Copy link
Copy Markdown
Member

Plan pass, change 1 of 5: the plan says why in the same sentence. Fredrik said yes to all five changes in design/ftw-ios-polish-2026-10/plan-pass.md on 14 Oct; this is the first, on main after WP10 (#52) and WP11 (#53).

What changes

Now's strip. The sentence under the strip carries the box's reason as what drives it:

Batteriet ger ström till 21:00, när elen kostar upp till 173 öre. Lagrar sedan 22:30 för 50,5 öre.

The first clause is the next thing the box does, the second what follows; each says why. The line keeps its two reserved rows and may shrink to 85 % before it would lose its end.

Under the dial. Up to three sentences take the place of the four event rows, which said the same thing twice: the battery's next two moves and the car's next charge, in order, each with its reason. Each verb has the colour its ticks have (ink gives power, cyan stores, violet for the car), so the words are the dial's legend. The CHEAPEST line and the planned line stay. The lanes view keeps its rows.

The reasons, from the box's own codes, never its prose:

Code Said as
expensive_import (gives power) ", when power costs up to 173 öre" (the dearest quarter in the run)
cheap_import (stores) " for 50,5 öre" (the run's mean); ", when you are paid to use power" below zero
solar_surplus " from spare sun"
export_paid ", as selling pays"
peak_shaving " to hold the grid limit"
the car ", to 80 %", its goal

A reason with no price under it leaves the clause bare rather than guessing a number.

How

PlanGlance.clause builds one sentence per event with its verb marked (*gives power* in the strings), so the strip strips the marks and the plan view colours what is between them. PlanGlance.Phrase carries the parts; Moment.story holds the dial's sentences. Swedish word order lives in the strings (*Ger* sedan *ström* %@).

Evidence

  • swift test: FTWShared 214 and FTWKit 365 tests green. New and changed in PlanStripTests: the sentence under way, to come and old with its reasons; each reason code said as what drives it; the story under the dial with its marked verbs; nothing to tell before the box answers.
  • UI tests on the iPhone SE (3rd generation), iOS 26.5: NowFitsTests 11 of 11, PlanStripTests 3 of 3, PlanDialTests 3 of 3. The first run failed to install the test runner on a fresh simulator (installcoordinationd did not answer); the rerun passed.
  • Screenshots below, from the demo in Swedish.

Pictures

Now, dark and light: the sentence under the strip says what comes next and why.

Now with the plan sentence, dark and light

The plan view, dark, light and the largest text: the dial's story, each verb in its ticks' colour, in place of the event rows.

The plan view with the story under the dial

🤖 Generated with Claude Code

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

chatgpt-codex-connector Bot commented Oct 14, 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-14T19:18:29.212021Z 87e9e77 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 87e9e779e8

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +478 to +480
case (.discharge, _):
guard let top = under.map(\.totalMinor).max() else { return lead }
return PlanWord.whyDear.format(lead, price(top))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restrict price prose to matching reason codes

When a priced battery event carries an unknown/new reason code—or a known non-price reason such as reserve_held—these wildcard branches describe every discharge as caused by expensive power and every charge as caused by cheap/negative power. That invents a user-facing explanation instead of reporting the box's reason; match only expensive_import and cheap_import, and leave unsupported reasons bare or map them explicitly.

Useful? React with 👍 / 👎.

@frahlg
frahlg merged commit 3c4ed60 into main Oct 14, 2026
1 check passed
frahlg added a commit that referenced this pull request Oct 14, 2026
…nst guessed, and the planning style as a scale (#58, #59, #60, #61)

One squash for four stacked PRs, changes 2–5 of the plan pass Fredrik approved on 14 Oct 2026 (change 1 was #57):
- #58: the planned battery level in the scrub, a dashed level line in the lanes and the dial's story (socPermille from srcfl/ftw#1630).
- #59: one honest saving under the dial, against no battery, only when the plan ends near its start level.
- #60: known against guessed: the dashed sun, hatched unpriced quarters, the style named when it is not balanced.
- #61: the two levers at the foot of the plan view, the planning style as a detented scale (Fredrik's note 21), one command on release with the receipt, and only moved quarters cross-faded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@frahlg frahlg mentioned this pull request Oct 14, 2026
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