Skip to content

Commit 79ddd91

Browse files
committed
feat: replace agent avatar div with button for improved accessibility and interaction
1 parent 6df921b commit 79ddd91

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

web/components/views/home/home-view.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,9 +1104,12 @@ export default function HomeView({
11041104
{/* Avatar mosaic */}
11051105
<div className="hidden grid-cols-4 gap-2 sm:grid">
11061106
{allAgents.slice(0, 8).map((a) => (
1107-
<div
1107+
<button
11081108
key={a.id}
1109-
className="group relative flex aspect-square flex-col justify-end overflow-hidden rounded-[14px] shadow-sm"
1109+
type="button"
1110+
onClick={() => setSelectedAgent(a)}
1111+
aria-label={`Open ${a.name}'s details`}
1112+
className="group relative flex aspect-square flex-col justify-end overflow-hidden rounded-[14px] text-left shadow-sm transition-transform hover:-translate-y-0.5 hover:shadow-md focus:outline-none focus-visible:ring-2 focus-visible:ring-amber-400"
11101113
style={{
11111114
background: `linear-gradient(135deg, hsl(${a.hue} 60% 92%), hsl(${(a.hue + 30) % 360} 60% 86%))`,
11121115
}}
@@ -1132,7 +1135,7 @@ export default function HomeView({
11321135
{a.role}
11331136
</span>
11341137
</div>
1135-
</div>
1138+
</button>
11361139
))}
11371140
</div>
11381141
</div>

0 commit comments

Comments
 (0)