From 3e2c86904bb4bed2ca5cc2a2fd44aabc979f0b20 Mon Sep 17 00:00:00 2001 From: Arthur Belleville Date: Sun, 17 May 2026 15:25:46 +0200 Subject: [PATCH] feat(18-01): extend AppLayout signature with pageTitle, breadcrumb, headerActions - Add BreadcrumbItem struct to app_layout_helpers.go - Update AppLayout to accept 8 parameters (was 5) - Add minimal breadcrumb/headerActions stubs in layout body --- backend/templates/app_layout.templ | 8 +++++++- backend/templates/app_layout_helpers.go | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/backend/templates/app_layout.templ b/backend/templates/app_layout.templ index 1205d8b..eaaac7b 100644 --- a/backend/templates/app_layout.templ +++ b/backend/templates/app_layout.templ @@ -150,7 +150,7 @@ templ DashboardSidebar(activePath string, tablos []sqlc.Tablo, user *auth.User, // - DashboardSidebar renders nav, projects, and org footer // - main#app-main-content.dashboard-main wraps page children // - Scripts: htmx.min.js, sortable.min.js, discussion-sse.js (per D-L04) -templ AppLayout(title string, user *auth.User, csrfToken string, activePath string, tablos []sqlc.Tablo) { +templ AppLayout(title string, user *auth.User, csrfToken string, activePath string, tablos []sqlc.Tablo, pageTitle string, breadcrumb []BreadcrumbItem, headerActions templ.Component) { @@ -163,6 +163,12 @@ templ AppLayout(title string, user *auth.User, csrfToken string, activePath stri
@DashboardSidebar(activePath, tablos, user, csrfToken)
+ if len(breadcrumb) > 0 { + + } + if headerActions != nil { + @headerActions + } { children... }
diff --git a/backend/templates/app_layout_helpers.go b/backend/templates/app_layout_helpers.go index 87b5da1..3abcb25 100644 --- a/backend/templates/app_layout_helpers.go +++ b/backend/templates/app_layout_helpers.go @@ -2,6 +2,13 @@ package templates import "strings" +// BreadcrumbItem represents one crumb in the top header breadcrumb trail. +// If Href is empty, the item renders as plain text (current page — no link). +type BreadcrumbItem struct { + Label string + Href string +} + // sidebarNavItem describes one entry in the sidebar primary navigation list. type sidebarNavItem struct { Href string