Skip to content

Commit 1af2b4d

Browse files
Merge pull request #76 from aryansinha1908/main
Added Aria Labels for buttons in CollectionsTable.jsx and DatabaseSidebar.jsx
2 parents d75b73e + 37df066 commit 1af2b4d

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

apps/web-dashboard/src/components/CollectionTable.jsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ export default function CollectionTable({ data, activeCollection, onDelete, onVi
181181
className="btn-icon"
182182
onClick={() => onView(info.row.original)}
183183
onPointerDown={e => e.stopPropagation()}
184+
aria-label="View Details"
184185
title="View Details"
185186
>
186187
<Eye size={15} />
@@ -189,6 +190,7 @@ export default function CollectionTable({ data, activeCollection, onDelete, onVi
189190
className="btn-icon"
190191
onClick={() => onEdit(info.row.original)}
191192
onPointerDown={e => e.stopPropagation()}
193+
aria-label="Edit Record"
192194
title="Edit"
193195
>
194196
<Pencil size={15} />
@@ -197,6 +199,7 @@ export default function CollectionTable({ data, activeCollection, onDelete, onVi
197199
className="btn-icon danger-hover"
198200
onClick={() => onDelete(info.row.original._id)}
199201
onPointerDown={e => e.stopPropagation()}
202+
aria-label="Delete Record"
200203
title="Delete"
201204
>
202205
<Trash2 size={15} />
@@ -361,6 +364,9 @@ export default function CollectionTable({ data, activeCollection, onDelete, onVi
361364
<div style={{ position: 'relative' }}>
362365
<button
363366
className="btn btn-secondary btn-sm"
367+
aria-label={showColumnMenu ? "Close column menu" : "Open column menu"}
368+
aria-hashpopup="menu"
369+
aria-expanded={showColumnMenu}
364370
onClick={() => setShowColumnMenu(!showColumnMenu)}
365371
style={{
366372
display: 'flex',
@@ -556,6 +562,7 @@ export default function CollectionTable({ data, activeCollection, onDelete, onVi
556562
value={scrollState.scrollLeft}
557563
onChange={handleSliderChange}
558564
onInput={handleSliderChange}
565+
aria-label="Scroll table horizontally"
559566
style={{ width: '100%', cursor: 'ew-resize' }}
560567
className="column-slider"
561568
/>

apps/web-dashboard/src/components/DatabaseSidebar.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,14 @@ export default function DatabaseSidebar({
3030
<div className="sidebar-actions">
3131
<button
3232
className="btn-icon hide-desktop"
33+
aria-label="Close sidebar"
3334
onClick={() => setIsSidebarOpen(false)}
3435
>
3536
<X size={18} />
3637
</button>
3738
<button
3839
className="btn-icon add-col-btn"
40+
aria-label="New collection"
3941
onClick={() => navigate(`/project/${projectId}/create-collection`)}
4042
title="New Collection"
4143
>
@@ -50,6 +52,7 @@ export default function DatabaseSidebar({
5052
<p>No collections yet.</p>
5153
<button
5254
className="btn btn-secondary btn-sm"
55+
aria-label="Create your first collection"
5356
onClick={() =>
5457
navigate(`/project/${projectId}/create-collection`)
5558
}
@@ -72,6 +75,7 @@ export default function DatabaseSidebar({
7275
<div className="flex items-center gap-2 ml-auto" style={{ display: 'flex', alignItems: 'center', gap: '8px', marginLeft: 'auto' }}>
7376
<button
7477
className="btn-icon delete-btn"
78+
aria-label="Delete Collection"
7579
onClick={(e) => {
7680
e.stopPropagation();
7781
if (onRequestDelete) onRequestDelete(c);

apps/web-dashboard/src/components/RecordList.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export default function RecordList({ data, activeCollection, onView }) {
2323
<div
2424
key={record._id}
2525
className="record-card glass-panel"
26+
aria-label={`View details for record ${record._id}`}
2627
onClick={() => onView(record)}
2728
>
2829
<div className="record-main-info">

0 commit comments

Comments
 (0)