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:
@@ -9,8 +9,9 @@ import '../domain/chat_usage_ring.dart';
|
||||
/// A thin ring around the composer's send button showing how much of the
|
||||
/// harness account's quota is used ([chatUsageRing]): barely visible
|
||||
/// normally, the tertiary colour from 80% and the error colour from 95%. The
|
||||
/// button's tooltip (hover, or long-press on touch) adds every window:
|
||||
/// "Send" then "5-hour 42% · resets 17:20 · Weekly 61% · resets Thu 09:00".
|
||||
/// button's tooltip (hover, or long-press on touch) adds the account and
|
||||
/// every window: "Send" then "sam@example.com · 5-hour 42% · resets 17:20 ·
|
||||
/// Weekly 61% · resets Thu 09:00" ([chatSendTooltip]).
|
||||
///
|
||||
/// The ring is painted beside the button, never in its layout or hit test,
|
||||
/// so the button keeps its size, target, states and animations. Without a
|
||||
@@ -72,17 +73,14 @@ class _ChatSendUsageRingState extends State<ChatSendUsageRing> {
|
||||
|
||||
Widget _ring(BuildContext context) {
|
||||
final now = widget.now();
|
||||
final ring = chatUsageRing(widget.usage(), now);
|
||||
final usage = widget.usage();
|
||||
final ring = chatUsageRing(usage, now);
|
||||
_ticking(ring != null);
|
||||
// The button stays the same child with or without a ring, so a report
|
||||
// arriving never remounts it (its hover, focus and ink stay).
|
||||
return CustomPaint(
|
||||
painter: ring == null ? null : _painter(context, ring),
|
||||
child: widget.button(
|
||||
ring == null
|
||||
? widget.label
|
||||
: '${widget.label}\n${chatUsageRingSummary(ring, now)}',
|
||||
),
|
||||
child: widget.button(chatSendTooltip(widget.label, usage, ring, now)),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user