iOS Used/Left toggle + matching widget framing#34
Merged
Conversation
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>
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.
Summary
display_framinginsharedGroupso the widget reads the same value, andWidgetCenter.reloadAllTimelines()fires on toggle.Test plan
🤖 Generated with Claude Code