v2.0.10 — limit notifications, fix positioning, add notification screenshots
This commit is contained in:
@@ -15,9 +15,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>2.0.9</string>
|
||||
<string>2.0.10</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>16</string>
|
||||
<string>17</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>13.0</string>
|
||||
<key>LSUIElement</key>
|
||||
|
||||
@@ -21,14 +21,14 @@ class UpdateNotificationWindowController: NSWindowController {
|
||||
let icon = percent >= 95 ? "exclamationmark.circle.fill" : "exclamationmark.triangle.fill"
|
||||
let color = percent >= 95 ? Color.red : Color.orange
|
||||
let title = "Claude \(windowName) limit at \(percent)%"
|
||||
let body = percent >= 95 ? "Almost out of quota — usage is critically high." : "Approaching your quota limit."
|
||||
let body = percent >= 95 ? "Almost out of quota." : "Approaching your limit."
|
||||
showLimitWindow(title: title, subtitle: body, badgeIcon: icon, badgeColor: color, near: statusItem)
|
||||
}
|
||||
|
||||
static func showLimitReset(windowName: String, near statusItem: NSStatusItem?) {
|
||||
showLimitWindow(
|
||||
title: "Claude \(windowName) limit reset",
|
||||
subtitle: "Your quota has been reset — you're good to go.",
|
||||
subtitle: "Your quota has been reset.",
|
||||
badgeIcon: "arrow.clockwise.circle.fill",
|
||||
badgeColor: .green,
|
||||
near: statusItem
|
||||
@@ -65,9 +65,13 @@ class UpdateNotificationWindowController: NSWindowController {
|
||||
}
|
||||
|
||||
private static func makeWindow<V: View>(content: V) -> UpdateNotificationWindowController {
|
||||
let hosting = NSHostingController(rootView: content)
|
||||
let hostingView = NSHostingView(rootView: content)
|
||||
hostingView.frame = NSRect(x: 0, y: 0, width: 340, height: 1000)
|
||||
let height = max(80, hostingView.fittingSize.height)
|
||||
let size = NSSize(width: 340, height: height)
|
||||
|
||||
let window = NSWindow(
|
||||
contentRect: NSRect(x: 0, y: 0, width: 340, height: 80),
|
||||
contentRect: NSRect(origin: .zero, size: size),
|
||||
styleMask: [.borderless, .nonactivatingPanel],
|
||||
backing: .buffered,
|
||||
defer: false
|
||||
@@ -76,7 +80,8 @@ class UpdateNotificationWindowController: NSWindowController {
|
||||
window.backgroundColor = .clear
|
||||
window.level = .statusBar
|
||||
window.hasShadow = false
|
||||
window.contentViewController = hosting
|
||||
hostingView.frame = NSRect(origin: .zero, size: size)
|
||||
window.contentView = hostingView
|
||||
return UpdateNotificationWindowController(window: window)
|
||||
}
|
||||
|
||||
@@ -86,9 +91,9 @@ class UpdateNotificationWindowController: NSWindowController {
|
||||
let screen = buttonWindow.screen {
|
||||
let buttonFrame = buttonWindow.convertToScreen(button.frame)
|
||||
let x = buttonFrame.midX - 170
|
||||
// Stack below the update notification if it's showing
|
||||
let yOffset: CGFloat = existingWindow != nil ? 80 + 8 + 8 : 8
|
||||
let y = buttonFrame.minY - 80 - yOffset
|
||||
let h = window.frame.height
|
||||
let yOffset: CGFloat = existingWindow.map { $0.frame.height + 8 } ?? 0
|
||||
let y = buttonFrame.minY - h - 8 - yOffset
|
||||
let clampedX = max(8, min(x, screen.frame.maxX - 348))
|
||||
window.setFrameOrigin(NSPoint(x: clampedX, y: y))
|
||||
} else {
|
||||
@@ -157,10 +162,10 @@ struct UpdateNotificationView: View {
|
||||
Text(subtitle)
|
||||
.font(.system(size: 11))
|
||||
.foregroundColor(.secondary)
|
||||
.lineLimit(1)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
}
|
||||
|
||||
Spacer()
|
||||
Spacer(minLength: 8)
|
||||
|
||||
Button(action: onDismiss) {
|
||||
Image(systemName: "xmark")
|
||||
@@ -171,7 +176,7 @@ struct UpdateNotificationView: View {
|
||||
}
|
||||
.padding(.horizontal, 14)
|
||||
.padding(.vertical, 14)
|
||||
.frame(width: 340, height: 80)
|
||||
.frame(width: 340, alignment: .leading)
|
||||
.background(
|
||||
RoundedRectangle(cornerRadius: 13)
|
||||
.fill(Color(nsColor: .windowBackgroundColor))
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
[](https://www.apple.com/macos/)
|
||||
[](https://swift.org)
|
||||
[](https://github.com/superdooper86/claudechecker/releases)
|
||||
[](https://github.com/superdooper86/claudechecker/releases)
|
||||
[](LICENSE)
|
||||
|
||||
</div>
|
||||
@@ -36,6 +36,14 @@ No API key required. It reads directly from your `claude.ai` session using a bui
|
||||
<td align="center"><img src="screenshots/update-banner.png" width="280" alt="Update banner" /><br/><sub>Update available</sub></td>
|
||||
<td align="center"><img src="screenshots/notification.png" width="280" alt="Update notification" /><br/><sub>System notification</sub></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><img src="screenshots/notif-limit-80.png" width="280" alt="80% limit warning" /><br/><sub>80% limit warning</sub></td>
|
||||
<td align="center"><img src="screenshots/notif-limit-95.png" width="280" alt="95% limit warning" /><br/><sub>95% limit warning</sub></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><img src="screenshots/notif-reset.png" width="280" alt="Limit reset" /><br/><sub>Limit reset</sub></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 8.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.3 KiB |
+3
-3
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "2.0.9",
|
||||
"url": "https://github.com/superdooper86/claudechecker/releases/download/v2.0.9/ClaudeChecker.zip",
|
||||
"notes": "Added limit notifications: warns at 80% and 95% usage, and notifies when a limit resets."
|
||||
"version": "2.0.10",
|
||||
"url": "https://github.com/superdooper86/claudechecker/releases/download/v2.0.10/ClaudeChecker.zip",
|
||||
"notes": "Limit notifications: warns at 80% and 95% usage, and notifies when a limit resets."
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user