Skip to content

Added Aria Labels for buttons in CollectionsTable.jsx and DatabaseSidebar.jsx#76

Open
aryansinha1908 wants to merge 7 commits intoyash-pouranik:mainfrom
aryansinha1908:main
Open

Added Aria Labels for buttons in CollectionsTable.jsx and DatabaseSidebar.jsx#76
aryansinha1908 wants to merge 7 commits intoyash-pouranik:mainfrom
aryansinha1908:main

Conversation

@aryansinha1908
Copy link
Copy Markdown

@aryansinha1908 aryansinha1908 commented Apr 2, 2026

🚀 Pull Request Description

Fixes #70

🛠️ Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📝 Documentation update
  • 🎨 UI/UX improvement (Frontend only)
  • ⚙️ Refactor / Chore

🧪 Testing & Validation

Backend Verification:

  • I have run npm test in the backend/ directory and all tests passed.
  • I have verified the API endpoints using Postman/Thunder Client.
  • New unit tests have been added (if applicable).

Frontend Verification:

  • I have run npm run lint in the frontend/ directory.
  • Verified the UI changes on different screen sizes (Responsive).
  • Checked for any console errors in the browser dev tools.

📸 Screenshots / Recordings (Optional)

✅ Checklist

  • My code follows the code style of this project.
  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • My changes generate no new warnings or errors.
  • I have updated the documentation (README/Docs) accordingly.

Built with ❤️ for urBackend.

Summary by CodeRabbit

  • Accessibility
    • Added descriptive labels to interactive controls across the dashboard: per-row actions (View Details, Edit Record, Delete Record), column menu toggle (Open/Close column menu), horizontal table scroll, sidebar controls (close, create collection, empty-state create), and collection delete buttons.
    • Record items now include per-record accessible labels; decorative icons are hidden from assistive technologies.

Added aria-label for buttons in CollectionTable.jsx and
DatabaseSidebar.jsx files
Copilot AI review requested due to automatic review settings April 2, 2026 21:37
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 2, 2026

@aryansinha1908 is attempting to deploy a commit to the Yash Pouranik's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 73e181f9-2f97-4a50-8b95-96954daf3667

📥 Commits

Reviewing files that changed from the base of the PR and between 1af988c and 6acfc4a.

📒 Files selected for processing (3)
  • apps/web-dashboard/src/components/CollectionTable.jsx
  • apps/web-dashboard/src/components/DatabaseSidebar.jsx
  • apps/web-dashboard/src/components/RecordList.jsx
✅ Files skipped from review due to trivial changes (2)
  • apps/web-dashboard/src/components/DatabaseSidebar.jsx
  • apps/web-dashboard/src/components/CollectionTable.jsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/web-dashboard/src/components/RecordList.jsx

📝 Walkthrough

Walkthrough

Added aria-label attributes to interactive controls in three web-dashboard components: CollectionTable.jsx, DatabaseSidebar.jsx, and RecordList.jsx. No event handlers, state, rendering conditions, or control flow were changed.

Changes

Cohort / File(s) Summary
Collection table controls
apps/web-dashboard/src/components/CollectionTable.jsx
Added aria-label to per-row action buttons (View Details, Edit Record, Delete Record); made the "COLUMNS" toolbar button aria-label dynamic (Open column menu / Close column menu); added aria-label="Scroll table horizontally" to the horizontal scroll slider.
Database sidebar buttons
apps/web-dashboard/src/components/DatabaseSidebar.jsx
Added aria-label to the sidebar close button, header create-new-collection button, empty-state create button, and each collection delete button.
Record list items
apps/web-dashboard/src/components/RecordList.jsx
Added descriptive aria-label to each record container (e.g., View details for record ${record._id}).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped through buttons, soft and light,
Gave each a name so they speak right.
Now every click has words to say,
Screen readers lead the gentle way.
Hooray — a clearer, kinder site!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change—adding aria-labels to buttons in CollectionTable.jsx and DatabaseSidebar.jsx—matching the primary scope of the PR, though it omits RecordList.jsx.
Linked Issues check ✅ Passed The PR addresses all three target components from Issue #70 (RecordList.jsx, CollectionTable.jsx, DatabaseSidebar.jsx) by adding meaningful aria-labels to icon-only buttons with no UI/behavior changes, meeting the acceptance criteria.
Out of Scope Changes check ✅ Passed All changes are strictly scoped to adding aria-label attributes to icon-only buttons across the three specified components; no unrelated logic, styling, or refactoring changes are present.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces aria-label attributes to several buttons in the CollectionTable and DatabaseSidebar components to enhance accessibility. The review feedback highlights that some labels are misleading or confusing; specifically, labels for editing and deleting rows were incorrectly named as 'Column' actions, and a sidebar toggle was labeled based on its CSS class rather than its function.

