Skip to content

refactor: address remaining accessibility, contrast, type safety, dead code, and UX enhancementsΒ #710

Description

@TarunyaProgrammer

Summary

This issue tracks the resolution of all remaining lower-priority and style-related findings (🟠/🟑/πŸ’‘) from the application audit. Resolving these concerns ensures fully semantic HTML structure and ARIA keyboard support, improves color contrast to pass WCAG AA standards, removes redundant/dead code and duplicate functions, hardens type safety across Angular/NestJS, and cleans up several UX inconsistencies.


1. Accessibility (a11y) Improvements (Frontend)

  • Semantic Anchors in Sidebar Menu: Refactor <div role="link"> in navbar.component.html to use standard <a> elements with [routerLink] so right-click actions and browser link affordances work correctly.
  • Semantic Nav Landmarks: Change the desktop main sidebar div.navbar to a <nav aria-label="Main Navigation"> landmark to eliminate duplicate landmark confusion.
  • Remove Redundant Bottom Nav Attributes: Clean up mobile bottom nav items to remove redundant role="link" on <a> tags and use standard [routerLink] routing.
  • Overlay Div Space Key: Add (keydown.space) alongside the existing enter key listener on the side menu overlay in navbar.component.html for standard button keyboard semantics.
  • Hero Search Trigger Role: Add role="button" and aria-label="Search projects" to the search trigger div on the homepage.component.html.
  • Aria-Hidden Unicode Arrows: Wrap the β†’ character inside links on the homepage with <span aria-hidden="true">β†’</span> to prevent screen readers from announcing it.

2. Contrast & Visual Enhancements (Frontend)

  • Darken --text-muted in Light Mode: Change --text-muted in styles.scss from #94A3B8 to #6B7280 to pass WCAG AA contrast (4.5:1).
  • Darken --text-secondary in Light Mode: Darken --text-secondary from #5B6470 to #4B5563 to ensure it passes WCAG AA on the off-white #F7F7F2 background.
  • Correct Dark Mode --profile-github-bg: The --success color (#00C16A) used as the GitHub profile badge background fails contrast checks with white text in dark mode. We will replace it with a darker green (#059669) in dark mode.
  • Fix SVG Accent Stroke Contrast: Change the hand-drawn SVG arrow stroke in homepage.component.html from var(--accent-lime) to a readable color in light mode.
  • Fix Dark Mode --card-dark-2 Value: --card-dark-2 is currently set to #dcdcdc (a light gray) inside the dark theme ruleset. We will correct this to a dark slate background (#1E293B).

3. Redundant & Dead Code Cleanups

  • Delete Unused CommmonUtilService: Remove commmon-util.service.ts completely (it only hosts unused global mutable states).
  • Clean Up Unused Injections in ProjectsComponent: Remove unused http and toastr injections from projects.component.ts.
  • Remove Redundant RouterModule Import: Remove RouterModule from standalone standalone imports in app.component.ts (as RouterOutlet is already imported).
  • Remove Unused errorInterceptor Alias: Remove the dead alias re-export in error.interceptor.ts.
  • Dynamic Year Determination: Replace hardcoded currentYear = 2026 defaults with dynamic new Date().getFullYear() across the navbar and dashboards.
  • Consolidate extractCookie Helper: Move the three duplicate private implementations of extractCookie from backend files into the centralized cookie-helper.ts utility.

4. Architectural & Type Safety Hardening

  • Clean Up Admin Component HTTP Subscriptions: Implement takeUntilDestroyed(this.destroyRef) on admin component API subscriptions to prevent leaks.
  • Enforce Strict Types on Admin Dashboard Data: Define proper TypeScript interfaces for dashboardData, audit logs, and ideaForm instead of relying on any.
  • Type DTO Parameters in GSoC Service: Type the inputs for createIdea and updateIdea in gsoc.service.ts.
  • Type GitHub API Repositories: Declare and use a concrete GithubRepo type for repository arrays inside the backend project.service.ts.

5. UX & Logic Enhancements

  • Show Spinner During Admin Auth Checks: Show a loading state in admin.component.ts during session verification instead of briefly flashing the login form.
  • Fix Unused Card Component for Empty State: Replace the dummy <app-projects-card> empty state on the projects page with a clean message container.
  • Switch Projects Search to Two-Way Binding: Refactor projects page search input to use [(ngModel)]="searchTerm" for seamless synchronization.
  • Refactor toggleMode Double Negation: Clean up the double negation assignment to isSunVisible inside admin components.
  • Hide Pagination on Single Pages: Add @if (totalPages > 1) checks to pagination controls on projects and contributors views.
  • Add Login Input Password Hint: Add autocomplete="current-password" to the admin login form password input.
  • Add Missing Head Metadata: Add type="application/manifest+json" and og:image tags to index.html.
  • Backend Cache Size Limit: Add a capacity ceiling and scheduled cleanup sweep to the server CacheService to prevent unbounded memory growth.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions