From 7348781b89178589036620b33f3554b2e7271c5f Mon Sep 17 00:00:00 2001
From: Ariel Costas Guerrero <ariel@costas.dev>
Date: Fri, 30 Jan 2026 19:29:55 +0100
Subject: feat: Enhance header and app shell with back navigation and dynamic
 title support

---
 src/frontend/app/routes/planner.tsx | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

(limited to 'src/frontend/app/routes/planner.tsx')

diff --git a/src/frontend/app/routes/planner.tsx b/src/frontend/app/routes/planner.tsx
index 32c37c0..1f64590 100644
--- a/src/frontend/app/routes/planner.tsx
+++ b/src/frontend/app/routes/planner.tsx
@@ -11,7 +11,7 @@ import LineIcon from "~/components/LineIcon";
 import { PlannerOverlay } from "~/components/PlannerOverlay";
 import { AppMap } from "~/components/shared/AppMap";
 import { APP_CONSTANTS } from "~/config/constants";
-import { usePageTitle } from "~/contexts/PageTitleContext";
+import { useBackButton, usePageTitle } from "~/contexts/PageTitleContext";
 import { type Itinerary } from "~/data/PlannerApi";
 import { usePlanner } from "~/hooks/usePlanner";
 import "../tailwind-full.css";
@@ -185,6 +185,7 @@ const ItineraryDetail = ({
   onClose: () => void;
 }) => {
   const { t } = useTranslation();
+  useBackButton({ onBack: onClose });
   const mapRef = useRef<MapRef>(null);
   const { destination: userDestination } = usePlanner();
   const [nextArrivals, setNextArrivals] = useState<
@@ -319,7 +320,8 @@ const ItineraryDetail = ({
               );
 
               if (resp.ok) {
-                arrivalsByStop[stopKey] = await resp.json() satisfies ConsolidatedCirculation[];
+                arrivalsByStop[stopKey] =
+                  (await resp.json()) satisfies ConsolidatedCirculation[];
               }
             } catch (err) {
               console.warn(
@@ -463,13 +465,6 @@ const ItineraryDetail = ({
             />
           </Source>
         </AppMap>
-
-        <button
-          onClick={onClose}
-          className="absolute top-4 left-4 bg-white dark:bg-slate-800 p-2 px-4 rounded-lg shadow-lg z-10 font-semibold text-sm hover:bg-slate-50 dark:hover:bg-slate-700 transition-colors"
-        >
-          {t("planner.back")}
-        </button>
       </div>
 
       {/* Details Panel */}
-- 
cgit v1.3

