From 6b95a95ca6f9e507e072bcc4327198ff7f41c124 Mon Sep 17 00:00:00 2001 From: Per Magnus Petersen Date: Sat, 14 Feb 2026 14:01:34 +0100 Subject: [PATCH] Highlight active tab when switching between Today/Tomorrow Swap the full tab panel on click so the active tab styling updates. Co-Authored-By: Claude Opus 4.6 --- src/clj/pmagnus/elprice/web/routes/ui.clj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/clj/pmagnus/elprice/web/routes/ui.clj b/src/clj/pmagnus/elprice/web/routes/ui.clj index 45dcbd5..3b11dd0 100644 --- a/src/clj/pmagnus/elprice/web/routes/ui.clj +++ b/src/clj/pmagnus/elprice/web/routes/ui.clj @@ -82,12 +82,12 @@ [:div {:class "flex gap-1 mt-4"} [:button {:class (if (= active-tab :today) tab-active tab-inactive) :hx-get "/prices/today" - :hx-target "#price-content" + :hx-target "#price-panel" :hx-swap "innerHTML"} "Today"] [:button {:class (if (= active-tab :tomorrow) tab-active tab-inactive) :hx-get "/prices/tomorrow" - :hx-target "#price-content" + :hx-target "#price-panel" :hx-swap "innerHTML"} "Tomorrow"]]) @@ -120,11 +120,11 @@ (defn prices-today [query-fn request] (fragment - (price-table "Today — DK1" (prices/get-today-prices query-fn)))) + (price-content :today (prices/get-today-prices query-fn)))) (defn prices-tomorrow [query-fn request] (fragment - (price-table "Tomorrow — DK1" (prices/get-tomorrow-prices query-fn)))) + (price-content :tomorrow (prices/get-tomorrow-prices query-fn)))) (defn fetch-prices [query-fn request] (prices/fetch-and-save! query-fn)