Skip to content

Commit 3116cfd

Browse files
ethanyhouCopilot
andcommitted
Address comments.
Co-authored-by: Copilot <copilot@github.com>
1 parent 99de690 commit 3116cfd

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/handlers/QuotaTextCalculator.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ private int calculateMaxWidth() {
4444
gc.stringExtent(Messages.menu_quota_codeCompletions + getPercentUsed(quotaResult.completions())).x);
4545
max = Math.max(max,
4646
gc.stringExtent(Messages.menu_quota_chatMessages + getPercentUsed(quotaResult.chat())).x);
47-
if (quotaResult.copilotPlan() != CopilotPlan.free) {
47+
if (quotaResult.copilotPlan() != CopilotPlan.free && quotaResult.premiumInteractions() != null) {
4848
max = Math.max(max, gc.stringExtent(
4949
getPremiumRequestsLabel() + getPremiumRequestsSuffix()).x);
5050
}
@@ -131,6 +131,9 @@ private String getAlignedQuotaText(String messagePrefix, String quotaText) {
131131
}
132132

133133
private String getPercentUsed(Quota quota) {
134+
if (quota == null) {
135+
return "";
136+
}
134137
if (quota.unlimited()) {
135138
return Messages.menu_quota_included;
136139
}

com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/i18n/messages.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ menu_quota_codeCompletions=Code Completions
2222
menu_quota_chatMessages=Chat Messages
2323
menu_quota_monthlyLimit=Monthly Limit
2424
menu_quota_includedCredits=Included Credits
25-
menu_quota_includedCredits=Included Credits
2625
menu_quota_includedCreditsTooltip=AI credits included with your plan, reset monthly. Enable additional usage to continue with pay-as-you-go credits once you run out of your included usage.
2726
menu_quota_monthlyLimitTooltip=Usage limit per month, resets automatically. AI credit usage counts toward your monthly limit. Ask your account manager about increasing your overage when monthly limit is hit.
2827
menu_quota_percentUsedFormat={0}% used

com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/utils/MenuUtils.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,9 @@ public static boolean noUsageYet(CheckQuotaResult quotaStatus) {
176176
/**
177177
* Formats the allowance-reset row label. Returns {@link Messages#menu_quota_noUsageYet} when the
178178
* user has not consumed any of the tracked quotas yet (see {@link #noUsageYet}); otherwise
179-
* returns {@code "Resets today on {date}"} / {@code "Reset in 1 day on {date}"} / {@code "Reset
180-
* in {n} days on {date}"} depending on {@code n}.
179+
* returns {@code "Resets today"} / {@code "Reset in 1 day on {date}"} / {@code "Reset in {n}
180+
* days on {date}"} depending on {@code n}. The 0-day case intentionally omits the date since it
181+
* is implied by "today".
181182
*
182183
* <p>Callers <strong>must</strong> gate with {@link #shouldShowAllowanceResetRow}; this method
183184
* assumes a parseable reset date is present.

0 commit comments

Comments
 (0)