className="btn-icon"
onClick={() => onEdit(info.row.original)}
onPointerDown={e => e.stopPropagation()}
aria-label="Edit Column"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The aria-label "Edit Column" is misleading because this button performs an action on a row (record), not a column. It should be updated to "Edit" or "Edit Row" to match the title attribute and the actual functionality.

Suggested change
aria-label="Edit Column"
aria-label="Edit"

className="btn-icon danger-hover"
onClick={() => onDelete(info.row.original._id)}
onPointerDown={e => e.stopPropagation()}
aria-label="Delete Column"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The aria-label "Delete Column" is incorrect as this button deletes a row (record). Please update it to "Delete" or "Delete Row" to provide accurate information for accessibility.

Suggested change
aria-label="Delete Column"
aria-label="Delete"

<div className="sidebar-actions">
<button
className="btn-icon hide-desktop"
aria-label="Hide Desktop"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The aria-label "Hide Desktop" is confusing. This button is used to close the sidebar in mobile view. A more descriptive label like "Close Sidebar" should be used instead of referencing the CSS class name.

Suggested change
aria-label="Hide Desktop"
aria-label="Close Sidebar"

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/web-dashboard/src/components/CollectionTable.jsx (1)

193-203: ⚠️ Potential issue | 🟡 Minor

Use row-level aria labels for row actions.

On Line 193 and Line 202, the labels say “Column”, but these handlers act on row records. This gives screen-reader users the wrong action context.

Suggested fix
-                            aria-label="Edit Column"
+                            aria-label="Edit Record"
...
-                            aria-label="Delete Column"
+                            aria-label="Delete Record"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web-dashboard/src/components/CollectionTable.jsx` around lines 193 -
203, The aria-labels on the row action buttons in CollectionTable.jsx are wrong
(they say "Column") — update them to use row-level labels so screen readers get
the correct context; change the aria-labels for the Edit and Delete buttons
(where onClick uses onDelete(info.row.original._id) and the edit uses info.row)
to something like "Edit row" and "Delete row" or include identifying row info
(e.g., index or a row name from info.row.original) so the label refers to the
specific row record rather than "Column".
🧹 Nitpick comments (1)
apps/web-dashboard/src/components/CollectionTable.jsx (1)

365-368: Add disclosure semantics to the column-menu toggle.

Since this button opens/closes a menu, include aria-expanded (and optionally aria-haspopup) so assistive tech can announce state changes.

Suggested improvement
                     <button
                         className="btn btn-secondary btn-sm"
 						aria-label="Show Column Menu"
+                        aria-haspopup="menu"
+                        aria-expanded={showColumnMenu}
                         onClick={() => setShowColumnMenu(!showColumnMenu)}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web-dashboard/src/components/CollectionTable.jsx` around lines 365 -
