Comprehensive site audit + new portfolio entries#9
Conversation
Critical fixes: - Fix proxy.ts: rename exported function to `proxy` (Next.js 16 convention) so i18n locale detection, www-redirect, and Accept-Language routing actually work - Remove `unsafe-eval` from CSP script-src (was shipping to production) - Fix root layout to import globals.css so error/not-found pages get styles - Fix error.tsx to use Link component and link to /en instead of / Performance: - Delete unused FloatingLines.tsx (540 lines) and remove three.js (~150KB saved) - Remove 6 unused dependencies (lucide-react, class-variance-authority, clsx, tailwind-merge, shadcn, tw-animate-css) and dead code (lib/utils.ts, components.json) - Lazy-load Galaxy component with next/dynamic (defer OGL from main bundle) - Fix Galaxy useEffect dependency instability (array props caused WebGL context teardown on every render) - Add DPI-aware rendering (devicePixelRatio capped at 2x) - Remove ~120 lines of unused shadcn CSS variables and fix triple body style conflict - Compress public assets: og-image 803KB->247KB, manifest-512 457KB->281KB, manifest-192 77KB->55KB, apple-touch-icon 67KB->48KB - Optimize Google Fonts: only load weights 400/500/600 (was loading 300-700) Security: - Add object-src 'none', upgrade-insecure-requests, Cross-Origin-Opener-Policy - Remove overly permissive *.cloudinary.com wildcard from CSP img-src - Expand Permissions-Policy (payment, usb, magnetometer, gyroscope, etc.) - Add HSTS preload directive, increase max-age to 2 years - Set poweredByHeader: false, reactStrictMode: true SEO: - Add SkyShield, bonuz Next Layer to structured data (were in UI but missing) - Add operatingSystem and offers to all SoftwareApplication entries - Add OpenGraph alternateLocale for multi-language social sharing - Fix html lang="zh" -> "zh-Hans" per BCP 47 - Fix sitemap lastModified to use fixed date instead of runtime new Date() - Fix appleWebApp title to use consistent site name Accessibility: - Add prefers-reduced-motion support to Galaxy (renders static frame) - Add aria-hidden="true" to decorative Galaxy canvases and SVG icons - Add keyboard support: Escape closes mobile menu and language switcher - Add ARIA roles (menu/menuitem, listbox/option) to dropdowns - Add :focus-visible styles for all interactive elements - Add aria-label to founder section social links - Improve footer link contrast (text-gray-500 -> text-gray-400) Code quality: - Add explicit "use client" to Galaxy.tsx and SpotlightCard.tsx - Refactor HomePage: 12 copy-pasted SpotlightCard blocks -> data-driven .map() - Extract Galaxy props to shared const (was duplicated across 2 instances) - Add isLocale type guard to eliminate repeated `as Locale` casts - Hoist currentYear to module scope https://claude.ai/code/session_014VsDh9GGvKR92QoNQBoYa6
- Add bonuz Swapz (cross-chain token swap) as new portfolio entry with translations in all 4 languages (en, ar, de, zh) and structured data - Improve bonuz Events description to emphasize the human layer integration, Dashboard connection, and ecosystem unity - Add swapz to Dictionary type, workItems array, and JSON-LD schema https://claude.ai/code/session_014VsDh9GGvKR92QoNQBoYa6
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Review — Comprehensive site audit + new portfolio entriesThis is a high-quality, well-scoped PR. The net reduction of ~2,500 lines while adding real functionality is impressive. A few observations below, roughly in priority order. Bugs / Correctness
// Before
export default function GlobalError({ error, reset }: { error: Error & { digest?: string }; reset: () => void })
// After
export default function GlobalError({ reset }: { ... })The
// Before: readable
title: "الصفحة غير موجودة",
// After: not readable
title: "\u0627\u0644\u0635\u0641\u062D\u0629 \u063A\u064A\u0631 \u0645\u0648\u062C\u0648\u062F\u0629",Both compile identically, but the escape form is a maintenance hazard. Please revert to literals. (This likely happened due to a formatter/editor converting them — check Minor Issues
lastModified: "2026-04-10",Hardcoding today's date avoids noisy sitemap diffs, which is a valid trade-off. But this needs to be updated whenever content actually changes, otherwise search engines will see a stale timestamp indefinitely. A code comment explaining the convention would help future contributors know to update it.
<div role="listbox" aria-label="Select language">
<button role="option" aria-selected={l === locale}>
const dpr = Math.min(window.devicePixelRatio, 2);
// used in resize():
renderer.setSize(ctn.offsetWidth * dpr, ctn.offsetHeight * dpr);
{ key: "Cross-Origin-Opener-Policy", value: "same-origin" }
What's Done Well
Overall this is a solid, production-ready PR. The proxy concern is the one item worth confirming before merge. The ARIA listbox issue is worth addressing before or shortly after merge. |
Summary
Full audit and optimization of the bounz-tech portfolio site, plus two new/updated portfolio entries.
Net: -3,073 lines removed, +553 added. ~150KB JS + ~700KB images saved.
Critical Fixes
unsafe-evalfrom CSP — was shipping to production, opening XSS attack surfacePerformance
three.js(~150KB JS saved)next/dynamic— OGL deferred from initial bundleSecurity Hardening
object-src 'none',upgrade-insecure-requests, remove*.cloudinary.comwildcardpreloadCross-Origin-Opener-Policy: same-originPermissions-Policy(payment, usb, display-capture, etc.)poweredByHeader: false,reactStrictMode: trueSEO
operatingSystemandoffersto all SoftwareApplication entriesalternateLocalefor multi-language social sharinglang="zh"→lang="zh-Hans"per BCP 47lastModified(wasnew Date()on every build)Accessibility
prefers-reduced-motionsupport in Galaxy (renders static frame instead of animating)menu/menuitem,listbox/option) on dropdownsaria-hidden="true"on decorative Galaxy canvases and SVG icons:focus-visiblestyles for all interactive elementstext-gray-400instead oftext-gray-500)Code Quality
"use client"to Galaxy.tsx and SpotlightCard.tsx.map()isLocaletype guard to eliminate repeatedas LocalecastsNew Portfolio Entries
Test plan
/en,/ar,/de,/zh/→ redirects to detected locale)https://claude.ai/code/session_014VsDh9GGvKR92QoNQBoYa6