Skip to content

Commit 2f21f36

Browse files
t3dotggclaude
andcommitted
fix(web): paused goals keep the token label where it fits
Above 480px a paused goal shows the same token label as a working one. At 480px and below the label gives its room to Resume and Clear, and the usage joins the objective, so it is visible or in the details popover. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 3a5641a commit 2f21f36

1 file changed

Lines changed: 18 additions & 9 deletions

File tree

‎apps/web/src/components/chat/ThreadActivityBanners.tsx‎

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,21 @@ export function goalBannerItem(input: {
5858
}): ComposerBannerStackItem {
5959
const { isWorking, onSendCommand } = input;
6060
const presentation = presentProviderGoal(input.goal, isWorking);
61-
// The token count opens the full usage, unless the full usage is all there is.
61+
// The token count opens the full usage, unless the full usage is all there is. A narrow
62+
// paused row gives its room to Resume and Clear and moves the usage into the objective.
63+
const usageClassName = cn("mx-2", !isWorking && "@max-[480px]:hidden");
6264
const usageLabel =
63-
!isWorking || presentation.usage === null ? null : presentation.tokens === null ||
65+
presentation.usage === null ? null : presentation.tokens === null ||
6466
presentation.tokens === presentation.usage ? (
65-
<span className="mx-2 whitespace-nowrap text-muted-foreground tabular-nums">
67+
<span className={cn(usageClassName, "whitespace-nowrap text-muted-foreground tabular-nums")}>
6668
{presentation.usage}
6769
</span>
6870
) : (
6971
<Popover>
7072
<PopoverTrigger
7173
openOnHover
7274
render={<InlineButton tone="muted" />}
73-
className="mx-2"
75+
className={usageClassName}
7476
aria-label={`Goal usage: ${presentation.usage}`}
7577
>
7678
<span className="font-normal tabular-nums">{presentation.tokens}</span>
@@ -86,12 +88,19 @@ export function goalBannerItem(input: {
8688
group: "activity",
8789
icon: <TargetIcon />,
8890
title: presentation.title,
89-
// A paused goal's Resume and Clear need the room, so its usage joins the objective, where
90-
// the details popover can show it whole.
91+
// In the row this shows only where the usage button hides; the details popover always has it.
9192
description:
92-
isWorking || presentation.usage === null
93-
? presentation.objective
94-
: `${presentation.objective} · ${presentation.usage}`,
93+
isWorking || presentation.usage === null ? (
94+
presentation.objective
95+
) : (
96+
<>
97+
{presentation.objective}
98+
<span className="in-data-composer-banner-row:hidden in-data-composer-banner-row:@max-[480px]:inline">
99+
{" "}
100+
· {presentation.usage}
101+
</span>
102+
</>
103+
),
95104
actions:
96105
usageLabel === null && isWorking ? undefined : (
97106
<>

0 commit comments

Comments
 (0)