Skip to content

iOS Used/Left toggle + matching widget framing#34

Merged
BlockedPath merged 3 commits into
mainfrom
feat/ios-used-left-toggle
May 22, 2026
Merged

iOS Used/Left toggle + matching widget framing#34
BlockedPath merged 3 commits into
mainfrom
feat/ios-used-left-toggle

Conversation

@BlockedPath

Copy link
Copy Markdown
Owner

Summary

  • iOS main app and home-screen widget now both show % used by default (matches claude.ai's framing), with green→orange→red color keyed on usage pressure. Widget previously showed "% left" while the app showed "% used" — same data, opposite labels, looked like a sync bug.
  • New Settings → Display → Percentages segmented control lets the user pick Used or Left. Stored as display_framing in sharedGroup so the widget reads the same value, and WidgetCenter.reloadAllTimelines() fires on toggle.
  • Tightened refresh end-to-end: chrome-scrape LaunchAgent 60s→15s, daemon poll 30s→10s, iOS poll 30s→15s, widget timeline 15min→5min. Worst-case lag from claude.ai change to phone display drops from ~2 min to ~40s.

Test plan

  • Build + install on iPhone 15 Pro Max (verified live)
  • Main app shows "55% used" matching claude.ai page
  • Widget after rebuild shows same framing as app
  • Settings toggle flips both app cards and widget instantly
  • After a few minutes, confirm widget refreshes within ~5 min of underlying change

🤖 Generated with Claude Code

BlockedPath and others added 3 commits May 22, 2026 12:22
Display:
- iOS label "% remaining" -> "% used" to match claude.ai's framing
- Bar now fills as you consume; color is green<50% used, orange<80%, red>=80%
- usedPct = 100 - sessionPct/weeklyPct, computed on the iOS side, no
  protocol change so firmware/daemon contract stays the same.

Refresh cadence:
- Chrome plan scrape LaunchAgent StartInterval: 60s -> 15s
- Claude daemon CODEXMETER_POLL_INTERVAL: 30s -> 10s (env in plist)
- iOS fetchTimer: 30s -> 15s
- Worst-case lag from claude.ai change to phone display drops from
  ~2 min to ~40s.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The widget was rendering the raw sessionPct/weeklyPct payload fields,
which are "remaining %" — so when the main app showed "61% used" the
widget showed "39% left." Same data, opposite framing. User couldn't
tell at a glance that they were synced.

- New helpers usedPct(from:) and usedColor(forUsed:) convert the
  on-the-wire remaining% to displayed used%.
- AtomProgressBar now fills LEFT-to-RIGHT as the user consumes; color
  goes green -> orange (>=50% used) -> red (>=80% used).
- Atom-style widget labels switch from "X LEFT" / "WK LEFT" to
  "5H USED" / "7D USED" and show the inverted percentage.
- Accessory circular and rectangular variants display used% too.
- Bumped widget timeline reload from 15 min to 5 min so iOS gets a
  more aggressive refresh hint (the app already calls
  WidgetCenter.reloadAllTimelines on every fetch, but the timeline
  policy bounds how patient iOS is).

The protocol fields (s/w) still carry remaining%; only the widget's
display layer changed. Firmware contract is untouched.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Lets the user pick whether percentages are shown as
"X% used" (fills as you consume, matches claude.ai — default) or
"X% left" (drains as you consume, the original behavior).

- Settings screen gets a new "Display > Percentages" segmented picker.
- Stored as display_framing in sharedGroup so both the main app and
  the widget read the same value.
- Bar color stays keyed on usage pressure (red when heavily used)
  regardless of framing, so visual urgency doesn't invert.
- WidgetCenter.reloadAllTimelines() is called on toggle so the home
  screen picks up the new framing.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@BlockedPath
BlockedPath merged commit c546c3c into main May 22, 2026
4 checks passed
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