fix(website): comprehensive audit fixes for UX, accessibility, security, and correctness#440
Conversation
…ty, and correctness - Fix StatsBar dialect count: 7 → 8 (ClickHouse was added but count not updated) - Fix CodeExamples import path: github.com/gosqlx/gosqlx → github.com/ajitpratap0/GoSQLX - Fix CSP: add va.vercel-scripts.com to script-src and connect-src for Vercel Analytics - Fix Navbar: extract useTransform calls from JSX render body to component scope (React hooks rule) - Fix global-error.tsx: add lang="en" attribute and dark theme styling to match app theme - Fix duplicate <main> elements: page.tsx and not-found.tsx nested inside layout's <main> - Fix SocialProof: migrate from raw <img> to next/image with remotePatterns config - Fix BenchmarksContent: replace hardcoded button styles with shared Button component - Fix WasmLoader: move progressListeners cleanup to useEffect return for proper unmount handling - Fix accessibility: add aria-hidden to decorative SVGs in LintTab and AnalyzeTab - Add images.remotePatterns for img.shields.io in next.config.ts https://claude.ai/code/session_01XAKeP67mR8sb1MxDPkYhxC
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…scription - Hero GitHubStarButton: add AbortController to abort fetch on unmount, preventing potential state updates on unmounted components - not-found.tsx: add missing description metadata for SEO completeness https://claude.ai/code/session_01XAKeP67mR8sb1MxDPkYhxC
|
Claude finished @ajitpratap0's task —— View job PR Review: Comprehensive Audit Fixes ✅I've completed a thorough review of this PR. The changes demonstrate excellent attention to detail with comprehensive fixes across multiple categories. Here's my assessment: Review Tasks
✅ Security & Best PracticesCSP Security Fix (next.config.ts:32)
React Hooks Compliance (Navbar.tsx:44-47)
Memory Leak Prevention (WasmLoader.tsx:201-203)
✅ Accessibility ImprovementsHTML Semantics (page.tsx, not-found.tsx)
Error Page (global-error.tsx:17-18)
Decorative SVG Icons (AnalyzeTab.tsx:84,156 & LintTab.tsx:84,118,126,159)
✅ Performance & Best PracticesNext.js Image Optimization (SocialProof.tsx:40-49)
Component Consistency (BenchmarksContent.tsx:210-215)
✅ Data CorrectnessStatsBar Dialect Count (StatsBar.tsx:11)
CodeExamples Import Path (CodeExamples.tsx:17,34,51,67)
📋 Code Quality AssessmentOverall Rating: Excellent ⭐⭐⭐⭐⭐
🧪 Test Coverage RecommendationsWhile the changes are low-risk, consider adding:
🚀 Deployment ReadinessThis PR is production-ready:
Recommendation: ✅ Approve and merge |
|
Claude finished @ajitpratap0's task —— View job PR Review: Comprehensive Audit FixesI've completed a thorough review of this PR focusing on code quality, best practices, potential bugs, performance, security, and test coverage. Review Tasks
✅ Security & Content Security Policynext.config.ts (lines 32-33)
✅ React Hooks ComplianceNavbar.tsx (lines 44-47)
WasmLoader.tsx (lines 201-203)
✅ Accessibility Improvementsglobal-error.tsx (lines 17-18)
Duplicate main landmarks
SVG accessibility (AnalyzeTab.tsx lines 84, 156 & LintTab.tsx lines 84, 120, 127, 159)
✅ Data CorrectnessStatsBar.tsx (line 11)
CodeExamples.tsx (lines 17, 34, 51, 67)
✅ Performance & Best PracticesSocialProof.tsx (lines 40-50)
BenchmarksContent.tsx (lines 210-216)
🔍 Code Quality AssessmentStrengths:
No Issues Found:
📋 Test Coverage RecommendationsWhile the changes are low-risk, consider adding these tests for completeness:
🎯 Overall AssessmentThis is an exemplary audit and fix PR. Every change addresses real issues with appropriate solutions:
Recommendation: ✅ Approve and merge The fixes are well-researched, properly implemented, and follow best practices. No breaking changes or regressions are present. |
Summary
Full project and website audit identifying and fixing 11 issues across UX, accessibility, security, performance, and correctness. All changes are scoped to the
website/directory.Fixes
Data Correctness
7 → 8— ClickHouse dialect was added in v1.13.0 but the homepage counter was never updatedgithub.com/gosqlx/gosqlx→github.com/ajitpratap0/GoSQLX— all 4 code example tabs showed the wrong Go import pathSecurity (CSP)
https://va.vercel-scripts.comto bothscript-srcandconnect-srcdirectives — Vercel Analytics scripts were being blocked by the existing CSP policyReact / Hooks Compliance
useTransform()calls from JSXstyleprop into component body — calling hooks inside render expressions violates the Rules of Hooks and can cause unpredictable behaviorprogressListenerscleanup from.finally()touseEffectreturn — ensures cleanup runs on component unmount, not just on promise resolutionHTML Semantics / Accessibility
<main>elements:page.tsxandnot-found.tsxboth wrapped content in<main>whilelayout.tsxalready provides<main id="main-content">— nested landmarks confuse screen readerslang="en"attribute and dark themeclassName— error page rendered with no language tag (WCAG failure) and unstyled white backgroundaria-hidden: Addedaria-hidden="true"to 4 decorative SVG icons inLintTabandAnalyzeTab— screen readers were announcing meaningless icon pathsPerformance / Best Practices
<img>tonext/imagewithunoptimizedflag — enables Next.js image pipeline benefits (lazy loading, sizing attributes) for shield badgesremotePatterns: Addedimg.shields.ioto the allowed remote image patterns fornext/imagebg-indigo-600button styles with the shared<Button>component — ensures consistent styling with the rest of the site (white primary button)Audit Findings Summary
Files Changed (12)
website/next.config.ts— CSP fix + image remote patternswebsite/src/app/page.tsx— Remove duplicate<main>website/src/app/not-found.tsx— Remove duplicate<main>website/src/app/global-error.tsx— Addlang+ dark themewebsite/src/app/benchmarks/BenchmarksContent.tsx— Use shared Buttonwebsite/src/components/home/StatsBar.tsx— Fix dialect countwebsite/src/components/home/CodeExamples.tsx— Fix import pathwebsite/src/components/home/SocialProof.tsx— Use next/imagewebsite/src/components/layout/Navbar.tsx— Fix hooks violationwebsite/src/components/playground/AnalyzeTab.tsx— aria-hiddenwebsite/src/components/playground/LintTab.tsx— aria-hiddenwebsite/src/components/playground/WasmLoader.tsx— Fix memory leakTest plan
https://claude.ai/code/session_01XAKeP67mR8sb1MxDPkYhxC