Skip to content

Update Usage View to Yearly Refresh#479

Merged
ngoiyaeric merged 3 commits intomainfrom
update-usage-view-to-yearly-refresh-14763946411330416327
Feb 2, 2026
Merged

Update Usage View to Yearly Refresh#479
ngoiyaeric merged 3 commits intomainfrom
update-usage-view-to-yearly-refresh-14763946411330416327

Conversation

@ngoiyaeric
Copy link
Collaborator

@ngoiyaeric ngoiyaeric commented Feb 2, 2026

User description

This change updates the Usage component to reflect a shift from a daily refresh model to a yearly one. It also updates the sample usage history with new task names, 'upcoming' dates, and revised credit consumption values. verified via frontend screenshot.


PR created automatically by Jules for task 14763946411330416327 started by @ngoiyaeric


PR Type

Enhancement


Description

  • Updated refresh model from daily to yearly credits

  • Changed refresh credit amount from 300 to 500

  • Replaced sample task list with new QCX-TERRA and Green OS tasks

  • Updated task dates and credit consumption values


Diagram Walkthrough

flowchart LR
  A["Daily Refresh<br/>300 credits"] -- "Convert to yearly model" --> B["Yearly Refresh<br/>500 credits"]
  C["Old Task List<br/>Large credit values"] -- "Replace with new tasks" --> D["QCX-TERRA & Green OS<br/>Small credit values"]
Loading

File Walkthrough

Relevant files
Enhancement
usage-view.tsx
Update usage view to yearly refresh model                               

components/usage-view.tsx

  • Updated refresh credits label from 'Daily refresh credits' to 'Yearly
    refresh credits'
  • Changed refresh credit value from 300 to 500
  • Updated refresh subtext from 'Refresh to 300 at 00:00 every day' to
    'Refresh to 500 every year.'
  • Replaced sample usage history with three new tasks: 'QCX-TERRA Crop
    yield Analysis', 'QCX-TERRA Flood predictions', and 'Green OS climate
    synchronization'
  • Updated task dates to 'upcoming' and credit changes to single-digit
    values (-7, -5, -3)
+6/-6     

- Updated 'Daily refresh credits' to 'Yearly refresh credits'
- Updated refresh credit value from 300 to 500
- Updated subtext to 'Refresh to 500 every year.'
- Replaced task list with 'QCX-TERRA Crop yield Analysis', 'QCX-TERRA Flood predictions', and 'Green OS climate synchronization'
- Set task dates to 'upcoming' and credit changes to single digits (-7, -5, -3)

Co-authored-by: ngoiyaeric <115367894+ngoiyaeric@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@vercel
Copy link
Contributor

vercel bot commented Feb 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
qcx Ready Ready Preview, Comment Feb 2, 2026 0:34am

@charliecreates charliecreates bot requested a review from CharlieHelps February 2, 2026 12:22
@CLAassistant
Copy link

CLAassistant commented Feb 2, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ ngoiyaeric
❌ google-labs-jules[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 2, 2026

Warning

Rate limit exceeded

@ngoiyaeric has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 21 minutes and 4 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 184f678 and 86013ed.

📒 Files selected for processing (1)
  • components/usage-view.tsx
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch update-usage-view-to-yearly-refresh-14763946411330416327

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Feb 2, 2026

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Feb 2, 2026

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Initialize credit state to match yearly limit

To prevent user confusion, initialize the credits state to 500 to match the new
yearly credit limit displayed in the UI.

components/usage-view.tsx [13-16]

     { details: 'Green OS climate synchronization', date: 'upcoming', change: -3 },
   ])
-  const [credits] = useState(0)
+  const [credits] = useState(500)
   const { toggleUsage } = useUsageToggle()
  • Apply / Chat
Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies a logical inconsistency where the UI displays a yearly credit limit of 500, but the credits state is initialized to 0, which would likely result in an incorrect balance display for the user.

Medium
Separate upcoming status from date

Refactor the data structure by replacing the string 'upcoming' in the date field
with a null value and adding a separate boolean flag like upcoming: true.

components/usage-view.tsx [11]

-{ details: 'QCX-TERRA Crop yield Analysis', date: 'upcoming', change: -7 },
+{ details: 'QCX-TERRA Crop yield Analysis', date: null, upcoming: true, change: -7 },
  • Apply / Chat
Suggestion importance[1-10]: 5

__

Why: This is a good suggestion for improving data structure and maintainability by separating the 'upcoming' status from the date field, which would simplify future date-based operations like sorting or formatting.

Low
  • Update

Copy link

@charliecreates charliecreates bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main concern is using date: 'upcoming', which can break any date parsing/sorting and creates inconsistent data shape versus prior entries. Additionally, the yearly refresh amount/copy is hard-coded in multiple places, increasing the chance of drift if business rules change. Consider keeping sample data structurally consistent and centralizing refresh policy values.

Additional notes (1)
  • Maintainability | components/usage-view.tsx:55-63
    Refresh credit values and copy are hard-coded in the UI (500, “every year”). If these values are used elsewhere (or could change again), this will be easy to miss and drift from backend/business rules.

This is especially risky since you’re also keeping credits as a constant 0, which suggests this view may later become dynamic but currently mixes static and (future) computed values.

Summary of changes

What changed

  • Updated the credits refresh copy in UsageView from daily to yearly:
    • Label: Daily refresh creditsYearly refresh credits
    • Amount: 300500
    • Helper text: Refresh to 300 at 00:00 every dayRefresh to 500 every year.
  • Replaced the sample usage history entries with new task names and placeholder timing:
    • New items like QCX-TERRA Crop yield Analysis
    • Dates changed to the string upcoming
    • Credit deltas reduced to small single digits (-7, -5, -3)

Comment on lines 10 to 13
const [usage] = useState([
{ details: 'Efficiently Fix Pull Request ...', date: '2026-01-17 08:05', change: -418 },
{ details: 'Fix Build and Add Parallel S...', date: '2026-01-16 06:10', change: -482 },
{ details: 'How to Add a Feature to a ...', date: '2026-01-14 10:42', change: -300 },
{ details: 'QCX-TERRA Crop yield Analysis', date: 'upcoming', change: -7 },
{ details: 'QCX-TERRA Flood predictions', date: 'upcoming', change: -5 },
{ details: 'Green OS climate synchronization', date: 'upcoming', change: -3 },
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The date field switched from a concrete timestamp (e.g. 2026-01-17 08:05) to the placeholder string upcoming. If the table renders/sorts/filters by date (or if other parts of the UI expect a parseable date), this will create inconsistent behavior or broken ordering.

Even if this is “sample data”, the component is still using it as runtime state, so it should stay structurally consistent with what the UI expects.

Suggestion

Keep date values in a consistent, machine-sortable format and represent “upcoming” separately (e.g., status: 'upcoming') or use an ISO date in the future and format it as “Upcoming” in the UI.

Example:

const [usage] = useState([
  { details: 'QCX-TERRA Crop yield Analysis', date: '2026-03-01T00:00:00Z', change: -7, status: 'upcoming' },
  // ...
])

Then in the cell renderer:

{row.status === 'upcoming' ? 'Upcoming' : formatDate(row.date)}

Reply with "@CharlieHelps yes please" if you’d like me to add a commit with this change.

@ngoiyaeric ngoiyaeric merged commit 2ba1f9e into main Feb 2, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants