Skip to content

fix: improve image alt text for accessibility#654

Open
Kamini-sudo wants to merge 4 commits into
AOSSIE-Org:mainfrom
Kamini-sudo:fix-416
Open

fix: improve image alt text for accessibility#654
Kamini-sudo wants to merge 4 commits into
AOSSIE-Org:mainfrom
Kamini-sudo:fix-416

Conversation

@Kamini-sudo
Copy link
Copy Markdown

@Kamini-sudo Kamini-sudo commented Mar 31, 2026

Improved Alt Text for Images to Enhance Accessibility
Addressed Issues
Fixes #416
AI Usage Disclosure

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a helpful aid, it is essential that your contributions:

Meet the task requirements
Build successfully
Include relevant tests
Pass all linters

Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please ensure you fully understand the changes you are proposing and their impact. Low-quality AI-generated contributions (“AI slop”) are strongly discouraged and may result in blocking or banning. Do not spam repositories with AI-generated content.

Check one of the checkboxes below:

This PR does not contain AI-generated code at all.
I have tested the code locally and I am responsible for it.

I have used the following AI models and tools: TODO

Checklist

1- My PR addresses a single issue, fixes a single bug or makes a single improvement.
2- My code follows the project's code style and conventions.
3- If applicable, I have made corresponding changes or additions to the documentation.
4- If applicable, I have made corresponding changes or additions to tests.
5- My changes generate no new warnings or errors.
6- I have joined the Discord server and I will share a link to this PR with the project maintainers there.
7- I have read the Contribution Guidelines.
8- Once I submit my PR, CodeRabbit AI will automatically review it and I will address CodeRabbit's comments.
9- I have filled this PR template completely and carefully, and I understand that my PR may be closed without review otherwise.

Summary by CodeRabbit

  • Documentation
    • Improved image descriptions on the home page:
      • Made the logo image alt text more descriptive.
      • Clarified the stars image alt text to indicate a rating.

Improved alt text for images to enhance accessibility.
Fixes AOSSIE-Org#416
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 31, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 14d7ba41-d640-4d0d-93ba-ad180b38cff3

📥 Commits

Reviewing files that changed from the base of the PR and between 4d58b43 and 6bc2558.

📒 Files selected for processing (1)
  • eduaid_web/src/pages/Home.jsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • eduaid_web/src/pages/Home.jsx

📝 Walkthrough

Walkthrough

Updated alt text for two <img> elements in eduaid_web/src/pages/Home.jsx: the logo alt changed from "logo" to " EduAid logo" (leading space preserved) and the stars image alt changed from "stars" to "rating stars". No other code, logic, or exports were modified.

Changes

Cohort / File(s) Summary
Accessibility Improvements
eduaid_web/src/pages/Home.jsx
Changed alt attributes on two images: logo ("logo"" EduAid logo") and rating stars ("stars""rating stars").

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 I hopped through lines both short and neat,
Tucked words in tags to make pages complete.
"EduAid logo" and "rating stars" now sing,
So screen readers know the little things. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR only addresses accessibility improvements to alt text but does not address the other critical requirements from issue #416: missing image in Journey.jsx, broken link in CardHome.jsx, or unused prop in index.jsx. Complete all coding requirements from issue #416: fix missing road_image.png reference, replace hardcoded href in CardHome.jsx, remove unused previousPathname prop from index.jsx, and add ARIA labels for background images in apply.jsx.
✅ 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: updating alt text for images to improve accessibility, which aligns with the file modifications shown in the summary.
Out of Scope Changes check ✅ Passed All changes in the PR are in-scope as they relate to accessibility improvements mentioned in issue #416, with no extraneous modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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

@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: 3

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

