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:
@@ -513,6 +513,15 @@ class _ChatThreadViewState extends State<ChatThreadView> {
|
||||
controller.transcriptChanges.addListener(
|
||||
() => _reconcileUnsent(controller),
|
||||
);
|
||||
// The menu's Claude account item names the signed-in account, which a
|
||||
// usage frame (not a transcript change) reports.
|
||||
var email = controller.accountUsage?.email;
|
||||
controller.addListener(() {
|
||||
final now = controller.accountUsage?.email;
|
||||
if (now == email) return;
|
||||
email = now;
|
||||
if (mounted) setState(() {});
|
||||
});
|
||||
// Delivery states follow the server's queue reports. Read the composer
|
||||
// when the report arrives: it is not built yet while this one is.
|
||||
controller.onQueue = (queue) {
|
||||
@@ -1559,6 +1568,8 @@ class _ChatThreadViewState extends State<ChatThreadView> {
|
||||
_controller.running,
|
||||
// The More menu offers Dismiss all finished commands only with one.
|
||||
_shellRuns.finishedIds.isNotEmpty,
|
||||
// The Claude account item names the signed-in account.
|
||||
_controller.accountUsage?.email,
|
||||
],
|
||||
() => _buildHeader(session, inShellBar, canGoBack, answeredBy, inWindow),
|
||||
);
|
||||
@@ -1651,6 +1662,8 @@ class _ChatThreadViewState extends State<ChatThreadView> {
|
||||
ChatBarAction(
|
||||
key: const Key('chat-claude-account-menu'),
|
||||
label: 'Claude account',
|
||||
// The account the chat's Claude Code is signed in to now.
|
||||
subtitle: _controller.accountUsage?.email,
|
||||
identifier: 'chat-claude-account',
|
||||
onPressed: () =>
|
||||
unawaited(showChatClaudeAccountsDialog(context, accounts)),
|
||||
|
||||
Reference in New Issue
Block a user