368, The column-menu toggle button in CollectionTable.jsx currently toggles
showColumnMenu via setShowColumnMenu but lacks disclosure semantics; update the
button (the element using onClick={() => setShowColumnMenu(!showColumnMenu)}) to
include aria-expanded={showColumnMenu} and aria-haspopup="menu" (and if a menu
element has an id, add aria-controls="<menu-id>") so assistive tech can announce
open/closed state and relation to the menu.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/web-dashboard/src/components/DatabaseSidebar.jsx`:
- Around line 33-34: The aria-label on the sidebar toggle is ambiguous ("Hide
Desktop"); update the control to use a clear close action label such as "Close
sidebar" or "Collapse sidebar" instead. Locate the element that calls
onClick={() => setIsSidebarOpen(false)} (the sidebar close button) and replace
aria-label="Hide Desktop" with a more descriptive string like aria-label="Close
sidebar" so screen readers convey the correct action.

---

Outside diff comments:
In `@apps/web-dashboard/src/components/CollectionTable.jsx`:
- Around line 193-203: The aria-labels on the row action buttons in
CollectionTable.jsx are wrong (they say "Column") — update them to use row-level
labels so screen readers get the correct context; change the aria-labels for the
Edit and Delete buttons (where onClick uses onDelete(info.row.original._id) and
the edit uses info.row) to something like "Edit row" and "Delete row" or include
identifying row info (e.g., index or a row name from info.row.original) so the
label refers to the specific row record rather than "Column".

---

Nitpick comments:
In `@apps/web-dashboard/src/components/CollectionTable.jsx`:
- Around line 365-368: The column-menu toggle button in CollectionTable.jsx
currently toggles showColumnMenu via setShowColumnMenu but lacks disclosure
semantics; update the button (the element using onClick={() =>
setShowColumnMenu(!showColumnMenu)}) to include aria-expanded={showColumnMenu}
and aria-haspopup="menu" (and if a menu element has an id, add
aria-controls="<menu-id>") so assistive tech can announce open/closed state and
relation to the menu.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6e30dd16-5ef3-401c-b27c-97d5e8149df2

📥 Commits

Reviewing files that changed from the base of the PR and between 416eaee and 617391b.

📒 Files selected for processing (2)
  • apps/web-dashboard/src/components/CollectionTable.jsx
  • apps/web-dashboard/src/components/DatabaseSidebar.jsx

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves accessibility in the web dashboard by adding accessible names (aria-label) to several buttons, primarily targeting icon-only controls in the collections UI.

Changes:

  • Added aria-label attributes to icon buttons in DatabaseSidebar.jsx (close sidebar, create collection, delete collection).
  • Added aria-label attributes to action buttons in CollectionTable.jsx (view/edit/delete row actions, columns menu button).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
apps/web-dashboard/src/components/DatabaseSidebar.jsx Adds aria-labels to sidebar icon buttons and a “Create One” button.
apps/web-dashboard/src/components/CollectionTable.jsx Adds aria-labels to row action buttons and the columns menu toggle.
Comments suppressed due to low confidence (3)

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

  • This button already has visible text (“Create One”), so adding aria-label="Create New Collection" overrides the accessible name and can create a mismatch between what sighted users see and what assistive tech announces. Consider removing the aria-label here, or make it match the visible label.
                        <button
                            className="btn btn-secondary btn-sm"
							aria-label="Create New Collection"
                            onClick={() =>
                                navigate(`/project/${projectId}/create-collection`)
                            }
                        >
                            Create One
                        </button>

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

  • The action buttons operate on a table row/record (see onEdit(info.row.original) and onDelete(info.row.original._id)), but the aria-labels say “Edit Column” / “Delete Column”. These labels should describe the record/document action (e.g., edit/delete record) so screen readers get the correct meaning.
                        <button
                            className="btn-icon"
                            onClick={() => onEdit(info.row.original)}
                            onPointerDown={e => e.stopPropagation()}
		    				aria-label="Edit Column"
                            title="Edit"
                        >
                            <Pencil size={15} />
                        </button>
                        <button
                            className="btn-icon danger-hover"
                            onClick={() => onDelete(info.row.original._id)}
                            onPointerDown={e => e.stopPropagation()}
			    			aria-label="Delete Column"
                            title="Delete"
                        >
                            <Trash2 size={15} />
                        </button>

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

  • The “COLUMNS” button has visible text, so it already has an accessible name; the added aria-label="Show Column Menu" is redundant and also misleading because the button toggles the menu (it should reflect show vs hide). Consider removing the aria-label, or making it stateful (and adding aria-expanded + aria-controls for the menu).
                    <button
                        className="btn btn-secondary btn-sm"
						aria-label="Show Column Menu"
                        onClick={() => setShowColumnMenu(!showColumnMenu)}
                        style={{
                            display: 'flex',
                            alignItems: 'center',
                            gap: '8px',
                            fontSize: '0.8rem',
                            padding: '6px 12px',
                            background: showColumnMenu ? 'rgba(255,255,255,0.08)' : 'transparent'
                        }}
                    >
                        <Settings2 size={14} />
                        COLUMNS
                    </button>

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

<div className="sidebar-actions">
<button
className="btn-icon hide-desktop"
aria-label="Hide Desktop"
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The close (X) icon button is labeled aria-label="Hide Desktop", but the click handler closes the sidebar (setIsSidebarOpen(false)). This label is confusing for screen reader users; rename it to describe the actual action (e.g., closing/hiding the collections sidebar), without referencing “desktop”.

Suggested change
aria-label="Hide Desktop"
aria-label="Close collections sidebar"

Copilot uses AI. Check for mistakes.
Comment on lines 31 to 41
<button
className="btn-icon hide-desktop"
aria-label="Hide Desktop"
onClick={() => setIsSidebarOpen(false)}
>
<X size={18} />
</button>
<button
className="btn-icon add-col-btn"
aria-label="Create New Collection"
onClick={() => navigate(`/project/${projectId}/create-collection`)}
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The newly added aria-label lines in this file contain tab characters / inconsistent indentation (visible in the diff as \t sequences). Please reformat these lines to match the surrounding spacing to avoid noisy diffs and keep formatting consistent.

Copilot uses AI. Check for mistakes.
Comment on lines 180 to 194
@@ -189,6 +190,7 @@
className="btn-icon"
onClick={() => onEdit(info.row.original)}
onPointerDown={e => e.stopPropagation()}
aria-label="Edit Column"
title="Edit"
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The newly added aria-label attributes in this section include tab characters / inconsistent indentation (shown in the diff as \t sequences). Please reformat to match the surrounding indentation for readability and to keep diffs clean.

Copilot uses AI. Check for mistakes.
Comment on lines 181 to 187
className="btn-icon"
onClick={() => onView(info.row.original)}
onPointerDown={e => e.stopPropagation()}
aria-label="View Details"
title="View Details"
>
<Eye size={15} />
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue #70’s acceptance criteria includes adding aria-labels to icon-only buttons in RecordList.jsx, but this PR only updates CollectionTable.jsx and DatabaseSidebar.jsx. RecordList.jsx still contains a btn-icon button without an aria-label. Either include that fix in this PR or update the issue/PR scope so expectations match.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aryansinha1908 this PR doesnt fully solves issue #70
you should complete that fully before then I cant merge this. And also check all he reviews added by coderabbitai, copilot and gemini and upadte accordingly.

@yash-pouranik yash-pouranik self-requested a review April 3, 2026 13:15
Comment on lines 181 to 187
className="btn-icon"
onClick={() => onView(info.row.original)}
onPointerDown={e => e.stopPropagation()}
aria-label="View Details"
title="View Details"
>
<Eye size={15} />
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aryansinha1908 this PR doesnt fully solves issue #70
you should complete that fully before then I cant merge this. And also check all he reviews added by coderabbitai, copilot and gemini and upadte accordingly.

@yash-pouranik
Copy link
Copy Markdown
Owner

@coderabbitai what to do?

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 4, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Get PR reviews and review comments
gh pr view 76 --repo yash-pouranik/urBackend --json reviews,comments,reviewRequests

echo "---REVIEW COMMENTS---"
gh api repos/yash-pouranik/urBackend/pulls/76/comments --jq '.[] | {user: .user.login, body: .body, path: .path, line: .line}'

echo "---ISSUE COMMENTS---"
gh api repos/yash-pouranik/urBackend/issues/76/comments --jq '.[] | {user: .user.login, body: .body}'

echo "---PR STATUS---"
gh pr checks 76 --repo yash-pouranik/urBackend

Length of output: 44813


@yash-pouranik — here's a full summary of what @aryansinha1908 needs to fix before this PR can be merged:


❌ Blocking Issues

1. RecordList.jsx is missing (Issue #70 incomplete)

Issue #70's acceptance criteria explicitly lists 3 files: CollectionTable.jsx, DatabaseSidebar.jsx, **and RecordList.jsx``. The PR only touches 2. All btn-icon/ icon-onlyelements inRecordList.jsxneedaria-label` attributes added.


