From 59f143aecb4f5895d204ff5ada7119b85c206818 Mon Sep 17 00:00:00 2001 From: Arthur Belleville Date: Sun, 17 May 2026 15:27:38 +0200 Subject: [PATCH] feat(18-01): update all handler call sites with per-page breadcrumbs - handlers_tablos.go: TablosListHandler, renderTabloCreateError, TabloDetailHandler, TabloUpdateHandler - handlers_planning.go: PlanningPageHandler - handlers_account.go: AccountProvidersHandler - handlers_discussion.go: TabloDiscussionTabHandler - handlers_files.go: TabloFilesTabHandler, TabloTasksTabHandler - handlers_events.go: TabloEventsTabHandler - go build ./... succeeds, go test ./... passes --- backend/internal/web/handlers_account.go | 5 ++++- backend/internal/web/handlers_discussion.go | 7 +++++- backend/internal/web/handlers_events.go | 7 +++++- backend/internal/web/handlers_files.go | 13 +++++++++-- backend/internal/web/handlers_planning.go | 5 ++++- backend/internal/web/handlers_tablos.go | 24 +++++++++++++++++---- 6 files changed, 51 insertions(+), 10 deletions(-) diff --git a/backend/internal/web/handlers_account.go b/backend/internal/web/handlers_account.go index 18b3c4c..c0e7cb0 100644 --- a/backend/internal/web/handlers_account.go +++ b/backend/internal/web/handlers_account.go @@ -46,6 +46,9 @@ func AccountProvidersHandler(deps AuthDeps) http.HandlerFunc { } w.Header().Set("Content-Type", "text/html; charset=utf-8") - _ = templates.AccountProvidersPage(user, statuses, csrf.Token(r), "/", sidebarTablos).Render(r.Context(), w) + _ = templates.AccountProvidersPage(user, statuses, csrf.Token(r), "/", sidebarTablos, + "Linked Providers", + []templates.BreadcrumbItem{{Label: "Linked Providers", Href: ""}}, + ).Render(r.Context(), w) } } diff --git a/backend/internal/web/handlers_discussion.go b/backend/internal/web/handlers_discussion.go index 062a3ec..c648708 100644 --- a/backend/internal/web/handlers_discussion.go +++ b/backend/internal/web/handlers_discussion.go @@ -75,7 +75,12 @@ func TabloDiscussionTabHandler(deps DiscussionDeps) http.HandlerFunc { if discussionSidebarTablos == nil { discussionSidebarTablos = []sqlc.Tablo{} } - _ = templates.TabloDetailPage(user, csrf.Token(r), "", discussionSidebarTablos, tablo, nil, nil, templates.EtapeTaskCounts{}, templates.EtapeFilter{}, nil, templates.EventsCalendar{}, data, "discussion").Render(r.Context(), w) + _ = templates.TabloDetailPage(user, csrf.Token(r), "", discussionSidebarTablos, tablo, nil, nil, + templates.EtapeTaskCounts{}, templates.EtapeFilter{}, nil, templates.EventsCalendar{}, + data, "discussion", + tablo.Title, + []templates.BreadcrumbItem{{Label: "Dashboard", Href: "/"}, {Label: tablo.Title, Href: ""}}, + ).Render(r.Context(), w) } } diff --git a/backend/internal/web/handlers_events.go b/backend/internal/web/handlers_events.go index 1da6780..71d397c 100644 --- a/backend/internal/web/handlers_events.go +++ b/backend/internal/web/handlers_events.go @@ -174,7 +174,12 @@ func TabloEventsTabHandler(deps EventsDeps) http.HandlerFunc { if eventsSidebarTablos == nil { eventsSidebarTablos = []sqlc.Tablo{} } - _ = templates.TabloDetailPage(user, csrf.Token(r), "", eventsSidebarTablos, tablo, nil, nil, templates.EtapeTaskCounts{}, templates.EtapeFilter{}, nil, calendar, templates.DiscussionTabData{}, "events").Render(r.Context(), w) + _ = templates.TabloDetailPage(user, csrf.Token(r), "", eventsSidebarTablos, tablo, nil, nil, + templates.EtapeTaskCounts{}, templates.EtapeFilter{}, nil, calendar, + templates.DiscussionTabData{}, "events", + tablo.Title, + []templates.BreadcrumbItem{{Label: "Dashboard", Href: "/"}, {Label: tablo.Title, Href: ""}}, + ).Render(r.Context(), w) } } diff --git a/backend/internal/web/handlers_files.go b/backend/internal/web/handlers_files.go index 0477597..fa2ca3c 100644 --- a/backend/internal/web/handlers_files.go +++ b/backend/internal/web/handlers_files.go @@ -103,7 +103,12 @@ func TabloFilesTabHandler(deps FilesDeps) http.HandlerFunc { if filesSidebarTablos == nil { filesSidebarTablos = []sqlc.Tablo{} } - _ = templates.TabloDetailPage(user, csrf.Token(r), "", filesSidebarTablos, tablo, nil, nil, templates.EtapeTaskCounts{}, templates.EtapeFilter{}, fileList, templates.EventsCalendar{}, templates.DiscussionTabData{}, "files").Render(r.Context(), w) + _ = templates.TabloDetailPage(user, csrf.Token(r), "", filesSidebarTablos, tablo, nil, nil, + templates.EtapeTaskCounts{}, templates.EtapeFilter{}, fileList, templates.EventsCalendar{}, + templates.DiscussionTabData{}, "files", + tablo.Title, + []templates.BreadcrumbItem{{Label: "Dashboard", Href: "/"}, {Label: tablo.Title, Href: ""}}, + ).Render(r.Context(), w) } } @@ -135,7 +140,11 @@ func TabloTasksTabHandler(deps FilesDeps) http.HandlerFunc { if tasksSidebarTablos == nil { tasksSidebarTablos = []sqlc.Tablo{} } - _ = templates.TabloDetailPage(user, csrf.Token(r), "", tasksSidebarTablos, tablo, tasks, etapes, counts, filter, nil, templates.EventsCalendar{}, templates.DiscussionTabData{}, "tasks").Render(r.Context(), w) + _ = templates.TabloDetailPage(user, csrf.Token(r), "", tasksSidebarTablos, tablo, tasks, etapes, + counts, filter, nil, templates.EventsCalendar{}, templates.DiscussionTabData{}, "tasks", + tablo.Title, + []templates.BreadcrumbItem{{Label: "Dashboard", Href: "/"}, {Label: tablo.Title, Href: ""}}, + ).Render(r.Context(), w) } } diff --git a/backend/internal/web/handlers_planning.go b/backend/internal/web/handlers_planning.go index 4340ce5..720cb82 100644 --- a/backend/internal/web/handlers_planning.go +++ b/backend/internal/web/handlers_planning.go @@ -65,6 +65,9 @@ func PlanningPageHandler(deps PlanningDeps) http.HandlerFunc { } w.Header().Set("Content-Type", "text/html; charset=utf-8") - _ = templates.PlanningPage(user, csrf.Token(r), "/planning", sidebarTablos, agenda).Render(r.Context(), w) + _ = templates.PlanningPage(user, csrf.Token(r), "/planning", sidebarTablos, agenda, + "Planning", + []templates.BreadcrumbItem{{Label: "Planning", Href: ""}}, + ).Render(r.Context(), w) } } diff --git a/backend/internal/web/handlers_tablos.go b/backend/internal/web/handlers_tablos.go index a60ea46..0e32b20 100644 --- a/backend/internal/web/handlers_tablos.go +++ b/backend/internal/web/handlers_tablos.go @@ -57,7 +57,10 @@ func TablosListHandler(deps TablosDeps) http.HandlerFunc { } w.Header().Set("Content-Type", "text/html; charset=utf-8") - _ = templates.TablosDashboard(user, csrf.Token(r), "/", sidebarTablos, cardViews).Render(r.Context(), w) + _ = templates.TablosDashboard(user, csrf.Token(r), "/", sidebarTablos, cardViews, + "Dashboard", + []templates.BreadcrumbItem{{Label: "Dashboard", Href: ""}}, + ).Render(r.Context(), w) } } @@ -222,7 +225,12 @@ func TabloDetailHandler(deps TablosDeps) http.HandlerFunc { _ = templates.TabloOverviewTabFragment(tablo, csrf.Token(r)).Render(r.Context(), w) return } - _ = templates.TabloDetailPage(user, csrf.Token(r), "", sidebarTablos, tablo, tasks, nil, templates.EtapeTaskCounts{}, templates.EtapeFilter{}, nil, templates.EventsCalendar{}, templates.DiscussionTabData{}, "overview").Render(r.Context(), w) + _ = templates.TabloDetailPage(user, csrf.Token(r), "", sidebarTablos, tablo, tasks, nil, + templates.EtapeTaskCounts{}, templates.EtapeFilter{}, nil, templates.EventsCalendar{}, + templates.DiscussionTabData{}, "overview", + tablo.Title, + []templates.BreadcrumbItem{{Label: "Dashboard", Href: "/"}, {Label: tablo.Title, Href: ""}}, + ).Render(r.Context(), w) } } @@ -335,7 +343,12 @@ func TabloUpdateHandler(deps TablosDeps) http.HandlerFunc { if updateSidebarTablos == nil { updateSidebarTablos = []sqlc.Tablo{} } - _ = templates.TabloDetailPage(user, csrf.Token(r), "", updateSidebarTablos, tablo, tasks, nil, templates.EtapeTaskCounts{}, templates.EtapeFilter{}, nil, templates.EventsCalendar{}, templates.DiscussionTabData{}, "overview").Render(ctx, w) + _ = templates.TabloDetailPage(user, csrf.Token(r), "", updateSidebarTablos, tablo, tasks, nil, + templates.EtapeTaskCounts{}, templates.EtapeFilter{}, nil, templates.EventsCalendar{}, + templates.DiscussionTabData{}, "overview", + tablo.Title, + []templates.BreadcrumbItem{{Label: "Dashboard", Href: "/"}, {Label: tablo.Title, Href: ""}}, + ).Render(ctx, w) return } @@ -462,5 +475,8 @@ func renderTabloCreateError(w http.ResponseWriter, r *http.Request, form templat for _, cv := range errorCardViews { errorSidebarTablos = append(errorSidebarTablos, cv.Tablo) } - _ = templates.TablosDashboard(user, csrf.Token(r), "/", errorSidebarTablos, errorCardViews).Render(r.Context(), w) + _ = templates.TablosDashboard(user, csrf.Token(r), "/", errorSidebarTablos, errorCardViews, + "Dashboard", + []templates.BreadcrumbItem{{Label: "Dashboard", Href: ""}}, + ).Render(r.Context(), w) }