From a60de1fc7a56498ead23e8ed5f5eddc7bd5929af Mon Sep 17 00:00:00 2001 From: Arthur Belleville Date: Mon, 18 May 2026 15:51:23 +0200 Subject: [PATCH] feat(20-02): replace TabloDetailPage stub with templ component + register tab route - Remove stub templ.ComponentFunc from tablo_detail_view.go; real TabloDetailPage now comes from tablo_detail_templ.go - Remove context/io/templ imports that were only used by the stub - Register GET /tablos/{tabloID}/{tab} route in router.go after /tablos/{tabloID} - All handler tests pass: TestGetTabloDetailPage_*, TestTabloDetailKanbanColumns, TestComputeTabloProgress, TestNewTabloDetailViewModel_* --- .../internal/web/views/tablo_detail_view.go | 21 ------------------- go-backend/router.go | 1 + 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/go-backend/internal/web/views/tablo_detail_view.go b/go-backend/internal/web/views/tablo_detail_view.go index 0c1438c..9bb04f9 100644 --- a/go-backend/internal/web/views/tablo_detail_view.go +++ b/go-backend/internal/web/views/tablo_detail_view.go @@ -1,11 +1,8 @@ package views import ( - "context" "fmt" - "io" - "github.com/a-h/templ" tablomodel "xtablo-backend/internal/tablos" taskmodel "xtablo-backend/internal/tasks" ) @@ -176,21 +173,3 @@ func tabloStatusPresentation(status tablomodel.Status) (string, string, int, str } } -// TabloDetailPage is a stub templ component for the tablo detail page. -// It will be replaced with a proper templ component in Plan 02. -// The stub emits the tablo name and initTabloDetailSortable so tests pass. -func TabloDetailPage(vm TabloDetailViewModel) templ.Component { - return templ.ComponentFunc(func(ctx context.Context, w io.Writer) error { - // Emit column status IDs so TestTabloDetailKanbanColumns passes - cols := "" - for _, col := range vm.Columns { - cols += `
` + col.Label + `
` - } - _, err := fmt.Fprintf(w, - `
%s%s
`, - vm.TabloName, - cols, - ) - return err - }) -} diff --git a/go-backend/router.go b/go-backend/router.go index fe64970..663fe58 100644 --- a/go-backend/router.go +++ b/go-backend/router.go @@ -43,6 +43,7 @@ func newRouterWithHandler(authHandler *handlers.AuthHandler) http.Handler { mux.Get("/feedback", authHandler.GetFeedbackPage()) mux.Post("/tablos", authHandler.PostTablos()) mux.Get("/tablos/{tabloID}", authHandler.GetTabloDetailPage()) + mux.Get("/tablos/{tabloID}/{tab}", authHandler.GetTabloDetailTab()) mux.Get("/tablos/{tabloID}/edit", authHandler.GetEditTabloModal()) mux.Post("/tablos/{tabloID}", authHandler.PostTabloUpdate()) mux.Delete("/tablos/{tabloID}", authHandler.DeleteTablo())