Skip to content

feat(ios): the price stands on zero - #138

Merged
frahlg merged 1 commit into
mainfrom
ios-price-scale
Nov 1, 2026
Merged

frahlg merged 1 commit into
mainfrom
ios-price-scale

Conversation

@frahlg

@frahlg frahlg commented Nov 1, 2026

Copy link
Copy Markdown
Member

Problem

Erik, 1 November 2026, about Now's strip: "the price graph down there looks like the price will be five times dearer tonight, when it is about 450 against 550 öre". He pointed at elklocka.se, where the bars stand on zero.

PlanStrip.level and PlanDial.level put the window's cheapest quarter at the floor and the dearest at the top, in eight levels. So 438 öre drew as an eighth of 556.

Change

  • PriceScale (FTWShared, tested): zero at the foot and a round top just over the dearest (1, 1.5, 2, 2.5, 3, 4, 5, 6 or 8 times a power of ten). A price below zero hangs under the zero line on a round figure of its own.
  • Now's strip draws the bars from zero. Half the top and the top get a hairline and a figure in a gutter on the right. The price now carries on as a dashed line from the now rule, so a bar above it is dearer than now. Ink stays by thirds of the window.
  • The dial's ticks, the lock-screen glyphs, the plan widget's bars and the watch's BlockBars take the same scale in eight steps, so one price has one height everywhere.
  • CLAUDE.md: a rule that a price stands on zero, and the TUI table and dial rule 2 say "eight steps from zero".

This is step 1 of four that Fredrik approved on 1 November (design canvas "Planen, runda 3"). Steps 2 (Now with passes) and 3 (the plan as a clock) build on this branch.

Evidence

  • swift test in appleApp/FTWKit: 636 tests in 95 suites and 340 Swift Testing tests pass locally. PriceScaleTests.ericsMorningReadsAsAFifthDearer is Erik's case.
  • Built for the iOS Simulator (FTW scheme, with the watch app) and ran the demo on an iPhone 17, iOS 26.5:
Dark Light
Now, dark Now, light

Whole screen, dark

Not checked: the watch and the widgets in their simulators, and the largest text size.

🤖 Generated with Claude Code

Erik, 1 November 2026: Now's strip made 450 against 550 öre look five
times dearer. It put the window's cheapest quarter at the floor and the
dearest at the top.

Every price bar now reads one PriceScale: zero at the foot and a round
top just over the dearest (1, 1.5, 2, 2.5, 3, 4, 5, 6 or 8 times a power
of ten). Now's strip draws the bars from zero, marks half the top and the
top with figures in a gutter on the right, and carries the price now on
as a dashed line. A price below zero hangs under the zero line. The dial's
ticks, the lock-screen glyphs, the plan widget and the watch's bars take
the same scale in eight steps.

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

chatgpt-codex-connector Bot commented Nov 1, 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-11-01T14:14:33.874506Z c7cc2c5 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: c7cc2c5d54

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

let top = Self.round(max(hi, unit)) / unit
self.top = top
bottom = lo < 0 ? -Self.round(-lo) / unit : 0
lines = [top / 2, 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 Space axis labels across the negative-price range

When all known prices are negative, the two scale labels overlap and become unreadable. For example, PriceScale([-12, -40, -96], currency: "SEK") produces bottom = -100, top = 1, and lines at 0.5 and 1; PlanStripDrawing places these labels only 0.36 pt apart even at the maximum 72 pt plot height, despite using a 9 pt font. Select grid values across the full signed domain, or suppress labels that cannot fit, so negative-price windows retain a readable scale.

Useful? React with 👍 / 👎.

@frahlg
frahlg merged commit 7c8a63d into main Nov 1, 2026
1 check passed
@frahlg
frahlg deleted the ios-price-scale branch November 1, 2026 17:49
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