Skip to content

[Accessibility]: Fixed poor visibility of Navbar links and logo - #48

Merged
udaycodespace merged 2 commits into
udaycodespace:mainfrom
sujalv28:fix/poor-visibility-of-navbar-links-and-logo
Aug 7, 2026
Merged

[Accessibility]: Fixed poor visibility of Navbar links and logo#48
udaycodespace merged 2 commits into
udaycodespace:mainfrom
sujalv28:fix/poor-visibility-of-navbar-links-and-logo

Conversation

@sujalv28

@sujalv28 sujalv28 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR solves the issue #46 [Poor visibility of navbar links and logo]. The navbar background is fixed dark in both themes, but several elements inside it inherited theme-flipping colors instead of a fixed one, making the brand name, Home, and Enrolled Courses invisible in light mode and only readable in dark mode. Fixed with a dedicated fixed navbar-foreground constant, then addressed follow-on layout/consistency issues on Saved/Log Out found during verification.

Related Issue

Issue #46 [Poor visibility of navbar links and logo]

Closes #46 [Poor visibility of navbar links and logo]

What changed?

Visibility fixes (root cause: fixed-dark surface paired with theme-flipping or hardcoded-wrong foreground):

  • Introduced --navbar-fg, a fixed light constant in :root, never redefined in body.dark-mode, since the navbar surface itself is always dark.
  • Home / Enrolled Courses (.premium-btn) - now use --navbar-fg instead of inheriting the flipping --ink.
  • Brand wordmark "earnhub" - removed hardcoded #0a2342 (invisible dark navy on dark navbar), now uses --navbar-fg; the "L" mark given a fixed accent color instead of the same broken inheritance.
  • Saved link - same fix, was inheriting --ink, invisible in light mode.
  • Settings button - was a visually distinct highlighted pill (background + box-shadow) that didn't match the plain-text links beside it; stripped down to match Home/Enrolled Courses exactly.

Hover consistency:

  • Added footer-style hover (fixed accent color, --acid) to all plain nav links and Settings, initially with an animated underline, later simplified to a color-change on Saved only after the underline read as visually noisy.
  • Log Out explicitly excluded from any hover effect — decoupled from the shared .premium-btn class so it keeps its own gradient pill styling untouched.

Layout / Re-ordering (Saved + Log Out):

  • Swapped order: Saved now precedes Log Out (was reversed).
  • Moved Saved into the same flex row as Hi {name} and Log Out - previously rendered as a sibling outside that row, breaking vertical alignment.
  • Removed default 'h5' margin and added display:flex; align-items:center so the username baseline matches the other two controls.
  • Added spacing between Saved and Log Out (previously touching).
  • Matched font-family/size/weight across Log Out and Saved to the rest of the nav — Bootstrap's .btn-sm class was silently overriding the app's own font reset on Log Out.

Files touched: NavBar.jsx, App.css, Bookmarks.css, AdminHome.jsx, TeacherHome.jsx.

Type

  • Bug fix
  • New feature
  • Refactor
  • Docs only
  • Tests
  • Config / workflow
  • Security
  • Breaking change

Areas touched

  • Frontend
  • Backend
  • Database
  • Docs
  • Workflow / GitHub Actions
  • Config / environment

Testing

  • Tested locally
  • Build passes
  • Lint passes
  • Tests added or updated
  • Docs only, no runtime testing needed

Test steps

  1. Pull this branch and run the application locally.
  2. Log in and navigate to the dashboard.
  3. Verify that the Navbar is easily visible and readable without any issue

Screenshots & Screen Recordings

  • Not needed
  • Added below

Before

Screenshot 2026-08-07 045112 Screenshot 2026-08-05 205500 Screenshot 2026-08-05 205945

After

Screenshot 2026-08-07 043622 Screenshot 2026-08-07 043642
Hover.Effect.mp4
Hover.effect.2.mp4

Edge cases checked

  • Empty or missing data
  • Loading / slow response
  • API failure / server error
  • Rate limit / throttling
  • Invalid or unexpected input
  • Permission / access denied
  • Partial or inconsistent data
  • Mobile / small screen behavior
  • Other

Other edge case details

Checklist

  • Read CONTRIBUTING.md
  • Linked the issue
  • Assigned before starting or approved by maintainer
  • Changes are focused on one issue
  • No debug logs or unused code
  • Documentation updated if needed
  • No new warnings or console errors
  • Changes are meaningful, not trivial

