From 61dfe126e8a1b2ec1535b77d8094dd8b4250e3ca Mon Sep 17 00:00:00 2001 From: tegwick Date: Sun, 3 May 2026 01:20:45 +0200 Subject: [PATCH] feat(ui): nav spacing + conditional sign-in/sign-out Split public links (About, Tutorial, Extend) and auth into two groups with 2rem gap between them and the separator. Uses inline style gap to avoid Tailwind CSS bundle gaps. Auth link is now session-aware: shows "Sign out" (POST form with DELETE override) when logged in, "Sign in" (href to NewSessionAction) when not. Implemented via currentUserOrNothing @User in the layout. Co-Authored-By: Claude Sonnet 4.6 --- Web/FrontController.hs | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/Web/FrontController.hs b/Web/FrontController.hs index 0951be5..06fe40f 100644 --- a/Web/FrontController.hs +++ b/Web/FrontController.hs @@ -147,7 +147,19 @@ instance InitControllerContext WebApplication where initAuthentication @User defaultLayout :: (?context :: ControllerContext, ?request :: Request) => Layout -defaultLayout inner = [hsx| +defaultLayout inner = + let authWidget :: Html + authWidget = case currentUserOrNothing @User of + Just _ -> [hsx| +
+ + +
+ |] + Nothing -> [hsx| + Sign in + |] + in [hsx| @@ -163,15 +175,14 @@ defaultLayout inner = [hsx|