Inline comments:
In `@eduaid_web/src/pages/Home.jsx`:
- Line 79: The decorative stars image currently uses alt="feature icon" which is
redundant for screen readers; locate the <img src={starsImg} ... /> in Home.jsx
(the element referencing starsImg) and change its alt attribute to an empty
string (alt="") so it is treated as decorative per WCAG; ensure no additional
ARIA labels are added for this element.
- Line 47: The img element in Home.jsx has alt=" EduAid logo" with a leading
space; remove that leading space so the alt attribute reads "EduAid logo"
(locate the <img src={logo_trans} ... alt=... /> in the Home component and
update the alt value) to ensure screen readers read the text correctly.
- Line 64: The img element using the starsImg asset has an alt value with a
leading space (" rating stars") and appears decorative in the subtitle; update
the <img> usage in Home.jsx to remove the leading space if the stars convey
meaningful content (change alt to "rating stars") or, preferably, mark it as
decorative by setting alt="" so screen readers skip it; ensure you update the
img element that references starsImg accordingly.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7cc1c6ba-e310-40d6-8935-d86a2bd4d6cc

📥 Commits

Reviewing files that changed from the base of the PR and between 2038116 and 4d58b43.

📒 Files selected for processing (1)
  • eduaid_web/src/pages/Home.jsx

<div className="w-full h-full bg-cust bg-opacity-50 bg-custom-gradient overflow-auto px-4 py-6 sm:px-8 md:px-16">
<div className="max-w-5xl mx-auto">
<img src={logo_trans} alt="logo" className="w-24 my-4 sm:my-6" />
<img src={logo_trans} alt=" EduAid logo" className="w-24 my-4 sm:my-6" />
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Remove the leading space in the alt text.

The alt text " EduAid logo" contains a leading space, which will cause screen readers to announce an awkward pause before "EduAid logo". Alt text should start with the descriptive content directly.

🔧 Proposed fix
-          <img src={logo_trans} alt=" EduAid logo" className="w-24 my-4 sm:my-6" />
+          <img src={logo_trans} alt="EduAid logo" className="w-24 my-4 sm:my-6" />
📝 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
<img src={logo_trans} alt=" EduAid logo" className="w-24 my-4 sm:my-6" />
<img src={logo_trans} alt="EduAid logo" className="w-24 my-4 sm:my-6" />
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@eduaid_web/src/pages/Home.jsx` at line 47, The img element in Home.jsx has
alt=" EduAid logo" with a leading space; remove that leading space so the alt
attribute reads "EduAid logo" (locate the <img src={logo_trans} ... alt=... />
in the Home component and update the alt value) to ensure screen readers read
the text correctly.

Comment thread eduaid_web/src/pages/Home.jsx Outdated
Comment thread eduaid_web/src/pages/Home.jsx Outdated
className="flex items-center rounded-l-2xl sm:rounded-2xl px-6 py-3 bg-gradient-to-r from-[#FF005C] via-[#7600F2] to-[#00CBE7] gap-4 w-fit"
>
<img src={starsImg} width={32} height={16} alt="" />
<img src={starsImg} width={32} height={16} alt="feature icon" />
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Reconsider: this decorative image should use empty alt text.

Changing from alt="" to alt="feature icon" is a step backward for accessibility. The stars image here is decorative—the meaningful content is already provided by the feature text ("Doc/Audio Input", etc.). Generic alt text like "feature icon" adds no value and creates redundant announcements for screen reader users. Per WCAG guidelines, decorative images should use alt="".

♻️ Proposed fix to restore decorative alt
-                <img src={starsImg} width={32} height={16} alt="feature icon" />
+                <img src={starsImg} width={32} height={16} alt="" />
📝 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
<img src={starsImg} width={32} height={16} alt="feature icon" />
<img src={starsImg} width={32} height={16} alt="" />
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@eduaid_web/src/pages/Home.jsx` at line 79, The decorative stars image
currently uses alt="feature icon" which is redundant for screen readers; locate
the <img src={starsImg} ... /> in Home.jsx (the element referencing starsImg)
and change its alt attribute to an empty string (alt="") so it is treated as
decorative per WCAG; ensure no additional ARIA labels are added for this
element.

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.

Fix missing image, broken link, unused prop, and accessibility issues

1 participant