Skip to content

Clean up minor ESLint warnings and fix landing page accessibility issues#133

Merged
NesiciCoding merged 1 commit into
mainfrom
chore/lint-cleanup-and-landing-a11y
Jun 12, 2026
Merged

Clean up minor ESLint warnings and fix landing page accessibility issues#133
NesiciCoding merged 1 commit into
mainfrom
chore/lint-cleanup-and-landing-a11y

Conversation

@NesiciCoding

@NesiciCoding NesiciCoding commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fixed 7 of 141 ESLint warnings that were trivial cleanups (no behavior change):
    • Removed unnecessary i18n.language deps from useMemo calls (and the now-unused i18n destructure) in App.tsx and StudentPortalPage.tsx
    • Removed an unused dbStatus.userId dependency from a useCallback in EssayAssignmentModal.tsx
    • Removed stale/unused eslint-disable comments in AppContext.tsx and StudentEssayPage.tsx
    • Moved a misplaced eslint-disable-next-line @typescript-eslint/no-explicit-any in Dashboard.tsx so it actually covers the as any it was meant to suppress
  • Added public/robots.txt to fix the Lighthouse SEO robots-txt audit (previously the SPA's index.html was served for /robots.txt)
  • Fixed all Lighthouse accessibility findings on the landing page (score 88 → 100):
    • Wrapped LandingPage's root element in <main> to satisfy landmark-one-main
    • Darkened several text/icon/badge colors that fell short of WCAG AA 4.5:1 contrast (#64748b#475569, #94a3b8#64748b/#475569, #cbd5e1#475569, #6366f1#4f46e5, #0891b2#0e7490, #3b82f6#2563eb in LoginButtons.tsx)

The remaining 134 ESLint warnings (mostly no-explicit-any in test files, plus a few react-hooks/exhaustive-deps missing-deps and react-refresh/only-export-components warnings) require larger, riskier changes and were intentionally left alone.

Test plan

  • npm run typecheck passes
  • npm run lint — 134 warnings (down from 141), 0 errors
  • Targeted Vitest suites for touched files pass (AppContext, StudentEssayPage, pages smoke/a11y)
  • Production build + Lighthouse on the landing page: Accessibility 88 → 100, SEO robots-txt fixed
  • Visually verified the landing page in the browser preview — badges, offline notice, and footer text render correctly with the new colors

Summary by CodeRabbit

  • Style

    • Updated color palette across the landing page for improved visual consistency
    • Refined Azure AD login button styling
    • Enhanced semantic markup on landing page
  • Chores

    • Added search engine crawling rules configuration
    • Refactored translation dependency handling for improved optimization
    • Code cleanup and linting improvements

…sues

- Remove unnecessary effect deps and unused eslint-disable directives
  flagged by react-hooks/exhaustive-deps and eslint-comments
- Add public/robots.txt to fix Lighthouse SEO robots-txt audit
- Wrap LandingPage in a <main> landmark and darken several text/badge
  colors that fell short of WCAG AA contrast (Lighthouse a11y 88 -> 100)
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR consolidates multiple improvements: translation hooks are simplified to depend on the translation function rather than explicit language changes across App and StudentPortalPage, the LandingPage color palette is refreshed with updated grays and the root element becomes semantic HTML, callback dependencies in EssayAssignmentModal are adjusted for Supabase configuration changes, various ESLint comments are cleaned up, and robots.txt is added for SEO.

Changes

Mixed improvements: translation hooks, styling, dependencies, and metadata

Layer / File(s) Summary
Translation hook refactoring
src/App.tsx, src/pages/StudentPortalPage.tsx
useTranslation now extracts only t, and tutorial step memos depend on translation function changes instead of explicit i18n.language tracking.
Landing page styling refresh and semantic HTML
src/pages/LandingPage.tsx, src/components/auth/LoginButtons.tsx
LandingPage root becomes <main>, and multiple inline color values are updated across hero text, login cards, feature groups, and config sections. Azure AD button subtitle color in LoginButtons is also updated to match the new palette.
Dependency and linting adjustments
src/components/Essay/EssayAssignmentModal.tsx, src/context/AppContext.tsx, src/pages/Dashboard.tsx, src/pages/StudentEssayPage.tsx
EssayAssignmentModal callback now depends on Supabase config instead of userId. ESLint suppression comments are removed from three files with no behavior change.
SEO crawling rules
public/robots.txt
Global robots rules are added allowing all user agents to access the root path.

🎯 2 (Simple) | ⏱️ ~12 minutes

🐰 A rabbit hops through changes so neat,
Translation hooks and colors sweet,
With SEO rules and cleanup too,
The codebase bounces bright and new! 🌟

🚥 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 summarizes the two main objectives of the PR: cleaning up ESLint warnings and fixing landing page accessibility issues.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/lint-cleanup-and-landing-a11y

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

@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 61.26% (🎯 52%) 3556 / 5804
🔵 Statements 59.8% (🎯 51%) 4027 / 6733
🔵 Functions 50.32% (🎯 42%) 1226 / 2436
🔵 Branches 52.93% (🎯 43%) 3071 / 5802
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/components/auth/LoginButtons.tsx 100% 100% 100% 100%
src/context/AppContext.tsx 63.36% 46.25% 58.46% 65.86% 112, 159-171, 200-216, 266, 304, 307, 319, 322, 355, 397, 405, 418, 425-431, 449, 598-613, 679-680, 690-758, 765-771, 787-812, 825-851, 905-906, 921, 949, 1063, 1077-1093, 1100, 1104, 1108-1112, 1118, 1123-1128, 1134, 1137, 1139, 1143, 1147, 1150, 1151, 1153, 1156, 1160-1161, 1165-1166, 1171-1173, 1179, 1183, 1187, 1191-1193, 1199-1213, 1224, 1226, 1229, 1232, 1235, 1236, 1238, 1242, 1247-1257, 1360
src/pages/Dashboard.tsx 67.59% 50.68% 58.53% 73.62% 24, 25, 26, 89, 99, 112, 114, 130, 138-145, 157-264, 312, 319-338, 380-486
src/pages/LandingPage.tsx 69.69% 82.75% 84.61% 68.75% 97-104, 260, 289
src/pages/StudentPortalPage.tsx 48.38% 28.84% 40.81% 49% 54, 63-64, 77, 81, 126-131, 135-146, 149, 176-192, 196, 198, 199-204, 323-388, 398, 400-442, 512-743
Generated in workflow #423 for commit d3a06db by the Vitest Coverage Report Action

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/auth/LoginButtons.tsx`:
- Around line 165-167: The Azure subtitle "(school / work)" in the LoginButtons
component is hardcoded; update LoginButtons.tsx to use the useTranslation hook
(import { useTranslation } from 'react-i18next' and call const { t } =
useTranslation()) and replace the literal with t('auth.microsoft_subtitle') (or
another similar key you add) so the string comes from src/locales/en.json; then
add the corresponding "auth.microsoft_subtitle": "school / work" entry to
en.json so the text is localized.

In `@src/pages/LandingPage.tsx`:
- Around line 182-183: In LandingPage.tsx, replace hardcoded hex color values
used in inline style props (e.g., color: '`#475569`', backgroundColor: '`#4f46e5`',
borderColor: '`#0e7490`', etc.) with the global CSS custom properties (e.g., use
var(--text), var(--accent), var(--bg-elevated), var(--bg-panel) as appropriate);
search for inline style objects inside the LandingPage component where keys like
color, backgroundColor, borderColor, and boxShadow are set and swap the hex
literals for the corresponding var(...) tokens so styles follow the app-wide
theming convention.
- Around line 309-312: The labels "For teachers" and "For students" in the
FeatureGroup usage should be replaced with translation keys via the
useTranslation hook; update LandingPage.tsx to import and call useTranslation(),
replace the hardcoded label props for FeatureGroup (the instances using
TEACHER_FEATURES and STUDENT_FEATURES) with t('...') using new keys added to
src/locales/en.json (e.g., "landing.forTeachers" and "landing.forStudents"), and
ensure the new keys and English values are added to the locales file so the UI
reads localized strings instead of hardcoded English.
🪄 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: ASSERTIVE

Plan: Pro Plus

Run ID: 82d58533-3ef3-4479-91aa-63ce8244d824

📥 Commits

Reviewing files that changed from the base of the PR and between 2f01d98 and d3a06db.

📒 Files selected for processing (9)
  • public/robots.txt
  • src/App.tsx
  • src/components/Essay/EssayAssignmentModal.tsx
  • src/components/auth/LoginButtons.tsx
  • src/context/AppContext.tsx
  • src/pages/Dashboard.tsx
  • src/pages/LandingPage.tsx
  • src/pages/StudentEssayPage.tsx
  • src/pages/StudentPortalPage.tsx
💤 Files with no reviewable changes (2)
  • src/context/AppContext.tsx
  • src/components/Essay/EssayAssignmentModal.tsx

Comment thread src/components/auth/LoginButtons.tsx
Comment thread src/pages/LandingPage.tsx
Comment thread src/pages/LandingPage.tsx
@NesiciCoding NesiciCoding merged commit 8946c1a into main Jun 12, 2026
8 checks passed
@NesiciCoding NesiciCoding deleted the chore/lint-cleanup-and-landing-a11y branch June 12, 2026 12:45
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.

1 participant