Skip to content

Commit 383adee

Browse files
committed
Address comments.
1 parent 1480706 commit 383adee

11 files changed

Lines changed: 376 additions & 225 deletions

File tree

com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/protocol/quota/CheckQuotaResult.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,17 @@ public class CheckQuotaResult {
1111
private Quota chat;
1212
private Quota completions;
1313
private Quota premiumInteractions;
14+
15+
/**
16+
* Quota usage for the 5-hour rolling interval (session limit). Only included for CFI (Copilot for Individuals)
17+
* token-based billing users
18+
*/
1419
private TbbQuota immediateUsageInterval;
20+
21+
/**
22+
* Quota usage for the 7-day rolling interval (weekly limit). Only included for CFI (Copilot for Individuals)
23+
* token-based billing users (all CFI plans).
24+
*/
1525
private TbbQuota extendedUsageInterval;
1626
private String resetDate;
1727
private String resetDateUtc;
@@ -101,8 +111,7 @@ public boolean equals(Object obj) {
101111
CheckQuotaResult other = (CheckQuotaResult) obj;
102112
return Objects.equals(chat, other.chat) && Objects.equals(completions, other.completions)
103113
&& copilotPlan == other.copilotPlan && Objects.equals(premiumInteractions, other.premiumInteractions)
104-
&& Objects.equals(resetDate, other.resetDate)
105-
&& Objects.equals(resetDateUtc, other.resetDateUtc)
114+
&& Objects.equals(resetDate, other.resetDate) && Objects.equals(resetDateUtc, other.resetDateUtc)
106115
&& Objects.equals(immediateUsageInterval, other.immediateUsageInterval)
107116
&& Objects.equals(extendedUsageInterval, other.extendedUsageInterval);
108117
}

com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/protocol/quota/Quota.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ public class Quota {
1212
private double percentRemaining;
1313
private boolean unlimited;
1414
private boolean overagePermitted;
15+
@SerializedName("overage_count")
16+
private int overageCount;
1517
private int entitlement;
1618
private int quotaRemaining;
1719
@SerializedName("timeStamp")
@@ -49,6 +51,14 @@ public void setOveragePermitted(boolean overagePermitted) {
4951
this.overagePermitted = overagePermitted;
5052
}
5153

54+
public int getOverageCount() {
55+
return overageCount;
56+
}
57+
58+
public void setOverageCount(int overageCount) {
59+
this.overageCount = overageCount;
60+
}
61+
5262
public int getEntitlement() {
5363
return entitlement;
5464
}
@@ -75,7 +85,8 @@ public void setTimestamp(String timestamp) {
7585

7686
@Override
7787
public int hashCode() {
78-
return Objects.hash(entitlement, overagePermitted, percentRemaining, quotaRemaining, timestamp, unlimited);
88+
return Objects.hash(entitlement, overagePermitted, overageCount, percentRemaining, quotaRemaining, timestamp,
89+
unlimited);
7990
}
8091

8192
@Override
@@ -89,8 +100,8 @@ public boolean equals(Object obj) {
89100
Quota other = (Quota) obj;
90101
return Double.doubleToLongBits(percentRemaining) == Double.doubleToLongBits(other.percentRemaining)
91102
&& unlimited == other.unlimited && overagePermitted == other.overagePermitted
92-
&& entitlement == other.entitlement && quotaRemaining == other.quotaRemaining
93-
&& Objects.equals(timestamp, other.timestamp);
103+
&& overageCount == other.overageCount && entitlement == other.entitlement
104+
&& quotaRemaining == other.quotaRemaining && Objects.equals(timestamp, other.timestamp);
94105
}
95106

96107
@Override
@@ -99,6 +110,7 @@ public String toString() {
99110
builder.append("percentRemaining", percentRemaining);
100111
builder.append("unlimited", unlimited);
101112
builder.append("overagePermitted", overagePermitted);
113+
builder.append("overageCount", overageCount);
102114
builder.append("entitlement", entitlement);
103115
builder.append("quotaRemaining", quotaRemaining);
104116
builder.append("timestamp", timestamp);

com.microsoft.copilot.eclipse.ui/css/dark.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@
216216

217217
/* Action items in dropdown popups */
218218
#popup-item-default Label.popup-action-text,
219-
#popup-item-selected Label.popup-action-text {
219+
#popup-item-selected Label.popup-action-text,
220+
#dropdown-popup Label.popup-action-text {
220221
color: #74A7DC;
221222
}

com.microsoft.copilot.eclipse.ui/css/light.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@
216216

217217
/* Action items in dropdown popups */
218218
#popup-item-default Label.popup-action-text,
219-
#popup-item-selected Label.popup-action-text {
219+
#popup-item-selected Label.popup-action-text,
220+
#dropdown-popup Label.popup-action-text {
220221
color: #286EC5;
221222
}

com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/preferences/CopilotPreferenceInitializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public void initializeDefaultPreferences() {
2929
pref.setDefault(Constants.CUSTOM_INSTRUCTIONS_WORKSPACE_ENABLED, false);
3030
pref.setDefault(Constants.CUSTOM_INSTRUCTIONS_WORKSPACE, "");
3131
pref.setDefault(Constants.AUTO_BREAKPOINT_RESPONSE, false);
32-
pref.setDefault(Constants.USAGE_ALERT_THRESHOLD, 90);
32+
pref.setDefault(Constants.USAGE_ALERT_THRESHOLD, 95);
3333
pref.setDefault(Constants.MCP, """
3434
{
3535
"servers": {

com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/preferences/Messages.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ public class Messages extends NLS {
158158
public static String usage_status_plan_free;
159159
public static String usage_status_plan_pro;
160160
public static String usage_status_plan_pro_plus;
161+
public static String usage_status_plan_max;
161162
public static String usage_status_plan_business;
162163
public static String usage_status_plan_enterprise;
163164
public static String usage_status_plan_unknown;
@@ -169,11 +170,21 @@ public class Messages extends NLS {
169170
public static String usage_status_weekly_limit;
170171
public static String usage_status_weekly_limit_description;
171172
public static String usage_status_monthly_limit;
173+
public static String usage_status_percentage_suffix;
174+
public static String usage_status_overage_spend;
175+
public static String usage_status_overage_spend_tooltip;
176+
public static String usage_status_overage_not_configured;
177+
public static String usage_status_overage_no_spend;
172178
public static String usage_status_not_signed_in;
173179
public static String usage_status_no_monthly_limit;
174180
public static String usage_status_resets_in;
175181
public static String usage_status_resets_on_at;
182+
public static String usage_status_resets_no_usage_yet;
183+
public static String usage_status_chat_messages;
184+
public static String usage_status_code_completions;
176185
public static String usage_status_alert_threshold;
186+
public static String usage_status_alert_chat_threshold;
187+
public static String usage_status_alert_session_threshold;
177188
public static String usage_status_duration_hours_mins;
178189
public static String usage_status_duration_hour_mins;
179190
public static String usage_status_duration_hours;

0 commit comments

Comments
 (0)