2. Wrong aria-label values in CollectionTable.jsx

The edit/delete buttons operate on rows/records, not columns. The labels are misleading for screen reader users:

Current (wrong) Should be
aria-label="Edit Column" aria-label="Edit Record"
aria-label="Delete Column" aria-label="Delete Record"

3. Ambiguous aria-label in DatabaseSidebar.jsx

The sidebar close button currently says aria-label="Hide Desktop" — this references a CSS class name, not the action. It should be:

- aria-label="Hide Desktop"
+ aria-label="Close sidebar"

4. Inconsistent indentation on new aria-label lines

The newly added aria-label attributes use tab characters while the surrounding code uses spaces. This should be reformatted to match the file's existing indentation style (applies to both CollectionTable.jsx and DatabaseSidebar.jsx).


⚠️ Minor / Nitpicks (good to fix)

5. Column menu toggle button missing disclosure semantics (CollectionTable.jsx)

The "COLUMNS" toggle button should also declare its open/closed state:

  <button
      aria-label="Show Column Menu"
+     aria-haspopup="menu"
+     aria-expanded={showColumnMenu}
      onClick={() => setShowColumnMenu(!showColumnMenu)}
  >

6. aria-label on "Create One" button overrides visible text (DatabaseSidebar.jsx)

The "Create One" button has visible text, so the aria-label="Create New Collection" overrides what screen readers announce and creates a mismatch. Consider either removing the aria-label here or changing the button text to "Create New Collection" to make them consistent.


