feat: Add Sonnet quota tracking feature#2
Open
youngbinkim0 wants to merge 4 commits intoignitedvisions:mainfrom
Open
feat: Add Sonnet quota tracking feature#2youngbinkim0 wants to merge 4 commits intoignitedvisions:mainfrom
youngbinkim0 wants to merge 4 commits intoignitedvisions:mainfrom
Conversation
- Parse seven_day_sonnet quota from Claude API responses - Persist quota data in SessionManager (sonnetUtilization, sonnetResetsAt) - Add notification layout with Sonnet progress bar - Add Sonnet progress drawable (amber color #FFD97706) Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Display Sonnet quota card in MainActivity using Compose - Show card only when Sonnet data is available (sonnetResetsAt > 0L or sonnetUtilization > 0.0) - Use amber color theme (#FFD97706) for Sonnet indicator Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Add ClaudeApiServiceParsingTest.kt with 4 JUnit4 parsing tests * Tests empty response handling * Tests seven_day_sonnet parsing * Tests null handling for missing quota objects - Add org.json:json as testImplementation for JSON parsing on JVM - Update app/build.gradle.kts with test dependency Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Added note about Sonnet weekly quota tracking in documentation - Feature now tracks seven_day_sonnet usage window alongside other quotas Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
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
seven_day_sonnet(Sonnet weekly window) quota alongside existing Session (5-hour) and Weekly (7-day) windows#D97706)Changed Files
Core logic
ClaudeApiService.kt— parseseven_day_sonnetkey;parseUsageData/parseWindowmadeinternalfor testability; empty{}objects return nullSessionManager.kt—sonnetUtilization/sonnetResetsAtfields + SharedPreferences persistenceUI
MainActivity.kt— conditional SonnetUsageCard(amber theme, 7-day window label)notification_usage.xml— Sonnet row (GONEby default)notif_progress_sonnet.xml— amber progress drawableUsagePollingService.kt— bind/show/hide Sonnet notification rowTests & build
ClaudeApiServiceParsingTest.kt— 4 JUnit4 parsing testsgradle/libs.versions.toml+app/build.gradle.kts—org.json:jsonastestImplementationDocs
README.md— updated one-liner to mention SonnetVerification
./gradlew :app:assembleDebug✅./gradlew :app:testDebugUnitTest✅ (4/4 tests pass)How to Test
adb install -r app/build/outputs/apk/debug/app-debug.apk