Skip to content

Commit c649ea1

Browse files
committed
chore: show status when message is blank
The status row looks janky with just the icon. We can get into a "no message" state if the LLM never reported a status update.
1 parent 634fe1c commit c649ea1

File tree

4 files changed

+34
-4
lines changed

4 files changed

+34
-4
lines changed

site/src/modules/workspaces/WorkspaceAppStatus/WorkspaceAppStatus.stories.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ export const Idle: Story = {
4949
},
5050
};
5151

52+
export const NoMessage: Story = {
53+
args: {
54+
status: {
55+
...MockWorkspaceAppStatus,
56+
state: "idle",
57+
},
58+
},
59+
};
60+
5261
export const LongMessage: Story = {
5362
args: {
5463
status: {

site/src/modules/workspaces/WorkspaceAppStatus/WorkspaceAppStatus.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
TooltipProvider,
66
TooltipTrigger,
77
} from "components/Tooltip/Tooltip";
8+
import capitalize from "lodash/capitalize";
89
import { AppStatusStateIcon } from "modules/apps/AppStatusStateIcon";
910
import { cn } from "utils/cn";
1011

@@ -25,6 +26,7 @@ export const WorkspaceAppStatus = ({
2526
);
2627
}
2728

29+
const message = status.message || capitalize(status.state);
2830
return (
2931
<div className="flex flex-col text-content-secondary">
3032
<TooltipProvider>
@@ -40,11 +42,11 @@ export const WorkspaceAppStatus = ({
4042
})}
4143
/>
4244
<span className="whitespace-nowrap max-w-72 overflow-hidden text-ellipsis text-sm text-content-primary font-medium">
43-
{status.message}
45+
{message}
4446
</span>
4547
</div>
4648
</TooltipTrigger>
47-
<TooltipContent>{status.message}</TooltipContent>
49+
<TooltipContent>{message}</TooltipContent>
4850
</Tooltip>
4951
</TooltipProvider>
5052
<span className="text-xs first-letter:uppercase block pl-6">

site/src/pages/WorkspacePage/AppStatuses.stories.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,24 @@ export const IdleState: Story = {
6464
]),
6565
},
6666
};
67+
68+
export const NoMessage: Story = {
69+
args: {
70+
agent: mockAgent([
71+
{
72+
...MockWorkspaceAppStatus,
73+
id: "status-8",
74+
icon: "",
75+
message: "",
76+
created_at: createTimestamp(5, 20),
77+
uri: "",
78+
state: "idle" as const,
79+
},
80+
...MockWorkspaceAppStatuses,
81+
]),
82+
},
83+
};
84+
6785
export const LongStatusText: Story = {
6886
args: {
6987
agent: mockAgent([

site/src/pages/WorkspacePage/AppStatuses.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
TooltipProvider,
1313
TooltipTrigger,
1414
} from "components/Tooltip/Tooltip";
15+
import capitalize from "lodash/capitalize";
1516
import { timeFrom } from "utils/time";
1617

1718
import {
@@ -77,7 +78,7 @@ export const AppStatuses: FC<AppStatusesProps> = ({
7778
<div className="text-sm font-medium text-content-primary flex items-center gap-2 ">
7879
<AppStatusStateIcon state={latestStatus.state} latest />
7980
<span className="block flex-1 whitespace-nowrap overflow-hidden text-ellipsis">
80-
{latestStatus.message}
81+
{latestStatus.message || capitalize(latestStatus.state)}
8182
</span>
8283
</div>
8384
<span className="text-xs text-content-secondary first-letter:uppercase block pl-[26px]">
@@ -160,7 +161,7 @@ export const AppStatuses: FC<AppStatusesProps> = ({
160161
latest={false}
161162
className="size-icon-xs w-[18px]"
162163
/>
163-
{status.message}
164+
{status.message || capitalize(status.state)}
164165
</span>
165166
<span className="text-2xs text-content-secondary first-letter:uppercase block pl-[26px]">
166167
{formattedTimestamp}

0 commit comments

Comments
 (0)