Skip to content

Commit 48bb534

Browse files
authored
chore: fix idle state icon when disabled (#18554)
When the workspace is off, we set a disabled text/stroke color, but for the idle icon that also needs a fill, this only changed the outline making it look weird. Instead, move the disabled logic into the component so we can apply a matching fill. I felt it looked too thick with both the outline and fill, so I also removed the outline. Really I think maybe the workspace status should be a separate column rather than disabling these icons, but this maintains the status quo. Before with mismatching stroke and fill color: ![screenshot](https://github.com/user-attachments/assets/961014b7-1e26-49f0-aa87-834f2f367618) After with disabled fill and stroke removal: ![screenshot](https://github.com/user-attachments/assets/205e4515-dc01-4437-87ec-a0f8a546da3b) Enabled fill and stroke removal: ![screenshot](https://github.com/user-attachments/assets/04f5914e-f96c-4c75-8873-e3fc9c854d95)
1 parent 6c713d5 commit 48bb534

File tree

3 files changed

+44
-7
lines changed

3 files changed

+44
-7
lines changed

site/src/modules/apps/AppStatusStateIcon.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,23 @@ export const AppStatusStateIcon: FC<AppStatusStateIconProps> = ({
2424
latest,
2525
className: customClassName,
2626
}) => {
27-
const className = cn(["size-4 shrink-0", customClassName]);
27+
const className = cn([
28+
"size-4 shrink-0",
29+
customClassName,
30+
disabled && "text-content-disabled",
31+
]);
2832

2933
switch (state) {
3034
case "idle":
35+
// The pause icon is outlined; add a fill since it is hard to see and
36+
// remove the stroke so it is not overly thick.
3137
return (
3238
<PauseIcon
39+
css={{ strokeWidth: 0 }}
3340
className={cn([
3441
"text-content-secondary",
35-
"fill-content-secondary",
3642
className,
43+
disabled ? "fill-content-disabled" : "fill-content-secondary",
3744
])}
3845
/>
3946
);

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

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,43 @@ export const LongMessage: Story = {
6969
},
7070
};
7171

72-
export const Disabled: Story = {
72+
export const DisabledComplete: Story = {
7373
args: {
7474
status: MockWorkspaceAppStatus,
7575
disabled: true,
7676
},
7777
};
78+
79+
export const DisabledFailure: Story = {
80+
args: {
81+
status: {
82+
...MockWorkspaceAppStatus,
83+
state: "failure",
84+
message: "Couldn't figure out how to start the dev server",
85+
},
86+
disabled: true,
87+
},
88+
};
89+
90+
export const DisabledWorking: Story = {
91+
args: {
92+
status: {
93+
...MockWorkspaceAppStatus,
94+
state: "working",
95+
message: "Starting dev server...",
96+
uri: "",
97+
},
98+
disabled: true,
99+
},
100+
};
101+
102+
export const DisabledIdle: Story = {
103+
args: {
104+
status: {
105+
...MockWorkspaceAppStatus,
106+
state: "idle",
107+
message: "Done for now",
108+
},
109+
disabled: true,
110+
},
111+
};

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
} from "components/Tooltip/Tooltip";
88
import capitalize from "lodash/capitalize";
99
import { AppStatusStateIcon } from "modules/apps/AppStatusStateIcon";
10-
import { cn } from "utils/cn";
1110

1211
type WorkspaceAppStatusProps = {
1312
status: APIWorkspaceAppStatus | null;
@@ -37,9 +36,6 @@ export const WorkspaceAppStatus = ({
3736
latest
3837
disabled={disabled}
3938
state={status.state}
40-
className={cn({
41-
"text-content-disabled": disabled,
42-
})}
4339
/>
4440
<span className="whitespace-nowrap max-w-72 overflow-hidden text-ellipsis text-sm text-content-primary font-medium">
4541
{message}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy