Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcbfe975

Browse files
refactor: show unhealthy status on workspace status indicator (#17956)
Instead of showing a "yellow question icon" on the side of the status,to let the user aware of unhealthy agents, we could make it yellow anduse a tooltip.Before:<img width="1512" alt="Screenshot 2025-05-20 at 18 13 15"src="https://github.com/user-attachments/assets/afee470e-9dd4-4c32-b2bc-b9f66eac60fa"/>After:<img width="1512" alt="Screenshot 2025-05-20 at 18 13 26"src="https://github.com/user-attachments/assets/5769828b-f23c-45a5-8017-c4a88f085d0f"/>
1 parentcb7ce18 commitcbfe975

File tree

3 files changed

+47
-14
lines changed

3 files changed

+47
-14
lines changed

‎site/src/modules/workspaces/WorkspaceStatusIndicator/WorkspaceStatusIndicator.stories.tsx‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@ export const Running: Story = {
2727
},
2828
};
2929

30+
exportconstUnhealthy:Story={
31+
args:{
32+
workspace:{
33+
...createWorkspaceWithStatus("running"),
34+
health:{
35+
healthy:false,
36+
failing_agents:[],
37+
},
38+
},
39+
},
40+
};
41+
3042
exportconstStopped:Story={
3143
args:{
3244
workspace:createWorkspaceWithStatus("stopped"),

‎site/src/modules/workspaces/WorkspaceStatusIndicator/WorkspaceStatusIndicator.tsx‎

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import {
44
StatusIndicatorDot,
55
typeStatusIndicatorProps,
66
}from"components/StatusIndicator/StatusIndicator";
7+
import{
8+
Tooltip,
9+
TooltipContent,
10+
TooltipProvider,
11+
TooltipTrigger,
12+
}from"components/Tooltip/Tooltip";
713
importtype{FC}from"react";
814
importtypeReactfrom"react";
915
import{
@@ -32,18 +38,41 @@ export const WorkspaceStatusIndicator: FC<WorkspaceStatusIndicatorProps> = ({
3238
workspace,
3339
children,
3440
})=>{
35-
const{ text, type}=getDisplayWorkspaceStatus(
41+
let{ text, type}=getDisplayWorkspaceStatus(
3642
workspace.latest_build.status,
3743
workspace.latest_build.job,
3844
);
3945

40-
return(
46+
if(!workspace.health.healthy){
47+
type="warning";
48+
}
49+
50+
conststatusIndicator=(
4151
<StatusIndicatorvariant={variantByStatusType[type]}>
4252
<StatusIndicatorDot/>
43-
<span>
44-
<spanclassName="sr-only">Workspace status:</span>{text}
45-
</span>
53+
<spanclassName="sr-only">Workspace status:</span>{text}
4654
{children}
4755
</StatusIndicator>
4856
);
57+
58+
if(workspace.health.healthy){
59+
returnstatusIndicator;
60+
}
61+
62+
return(
63+
<TooltipProvider>
64+
<Tooltip>
65+
<TooltipTriggerasChild>
66+
<StatusIndicatorvariant={variantByStatusType[type]}>
67+
<StatusIndicatorDot/>
68+
<spanclassName="sr-only">Workspace status:</span>{text}
69+
{children}
70+
</StatusIndicator>
71+
</TooltipTrigger>
72+
<TooltipContent>
73+
Your workspace is running but some agents are unhealthy.
74+
</TooltipContent>
75+
</Tooltip>
76+
</TooltipProvider>
77+
);
4978
};

‎site/src/pages/WorkspacesPage/WorkspacesTable.tsx‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import { Button } from "components/Button/Button";
2121
import{ExternalImage}from"components/ExternalImage/ExternalImage";
2222
import{VSCodeIcon}from"components/Icons/VSCodeIcon";
2323
import{VSCodeInsidersIcon}from"components/Icons/VSCodeInsidersIcon";
24-
import{InfoTooltip}from"components/InfoTooltip/InfoTooltip";
2524
import{Spinner}from"components/Spinner/Spinner";
2625
import{Stack}from"components/Stack/Stack";
2726
import{
@@ -290,6 +289,7 @@ export const WorkspacesTable: FC<WorkspacesTableProps> = ({
290289
</TableCell>
291290

292291
<WorkspaceStatusCellworkspace={workspace}/>
292+
293293
<WorkspaceActionsCell
294294
workspace={workspace}
295295
onActionSuccess={onActionSuccess}
@@ -395,14 +395,6 @@ const WorkspaceStatusCell: FC<WorkspaceStatusCellProps> = ({ workspace }) => {
395395
<TableCell>
396396
<divclassName="flex flex-col">
397397
<WorkspaceStatusIndicatorworkspace={workspace}>
398-
{workspace.latest_build.status==="running"&&
399-
!workspace.health.healthy&&(
400-
<InfoTooltip
401-
type="warning"
402-
title="Workspace is unhealthy"
403-
message="Your workspace is running but some agents are unhealthy."
404-
/>
405-
)}
406398
{workspace.dormant_at&&(
407399
<WorkspaceDormantBadgeworkspace={workspace}/>
408400
)}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp