From 6b50eba05fdadb50593bc7ba3ae8e2cc8d15a8ed Mon Sep 17 00:00:00 2001 From: Stefan Date: Thu, 27 Nov 2025 12:40:21 +0100 Subject: [PATCH] feat: Add back button and simplify navigation on analysis page - Import ArrowLeft icon and useRouter from Next.js - Add back button below header that navigates to home (/) - Simplify Previous/Next buttons to show only chevron icons - Remove text labels from navigation buttons for cleaner UI - Add aria-labels for accessibility - Consistent with play page navigation pattern --- src/app/analysis/page.tsx | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/app/analysis/page.tsx b/src/app/analysis/page.tsx index 58f65f4..b16f947 100644 --- a/src/app/analysis/page.tsx +++ b/src/app/analysis/page.tsx @@ -3,7 +3,8 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { Chess } from "chess.js"; import { Chessboard } from "react-chessboard"; -import { Brain, ChevronLeft, ChevronRight, Loader2 } from "lucide-react"; +import { Brain, ChevronLeft, ChevronRight, Loader2, ArrowLeft } from "lucide-react"; +import { useRouter } from "next/navigation"; import Header from "@/components/Header"; import { SupportedLanguage } from "@/lib/i18n/translations"; @@ -37,6 +38,7 @@ interface StepDetails { const DEFAULT_START = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"; export default function AnalysisPage() { + const router = useRouter(); const [language, setLanguage] = useState("en"); const [apiKey, setApiKey] = useState(null); const t = useTranslation(language); @@ -319,6 +321,21 @@ INSTRUCTIONS: return (
+ + {/* Back Button */} +
+
+ +
+
+
@@ -395,20 +412,22 @@ INSTRUCTIONS:
{t.analysis.step} {currentIndex} / {steps.length}