Clean up minor ESLint warnings and fix landing page accessibility issues#133
Conversation
…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)
📝 WalkthroughWalkthroughThis 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. ChangesMixed improvements: translation hooks, styling, dependencies, and metadata
🎯 2 (Simple) | ⏱️ ~12 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
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
📒 Files selected for processing (9)
public/robots.txtsrc/App.tsxsrc/components/Essay/EssayAssignmentModal.tsxsrc/components/auth/LoginButtons.tsxsrc/context/AppContext.tsxsrc/pages/Dashboard.tsxsrc/pages/LandingPage.tsxsrc/pages/StudentEssayPage.tsxsrc/pages/StudentPortalPage.tsx
💤 Files with no reviewable changes (2)
- src/context/AppContext.tsx
- src/components/Essay/EssayAssignmentModal.tsx
Summary
i18n.languagedeps fromuseMemocalls (and the now-unusedi18ndestructure) inApp.tsxandStudentPortalPage.tsxdbStatus.userIddependency from auseCallbackinEssayAssignmentModal.tsxeslint-disablecomments inAppContext.tsxandStudentEssayPage.tsxeslint-disable-next-line @typescript-eslint/no-explicit-anyinDashboard.tsxso it actually covers theas anyit was meant to suppresspublic/robots.txtto fix the Lighthouse SEOrobots-txtaudit (previously the SPA'sindex.htmlwas served for/robots.txt)LandingPage's root element in<main>to satisfylandmark-one-main#64748b→#475569,#94a3b8→#64748b/#475569,#cbd5e1→#475569,#6366f1→#4f46e5,#0891b2→#0e7490,#3b82f6→#2563ebinLoginButtons.tsx)The remaining 134 ESLint warnings (mostly
no-explicit-anyin test files, plus a fewreact-hooks/exhaustive-depsmissing-deps andreact-refresh/only-export-componentswarnings) require larger, riskier changes and were intentionally left alone.Test plan
npm run typecheckpassesnpm run lint— 134 warnings (down from 141), 0 errorsrobots-txtfixedSummary by CodeRabbit
Style
Chores