Skip to content

Commit d573323

Browse files
committed
fix: use correct state in status list
It was using the latest state for all statuses, so if the last status was "failing" for example every status would show the failing icon.
1 parent f1cca03 commit d573323

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,31 @@ export const SingleStatus: Story = {
8282
},
8383
};
8484

85+
export const MultipleStatuses: Story = {
86+
args: {
87+
agent: mockAgent([
88+
{
89+
...MockWorkspaceAppStatus,
90+
id: "status-1",
91+
icon: "",
92+
message: "Initial setup complete.",
93+
created_at: createTimestamp(5, 10), // 15:05:10 (after referenceDate)
94+
uri: "",
95+
state: "complete" as const,
96+
},
97+
{
98+
...MockWorkspaceAppStatus,
99+
id: "status-2",
100+
icon: "",
101+
message: "Working...",
102+
created_at: createTimestamp(5, 0), // 15:05:00 (after referenceDate)
103+
uri: "",
104+
state: "working" as const,
105+
},
106+
]),
107+
},
108+
};
109+
85110
function mockAgent(statuses: WorkspaceAppStatus[]) {
86111
return {
87112
...MockWorkspaceAgent,

site/src/pages/WorkspacePage/AppStatuses.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export const AppStatuses: FC<AppStatusesProps> = ({
156156
<div className="flex items-center justify-between w-full text-content-secondary">
157157
<span className="text-xs flex items-center gap-2">
158158
<AppStatusStateIcon
159-
state={latestStatus.state}
159+
state={status.state}
160160
latest={false}
161161
className="size-icon-xs w-[18px]"
162162
/>

0 commit comments

Comments
 (0)