Chat: show the active Claude account in the send tooltip, menu and limit banner

usage.account now carries the email and organization of the account
Claude Code is signed in to (from its initialize account, or the saved
account just switched to), sent at process start and after a switch.
The app shows it as the send tooltip's usage prefix, the Claude account
menu subtitle, the usage-limit banner's status line and the info sheet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-30 16:33:46 +00:00
parent e80f18969c
commit 0dc805ae0e
22 changed files with 386 additions and 62 deletions
+3 -3
View File
@@ -427,7 +427,7 @@ func (s *session) emit(frame protocol.ChatEventFrame) {
s.mu.Lock()
if frame.Kind == protocol.ChatEventUsage && frame.Usage != nil {
usage := *frame.Usage
usage.Account = s.chat.accountUsage(s.account.key)
usage.Account = s.chat.accountUsage(s.account)
frame.Usage = &usage
s.usage = &frame
}
@@ -463,10 +463,10 @@ func (s *session) subscribe() chan protocol.ChatEventFrame {
// Account quota may have moved since (another chat on the account).
frame := *s.usage
usage := *frame.Usage
usage.Account = s.chat.accountUsage(s.account.key)
usage.Account = s.chat.accountUsage(s.account)
frame.Usage = &usage
ch <- frame
} else if account := s.chat.accountUsage(s.account.key); account != nil {
} else if account := s.chat.accountUsage(s.account); account != nil {
ch <- protocol.ChatEventFrame{SessionID: s.id, Kind: protocol.ChatEventUsage, Usage: &protocol.ChatUsage{Account: account}}
}
if s.compaction != nil {