Restrict quota display to macOS due to Keychain OAuth dependency#225
Restrict quota display to macOS due to Keychain OAuth dependency#225
Conversation
Quota data requires macOS Keychain for OAuth token retrieval, so it's always unavailable on Linux. Remove the section entirely on non-darwin platforms instead of showing a useless gray dash. https://claude.ai/code/session_01WFViMSBVF4NRgg9igRsqb3
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary of ChangesHello @AnnatarHe, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refines the statusline output by making the quota utilization display an exclusive feature for macOS users. This change ensures that the application functions correctly across different operating systems by only enabling features that rely on macOS-specific components, such as Keychain for OAuth token management, where they are supported. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly restricts the quota utilization display to macOS systems due to its dependency on Keychain for OAuth token management. The changes are implemented using runtime.GOOS checks in both the main logic and the tests, which is appropriate. I've suggested a small refactoring to improve maintainability in the fallback output function. Overall, the changes are well-implemented and the accompanying documentation updates are clear.
| if runtime.GOOS == "darwin" { | ||
| quotaPart := wrapOSC8Link(claudeUsageURL, "🚦 -") | ||
| fmt.Println(color.Gray.Sprint("🌿 - | 🤖 - | 💰 - | 📊 - | " + quotaPart + " | ⏱️ - | 📈 -%")) | ||
| } else { | ||
| fmt.Println(color.Gray.Sprint("🌿 - | 🤖 - | 💰 - | 📊 - | ⏱️ - | 📈 -%")) | ||
| } |
There was a problem hiding this comment.
To improve maintainability and reduce code duplication, you could refactor this function to build a slice of parts and then join them. This approach is already used in formatStatuslineOutput and would make it easier to add or remove parts of the status line in the future.
parts := []string{"🌿 -", "🤖 -", "💰 -", "📊 -"}
if runtime.GOOS == "darwin" {
quotaPart := wrapOSC8Link(claudeUsageURL, "🚦 -")
parts = append(parts, quotaPart)
}
parts = append(parts, "⏱️ -", "📈 -%")
fmt.Println(color.Gray.Sprint(strings.Join(parts, " | ")))
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Summary
This PR restricts the quota utilization display feature to macOS only, as it requires Keychain access for OAuth token management. On non-macOS platforms, the quota section is omitted from the statusline output.
Key Changes
runtime.GOOSto conditionally include quota informationformatStatuslineOutput()to only append quota part on macOS (darwin)outputFallback()to exclude the quota indicator (🚦) on non-macOS systemsImplementation Details
runtime.GOOS == "darwin"to conditionally verify expected output formathttps://claude.ai/code/session_01WFViMSBVF4NRgg9igRsqb3