feat(terra): Claude subscription limits panel on the rail

CLD panel next to luna showing the 5-hour and weekly usage windows (plus
any per-model weekly caps), polled every 5 min via a new `claude-usage`
script that reuses Claude Code's OAuth login and refreshes it when expired.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-25 01:26:44 +02:00
co-authored by Claude Opus 5.5
parent 13e8db74ce
commit f84611bc6e
7 changed files with 363 additions and 2 deletions
@@ -0,0 +1,59 @@
import QtQuick
import qs.HyprChrome.Widgets.Bar.Claude
// The rail's claude panel collapsed and expanded, healthy and failing.
//
// ./tools/quickshell-preview/render.sh \
// tests/ClaudePanelHeadless.qml \
// .artifacts/quickshell-preview/claude-panel.png 640 420
Rectangle {
width: 640
height: 420
color: "#0f1012"
readonly property var soon: new Date(Date.now() + 2 * 3600000 + 17 * 60000).toISOString()
readonly property var later: new Date(Date.now() + 4 * 86400000 + 5 * 3600000).toISOString()
Row {
x: 16
y: 16
spacing: 24
Column {
spacing: 12
ClaudePanel {
expanded: false
ready: true
fiveHour: ({ utilization: 42, resets_at: soon })
sevenDay: ({ utilization: 91, resets_at: later })
}
ClaudePanel {
expanded: false
ready: false
error: "token refresh HTTP 400"
}
}
Column {
spacing: 12
ClaudePanel {
expanded: true
ready: true
fiveHour: ({ utilization: 42, resets_at: soon })
sevenDay: ({ utilization: 91, resets_at: later })
extra: [{ label: "SONNET", window: { utilization: 12, resets_at: later } }]
}
ClaudePanel {
expanded: true
ready: true
error: "usage HTTP 429"
fiveHour: ({ utilization: 8, resets_at: soon })
sevenDay: ({ utilization: 30, resets_at: later })
}
}
}
}