Copilot AI lite review requested due to automatic review settings August 6, 2026 23:47

Copilot AI left a comment

Copy link
Copy Markdown

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 addresses accessibility/readability issues in the main navbar by introducing a fixed foreground color token for navbar content on an always-dark navbar surface, and by aligning navbar link styling/ordering (including Saved and Log Out) for consistent visibility across themes.

Changes:

  • Added a new CSS variable --navbar-fg and updated navbar link/brand styling to use it for consistent contrast.
  • Introduced/standardized navbar link styling via .premium-btn, adjusted Settings/brand presentation, and updated Log Out typography via .logout-btn.
  • Updated Saved courses navbar link styling and hover color behavior.

Reviewed changes

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

File Description
frontend/src/components/common/NavBar.jsx Updates brand styling, Settings button presentation, and reorders/moves Saved + Log Out controls within the navbar layout.
frontend/src/components/bookmarks/Bookmarks.css Adds fixed navbar-foreground coloring and hover styling for the Saved courses nav link.
frontend/src/App.css Introduces --navbar-fg and adds global navbar link/brand/logout styling rules to ensure consistent contrast and hover behavior.

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

Comment thread frontend/src/App.css Outdated
Comment on lines +1370 to +1394
.settings-btn {
background: transparent;
}

.settings-btn::after {
content: '';
position: absolute;
left: 14px;
right: 14px;
bottom: 2px;
height: 2px;
background: var(--acid);
transform: scaleX(0);
transform-origin: left;
transition: transform 0.25s ease;
}

.settings-btn:hover {
color: var(--acid);
background: transparent;
}

.settings-btn:hover::after {
transform: scaleX(1);
}
Comment on lines +78 to +82
aria-haspopup="true"
aria-expanded={settingsOpen}
tabIndex={0}
>
<span style={{fontSize: '1.3rem'}}>⚙️</span> <span className="d-none d-md-inline">Settings</span>
<span className="d-none d-md-inline">Settings</span>
Comment on lines 345 to +355
.saved-courses-nav-link {
display: inline-flex;
align-items: center;
gap: 7px;
text-decoration: none;
color: var(--navbar-fg);
transition: color 0.2s ease;
font-family: "DM Sans", sans-serif;
font-size: 1rem;
font-weight: 600;
}
@udaycodespace
udaycodespace self-requested a review August 7, 2026 04:47
@udaycodespace udaycodespace added ECSoC26 Required label for a PR to be eligible for Sentinel scoring good-pr PA-awarded bonus for an exceptionally executed PR — +15 XP good-ui PA-awarded bonus for outstanding UI/UX work — +25 XP redo Reviewed — needs changes before it can be merged and removed frontend fullstack labels Aug 7, 2026
@udaycodespace

Copy link
Copy Markdown
Owner

@sujalv28 Nice work overall! However, there are a few changes that need to be addressed before this PR can be merged:

  1. Please address the Copilot review comments, as they are valid suggestions.
  2. These changes primarily improve the maintainability and accessibility of the code without affecting the existing behavior.

Once these are addressed, this PR should be good to go.

@sujalv28

sujalv28 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Hello @udaycodespace I have checked and resolved the review comments. Can you check and merge it if it solves the issue. Thank You !

@udaycodespace

Copy link
Copy Markdown
Owner

Hello @udaycodespace I have checked and resolved the review comments. Can you check and merge it if it solves the issue. Thank You !

LGTM!

@udaycodespace
udaycodespace merged commit f5c5db5 into udaycodespace:main Aug 7, 2026
2 of 4 checks passed
@ecsoc-sentinel ecsoc-sentinel Bot added the ECSoC26-L1 Easy difficulty, auto-assigned by Sentinel — 5 points label Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ECSoC26-L1 Easy difficulty, auto-assigned by Sentinel — 5 points ECSoC26 Required label for a PR to be eligible for Sentinel scoring frontend fullstack good-pr PA-awarded bonus for an exceptionally executed PR — +15 XP good-ui PA-awarded bonus for outstanding UI/UX work — +25 XP redo Reviewed — needs changes before it can be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Accessibility]: Poor visibility of navbar links and logo

3 participants