Add subscription detection and usage badge to status bar

- Detect user subscription type (Pro/Max) via CLI initialize request
- Cache subscription type in globalState for persistence
- Show clickable usage badge with chart icon in status bar
- Plan users: show "Max Plan" badge, opens live usage view
- API users: show cost badge, opens recent usage history
- Badge opens terminal in editor with ccusage command

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
andrepimenta
2025-12-03 00:29:08 +00:00
parent 14ac46018f
commit 63299008d0
3 changed files with 167 additions and 10 deletions

View File

@@ -2432,6 +2432,34 @@ const styles = `
flex: 1;
}
.status-text .usage-badge {
display: inline-flex;
align-items: center;
gap: 4px;
color: inherit;
text-decoration: none;
background: rgba(255, 255, 255, 0.08);
padding: 2px 8px 2px 8px;
border-radius: 10px;
cursor: pointer;
transition: background 0.15s, transform 0.1s;
}
.status-text .usage-badge:hover {
background: rgba(255, 255, 255, 0.15);
transform: translateY(-1px);
}
.status-text .usage-badge:active {
transform: translateY(0);
}
.status-text .usage-icon {
width: 12px;
height: 12px;
flex-shrink: 0;
}
pre {
white-space: pre-wrap;
word-wrap: break-word;