Compare commits

...
4 changed files with 14 additions and 13 deletions
+2 -2
View File
@@ -99,8 +99,8 @@ public partial class LoginWindow : Window
return;
}
const u=await(await fetch('/api/organizations/'+id+'/usage',h)).json();
const rawU=JSON.stringify(u).slice(0,300);
window.chrome.webview.postMessage({email:e,orgId:id,usage:u,debug:'src:'+orgSrc+'|ukeys:'+Object.keys(u||{}).join(',')+'|raw:'+rawB});
const rawU=JSON.stringify(u).slice(0,400);
window.chrome.webview.postMessage({email:e,orgId:id,usage:u,debug:'src:'+orgSrc+'|ukeys:'+Object.keys(u||{}).join(',')+'|rawU:'+rawU+'|rawB:'+rawB});
}catch(ex){window.chrome.webview.postMessage({error:String(ex)});}})()";
await Browser.CoreWebView2.ExecuteScriptAsync(script);
+2 -2
View File
@@ -21,8 +21,8 @@ public class AgentLimit
public class UsageResponse
{
[JsonPropertyName("claude_ai_default_5h")] public WindowData? FiveHour { get; set; }
[JsonPropertyName("claude_ai_default")] public WindowData? SevenDay { get; set; }
[JsonPropertyName("five_hour")] public WindowData? FiveHour { get; set; }
[JsonPropertyName("seven_day")] public WindowData? SevenDay { get; set; }
}
public class WindowData
+3 -5
View File
@@ -1,6 +1,4 @@
## What's new in beta.30
## What's new in beta.32
- Fix: removed WebView2 from periodic refresh — it was spawning a full Chromium process every 2 minutes and not cleaning up, causing ~1.5GB memory growth
- Fix: added Origin, Referer, sec-fetch-* and sec-ch-ua headers to HttpClient so the API accepts requests as browser fetches
- Periodic refresh now uses HttpClient only, falling back to data cached at login time
- To get limits showing: sign out and sign back in once so SaveAndClose can fetch usage with the corrected org ID path
- Fix: usage response fields were completely wrong five_hour/seven_day not claude_ai_default_5h/claude_ai_default (this is why limits never loaded)
- Fix: placeholder cards shown while data loads instead of blank panel
+7 -4
View File
@@ -267,9 +267,10 @@ public class UsageViewModel : INotifyPropertyChanged
await Application.Current.Dispatcher.InvokeAsync(() =>
{
if (!string.IsNullOrEmpty(email)) UserEmail = email;
if (limits.Count > 0) Limits = limits;
// Always show cards — real data if available, placeholders if not
Limits = limits.Count > 0 ? limits : LoadPlaceholderLimits();
IsSignedIn = true;
ErrorMessage = limits.Count == 0 ? "Signed in — refreshing data…" : null;
ErrorMessage = null;
LastUpdated = limits.Count > 0 ? DateTime.Now : LastUpdated;
});
}
@@ -470,16 +471,18 @@ public class UsageViewModel : INotifyPropertyChanged
return $"{diff.Hours}h {diff.Minutes}m";
}
private void LoadPlaceholders()
private static List<AgentLimit> LoadPlaceholderLimits()
{
var now = DateTime.Now;
Limits =
return
[
new() { Window = WindowKind.FiveHour, UsedPercent = 0, TimeRemaining = "—", ResetDate = now.AddHours(1) },
new() { Window = WindowKind.SevenDay, UsedPercent = 0, TimeRemaining = "—", ResetDate = now.AddDays(7) },
];
}
private void LoadPlaceholders() => Limits = LoadPlaceholderLimits();
private void LoadBurnHistory()
{
try