feat: add optional usage pace guide#33
Conversation
Adds a compact guide marker to each live usage window so users can compare current usage against the even-spend target implied by the reset deadline. Constraint: Preserve the compact notch panel height and existing chart-style selector. Rejected: Add a separate settings-controlled pace page | too much surface area for the issue request. Confidence: high Scope-risk: narrow Directive: Keep pace math tied to provider reset timestamps; do not infer limits without reset data. Tested: ./scripts/verify.sh
Fold the reset-window pace guide into each chart style and add a General preference so users can opt in without changing the default UI. Constraint: Default must remain off so existing users keep the original chart appearance after upgrade. Rejected: Always show a separate guide bar | it cluttered Numeric and Sparkline chart styles. Confidence: high Scope-risk: narrow Directive: Keep guide markers hidden unless Pace guide is enabled and reset timestamps are available. Tested: ./scripts/verify.sh
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR adds a pace guide feature: a persisted preference and Settings toggle, localized strings, chart updates to render an animated guide marker when provided, and UsageView integration that computes and threads a guide percent into all charts and accessibility labels. ChangesPace Guide Feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Sources/Views/UsageView.swift`:
- Around line 180-181: The accessibility label and value use two different
percent calculations causing inconsistent VoiceOver output; update the
.accessibilityLabel call in UsageView (the line using
.accessibilityLabel(L10n.tr("%@, %d%%", label, Int(value)))) to use the same
rounded source as .accessibilityValue (use the window.percentInt / the same
percentInt used by accessibilityValue()) so both spoken percentages match; also
apply the same change to the other occurrence around the 197–202 area to ensure
consistency everywhere.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d7dbd89d-56f2-483e-8199-822dbf7b8c58
📒 Files selected for processing (10)
Resources/en.lproj/Localizable.stringsResources/zh-Hans.lproj/Localizable.stringsSources/Model/PaceGuideStore.swiftSources/Views/Charts/BarChart.swiftSources/Views/Charts/NumericChart.swiftSources/Views/Charts/RingChart.swiftSources/Views/Charts/SparkChart.swiftSources/Views/Charts/SteppedChart.swiftSources/Views/SettingsView.swiftSources/Views/UsageView.swift
Use the same rounded window percentage for the accessibility label and value so VoiceOver does not announce conflicting usage numbers. Constraint: CodeRabbit flagged inconsistent rounding between Int(value) and WindowUsage.percentInt. Confidence: high Scope-risk: narrow Tested: ./scripts/verify.sh
Summary
Why
Fixes #24
Testing
Summary by CodeRabbit
New Features
Documentation