You can point @aryansinha1908 to this summary. Once all the above are addressed, the PR should be ready to merge. 🐰

@yash-pouranik
Copy link
Copy Markdown
Owner

@aryansinha1908 You are not following the review.

@aryansinha1908
Copy link
Copy Markdown
Author

Sorry for the late response. I am implementing the changes but I am currently traveling. I will push the changes when I get a stable internet connection. Again, sorry for the delay.

aryansinha1908 and others added 3 commits April 4, 2026 18:43
- Editted aria labels according to codeRabbit's, copilot's  and gemini's
suggesstion.
- Fixed the indentation
- Added arai labels in RecordList.jsx file aswell
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/web-dashboard/src/components/RecordList.jsx`:
- Around line 51-55: Remove aria-hidden from the record-actions container and
make the icon-only button accessible by adding an appropriate aria-label to the
button element (the element with className "btn-icon" inside the
div.record-actions); update the button to include a descriptive aria-label such
as "View record" or context-appropriate text so the ArrowRight icon remains
decorative while screen readers get a meaningful label.
- Around line 23-27: The clickable div with class "record-card" using
onClick={() => onView(record)} is not keyboard-accessible; update the element
(or replace with a semantic <button>) to add role="button", tabIndex={0}, and an
onKeyDown handler that calls onView(record) when Enter or Space is pressed
(handle Space with preventDefault so the page doesn't scroll). Ensure the
existing aria-label remains, and keep the onClick behavior intact so both mouse
and keyboard activate the same onView(record) logic.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b13f21ab-b05b-4a88-bafe-bab7e09b96cb

📥 Commits

Reviewing files that changed from the base of the PR and between 617391b and 1af988c.

📒 Files selected for processing (3)
  • apps/web-dashboard/src/components/CollectionTable.jsx
  • apps/web-dashboard/src/components/DatabaseSidebar.jsx
  • apps/web-dashboard/src/components/RecordList.jsx
✅ Files skipped from review due to trivial changes (2)
  • apps/web-dashboard/src/components/DatabaseSidebar.jsx
  • apps/web-dashboard/src/components/CollectionTable.jsx

Comment on lines 23 to 27
<div
key={record._id}
className="record-card glass-panel"
aria-label={`View details for record ${record._id}`}
onClick={() => onView(record)}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Clickable <div> lacks keyboard accessibility.

The div.record-card has onClick but no role, tabIndex, or keyboard event handler. Screen reader users and keyboard-only users cannot interact with it. Adding aria-label alone does not make the element focusable or operable via keyboard.

♿ Proposed fix to make the card keyboard-accessible
                         <div
                             key={record._id}
                             className="record-card glass-panel"
                             aria-label={`View details for record ${record._id}`}
+                            role="button"
+                            tabIndex={0}
                             onClick={() => onView(record)}
+                            onKeyDown={(e) => {
+                                if (e.key === 'Enter' || e.key === ' ') {
+                                    e.preventDefault();
+                                    onView(record);
+                                }
+                            }}
                         >
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div
key={record._id}
className="record-card glass-panel"
aria-label={`View details for record ${record._id}`}
onClick={() => onView(record)}
<div
key={record._id}
className="record-card glass-panel"
aria-label={`View details for record ${record._id}`}
role="button"
tabIndex={0}
onClick={() => onView(record)}
onKeyDown={(e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
onView(record);
}
}}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web-dashboard/src/components/RecordList.jsx` around lines 23 - 27, The
clickable div with class "record-card" using onClick={() => onView(record)} is
not keyboard-accessible; update the element (or replace with a semantic
<button>) to add role="button", tabIndex={0}, and an onKeyDown handler that
calls onView(record) when Enter or Space is pressed (handle Space with
preventDefault so the page doesn't scroll). Ensure the existing aria-label
remains, and keep the onClick behavior intact so both mouse and keyboard
activate the same onView(record) logic.

Comment on lines 51 to 55
<div className="record-actions" aria-hidden="true">
<button className="btn-icon">
<ArrowRight size={18} />
<ArrowRight size={18} aria-hidden="true" />
</button>
</div>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

aria-hidden="true" on the actions container hides the button from screen readers.

Adding aria-hidden="true" to div.record-actions removes the entire button from the accessibility tree. This is the opposite of Issue #70's requirement—icon-only buttons should have meaningful aria-label attributes, not be hidden entirely.

Remove aria-hidden from the container and add an aria-label to the button instead.

🐛 Proposed fix
-                            <div className="record-actions" aria-hidden="true">
-                                <button className="btn-icon">
+                            <div className="record-actions">
+                                <button className="btn-icon" aria-label="View record details">
                                     <ArrowRight size={18} aria-hidden="true" />
                                 </button>
                             </div>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div className="record-actions" aria-hidden="true">
<button className="btn-icon">
<ArrowRight size={18} />
<ArrowRight size={18} aria-hidden="true" />
</button>
</div>
<div className="record-actions">
<button className="btn-icon" aria-label="View record details">
<ArrowRight size={18} aria-hidden="true" />
</button>
</div>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web-dashboard/src/components/RecordList.jsx` around lines 51 - 55,
Remove aria-hidden from the record-actions container and make the icon-only
button accessible by adding an appropriate aria-label to the button element (the
element with className "btn-icon" inside the div.record-actions); update the
button to include a descriptive aria-label such as "View record" or
context-appropriate text so the ArrowRight icon remains decorative while screen
readers get a meaningful label.

@aryansinha1908
Copy link
Copy Markdown
Author

I made the necessary changes please review them. Sorry for the late response (the internet connection is very weak from my side)

- Removed aria-hidden="true"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add aria-label to icon‑only buttons (web-dashboard)

3 participants