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
@@ -30,11 +30,15 @@ class SegmentedOverflowEntry {
this.choices = const [],
this.shortcut,
this.destructive = false,
this.subtitle,
});
final String label;
final IconData icon;
/// A short second line under [label] (the account an entry acts on).
final String? subtitle;
/// Closes or removes something (Close pane): listed last on a phone sheet,
/// after a divider, in the error colour.
final bool destructive;
@@ -108,6 +112,7 @@ class SegmentedMoreButton extends StatelessWidget {
for (final entry in entries)
AppSheetAction(
label: entry.label,
subtitle: entry.subtitle,
icon: entry.icon,
onSelected: entry.onPressed,
destructive: entry.destructive,
@@ -132,7 +137,7 @@ class SegmentedMoreButton extends StatelessWidget {
leadingIcon: Icon(entry.icon),
onPressed: entry.onPressed,
shortcut: entry.shortcut,
child: Text(entry.label),
child: _EntryText(entry),
)
else
SubmenuButton(
@@ -163,3 +168,30 @@ class SegmentedMoreButton extends StatelessWidget {
);
}
}
/// A menu entry's label, with its subtitle beneath in the muted small style.
class _EntryText extends StatelessWidget {
const _EntryText(this.entry);
final SegmentedOverflowEntry entry;
@override
Widget build(BuildContext context) {
final subtitle = entry.subtitle;
if (subtitle == null || subtitle.isEmpty) return Text(entry.label);
final theme = Theme.of(context);
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(entry.label),
Text(
subtitle,
style: theme.textTheme.bodySmall?.copyWith(
color: theme.colorScheme.onSurfaceVariant,
),
),
],
);
}
}