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
This commit is contained in:
Arthur Belleville 2026-05-17 15:25:46 +02:00
parent bc2cde8fa3
commit 3e2c86904b
No known key found for this signature in database
2 changed files with 14 additions and 1 deletions

View file

@ -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) {
<!DOCTYPE html>
<html lang="en">
<head>
@ -163,6 +163,12 @@ templ AppLayout(title string, user *auth.User, csrfToken string, activePath stri
<div class="dashboard-shell">
@DashboardSidebar(activePath, tablos, user, csrfToken)
<main id="app-main-content" class="dashboard-main">
if len(breadcrumb) > 0 {
<!-- breadcrumb: Plan 03 will render this properly -->
}
if headerActions != nil {
@headerActions
}
{ children... }
</main>
</div>

View file

@ -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