Skip to content

Commit 6d2e3d8

Browse files
committed
Fix UI accessibility issues
1 parent 5a37fb3 commit 6d2e3d8

File tree

4 files changed

+17
-15
lines changed

4 files changed

+17
-15
lines changed

web/components/app-loaders/base-app-loader.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ export default function BaseAppLoader({
3232
className="h-full w-full"
3333
src={src}
3434
sandbox="allow-scripts allow-same-origin allow-forms allow-popups"
35+
role="application"
36+
title={moduleId}
37+
aria-label={moduleId}
3538
/>
3639
);
3740
}

web/components/marketplace/app/app-preview-card.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { ContextMenuState, ExtensionApp } from "@/lib/types";
1313
import { DraggableAttributes } from "@dnd-kit/core";
1414
import { SyntheticListenerMap } from "@dnd-kit/core/dist/hooks/utilities";
1515
import {
16-
addToast,
1716
Button,
1817
Chip,
1918
Skeleton,
@@ -91,7 +90,7 @@ export default function AppPreviewCard({
9190
undefined,
9291
);
9392

94-
const [showMFVersionInfo, setShowMFVersionInfo] = useState(false);
93+
const [isHover, setIsHover] = useState(false);
9594

9695
useEffect(() => {
9796
async function fetchVersions() {
@@ -170,13 +169,13 @@ export default function AppPreviewCard({
170169
className="relative h-full min-h-32 w-full"
171170
onMouseEnter={() => {
172171
if (getPlatform() !== PlatformEnum.Capacitor) {
173-
setIsShowInfo(true);
172+
setIsHover(true);
174173
}
175174
}}
176175
// Hide show info when user taps outside of the modal
177176
onMouseLeave={() => {
178177
if (getPlatform() !== PlatformEnum.Capacitor) {
179-
setIsShowInfo(false);
178+
setIsHover(false);
180179
}
181180
}}
182181
>
@@ -275,9 +274,6 @@ export default function AppPreviewCard({
275274
return;
276275
}
277276

278-
addToast({
279-
title: "App Preview Clicked",
280-
});
281277
if (onPress) {
282278
onPress(extension);
283279
} else {
@@ -323,7 +319,7 @@ export default function AppPreviewCard({
323319
<Skeleton className="h-full w-full" isLoaded={false}></Skeleton>
324320
)}
325321
</Button>
326-
{isShowInfo && (
322+
{(isShowInfo || isHover) && (
327323
<div className="absolute bottom-0.5 left-1/2 flex w-fit -translate-x-1/2 justify-center gap-x-0.5">
328324
{isShowUseButton && (
329325
<Button

web/components/marketplace/workflow/workflow-preview-card.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ export default function WorkflowPreviewCard({
2929

3030
const [isShowInfo, setIsShowInfo] = useState(false);
3131

32+
const [isHover, setIsHover] = useState(false);
33+
3234
useEffect(() => {
3335
setIsLoaded(true);
3436
}, [workflow]);
@@ -54,18 +56,18 @@ export default function WorkflowPreviewCard({
5456
}
5557

5658
return (
57-
<div className="w-full h-full grid grid-rows-[auto_max-content_max-content] grid-cols-1">
59+
<div className="grid h-full w-full grid-cols-1 grid-rows-[auto_max-content_max-content]">
5860
<div
59-
className="relative h-full w-full min-h-32"
61+
className="relative h-full min-h-32 w-full"
6062
onMouseEnter={() => {
6163
if (getPlatform() !== PlatformEnum.Capacitor) {
62-
setIsShowInfo(true);
64+
setIsHover(true);
6365
}
6466
}}
6567
// Hide show info when user taps outside of the modal
6668
onMouseLeave={() => {
6769
if (getPlatform() !== PlatformEnum.Capacitor) {
68-
setIsShowInfo(false);
70+
setIsHover(false);
6971
}
7072
}}
7173
>
@@ -102,7 +104,7 @@ export default function WorkflowPreviewCard({
102104
<Skeleton className="h-full w-full" isLoaded={false}></Skeleton>
103105
)}
104106
</Button>
105-
{isShowInfo && (
107+
{(isShowInfo || isHover) && (
106108
<div className="absolute bottom-0.5 left-1/2 flex w-full -translate-x-1/2 justify-center gap-x-0.5">
107109
<Button
108110
color="primary"

web/components/views/canvas/nodes/app-node/node-handle.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ export default function NodeHandle({
1414
}) {
1515
return (
1616
<div
17-
className="relative h-fit w-fit bg-content2 text-content2-foreground z-40 pointer-events-none px-2 py-1 flex flex-col justify-center shadow-md data-[direction=left]:rounded-l-lg data-[direction=right]:rounded-r-lg"
17+
className="bg-content2 text-content2-foreground pointer-events-none relative z-40 flex h-fit w-fit flex-col justify-center px-2 py-1 shadow-md data-[direction=left]:rounded-l-lg data-[direction=right]:rounded-r-lg"
1818
data-direction={position}
19+
aria-label="Click on node handle to open node menu"
1920
>
20-
<div className="text-center text-sm ">
21+
<div className="text-center text-sm">
2122
<p>{id}</p>
2223
<p>({param?.type.toString()})</p>
2324
</div>

0 commit comments

Comments
 (0)