10 KiB
10 KiB
Phase 14: Auth Pages - Context
Gathered: 2026-05-16 Status: Ready for planning
## Phase BoundaryPhase 14 restyles the /login and /signup pages to match the JS app's auth-card layout. The work is:
- Create a dedicated
AuthLayouttemplate (replacingLayoutusage in auth pages) with a gradient background and no navigation header - Port the
AnimatedBackgroundcomponent (35 logo elements + CSS keyframe animations) from go-backend - Copy logo asset files (
logo_dark.png,logo_white.png) fromgo-backend/static/intobackend/static/ - Port the auth card CSS shell and Material Design Google sign-in button CSS from
go-backend/static/styles.cssintobackend/internal/web/ui/auth.css - Update
LoginPageandSignupPageto useAuthLayoutand the new auth card structure - Migrate raw
<input>elements in both auth forms to@ui.Input(ui.InputProps{...}) - Add cross-page navigation links ("Don't have an account? Sign up" / "Already have an account? Sign in")
Phase 14 does NOT restyle the dashboard, sidebar, tablo list, or any other page — those are Phases 15–17.
## Implementation DecisionsAuth Layout
- D-L01: Create
backend/templates/auth_layout.templas a standalone HTML shell — gradient background, no header/footer, centered content.LoginPageandSignupPageswitch from@Layout(...)to@AuthLayout(...). - D-L02:
AuthLayoutbackground uses a CSS gradient built from design tokens (e.g.,--color-brand-primary/--color-surface-page-tintfrombase.css). No image background. - D-L03:
AuthLayouttakes the samecsrfToken stringparam asLayout(needed for the CSRF field in forms). Nouser *auth.Userparam — auth pages are always unauthenticated.
Animated Background
- D-AB01: Port the full
AnimatedBackgroundtempl component fromgo-backend/internal/web/views/auth_components.templ— all 35 logo elements with theirbackground-logo bg-NN animate-*classes. - D-AB02: Copy
logo_dark.pngandlogo_white.pngfromgo-backend/static/intobackend/static/as part of Phase 14. - D-AB03: Port all CSS animation keyframes and
.background-logopositioning rules fromgo-backend/static/styles.cssintobackend/internal/web/ui/auth.css. Do not importgo-backend/static/styles.cssdirectly — extract only the auth-relevant rules. - D-AB04:
AnimatedBackgroundlives inbackend/templates/(not inbackend/internal/web/ui/) since it references static assets and is page-level, not a reusable UI primitive.
Auth Card Shell
- D-AC01: Port
.auth-card-shell,.auth-card-topbar,.title-group,.auth-bodyCSS fromgo-backend/static/styles.cssintobackend/internal/web/ui/auth.css(replacing existing minimal auth.css). - D-AC02: The auth card shows the brand logo (
<img src="/static/logo_dark.png">) above the form title. Use the same structure as go-backend'stitle-group. - D-AC03:
--shadow-auth-card: 0 20px 45px rgba(0, 0, 0, 0.1)is already defined inbase.css— the card shell CSS uses this token directly.
Google Sign-in Button
- D-G01: Port
.gsi-material-buttonand all its sub-class CSS rules fromgo-backend/static/styles.cssintobackend/internal/web/ui/auth.css. - D-G02: The
GoogleButtontempl (SVG icon + "Continuer avec Google" text) is already rendered viaAuthProviderButtonControl→<a class="auth-provider-button" ...>. In Phase 14, update the class togsi-material-buttonand add the icon + content wrapper structure matching go-backend'sGoogleButtontempl exactly. - D-G03: Button label: use "Sign in with Google" (English, matching backend convention) rather than the French label in go-backend.
Form Inputs
- D-FI01: Replace raw
<input type="email">and<input type="password">inLoginFormFragmentandSignupFormFragmentwith@ui.Input(ui.InputProps{...}). PassID,Name,Type,Placeholder,Value,Required,Autocompletefields. - D-FI02: Form labels use the
@ui.FormField(ui.FormFieldProps{...})wrapper to get consistent label + input + error layout. - D-FI03: Error display (
@FieldError(errs.Email)) is preserved — wire errors throughFormFieldProps.Error.
Navigation Links
- D-NL01: Add "Don't have an account? Sign up →" link below the login form (pointing to
/signup). - D-NL02: Add "Already have an account? Sign in →" link below the signup form (pointing to
/login). - D-NL03: Style matches go-backend's
.signup-copy/.signup-linkpattern — small text, brand-colored link. Port these CSS rules intoauth.css.
Claude's Discretion
- Exact gradient values for
AuthLayoutbackground (use--color-brand-primaryand related tokens as anchors; exact stops are Claude's call) - Order of elements within the auth card (logo → title → Google button → divider → form → nav link, following go-backend structure)
- Whether
AnimatedBackgroundis its own templ component called fromAuthLayout, or inlined — prefer a separate component for readability
<canonical_refs>
Canonical References
Downstream agents MUST read these before planning or implementing.
Product Scope
.planning/ROADMAP.md— Phase 14 goal, success criteria (5 criteria), and requirements AUTH-UI-01..03.planning/REQUIREMENTS.md— AUTH-UI-01 (login layout), AUTH-UI-02 (signup layout), AUTH-UI-03 (Google button).planning/PROJECT.md— v3.0 scope: visual polish only, go-backend is the visual reference
Reference Implementation (source of truth)
go-backend/internal/web/views/auth_components.templ—AnimatedBackground(35 elements),AuthScreen,GoogleButton,AuthDivider,AuthScreenFooter— port structure from herego-backend/static/styles.css— ALL auth CSS:.auth-card-shell,.auth-card-topbar,.title-group,.auth-body,.background-logo, allanimate-*keyframes,.gsi-material-button,.signup-copy,.signup-link— extract auth-relevant sections onlygo-backend/static/logo_dark.png— logo asset to copy intobackend/static/go-backend/static/logo_white.png— logo asset to copy intobackend/static/
Current Backend (files being changed)
backend/templates/auth_login.templ— current login page; being refactored to use AuthLayout + ui.Input + ui.FormFieldbackend/templates/auth_signup.templ— current signup page; same refactorbackend/templates/layout.templ— NOT changed; auth pages will stop calling @Layout()backend/internal/web/ui/auth.css— current minimal auth CSS; being replaced with full auth card + animation CSSbackend/tailwind.input.css— may need auth.css re-import if auth.css path changes
Design System (Phase 13 output — use these components)
backend/internal/web/ui/input.templ—@ui.Input(ui.InputProps{...})for form fieldsbackend/internal/web/ui/form_field.templ—@ui.FormField(ui.FormFieldProps{...})for label + input + errorbackend/internal/web/ui/button.templ—@ui.Button(...)for submit button (already used)backend/internal/web/ui/base.css— token reference:--color-brand-primary,--shadow-auth-card,--color-surface-page-tint,--color-focus-ring
</canonical_refs>
<code_context>
Existing Code Insights
Reusable Assets
@ui.Input(ui.InputProps{})— ready to use; replaces raw<input>in auth forms. SupportsID,Name,Type,Placeholder,Value,Required,Autocompletefields.@ui.FormField(ui.FormFieldProps{})— wraps label + input + error; replaces the current manual<div><label>...<input>...@FieldError</div>pattern.@ui.Button(ui.ButtonProps{})— already used for submit buttons; keep as-is.ui.CSRFField(csrfToken)— must be preserved in both forms.@GeneralError(errs.General)— keep at top of forms for general error display.
Established Patterns
AuthProviderButtonsBlock/AuthProviderButtonControl— existing templ components for the Google button block; the CSS class and internal structure need updating togsi-material-button, but the Go-level props and handler logic stay the same.- HTMX swap pattern:
hx-post="/login" hx-target="#login-form" hx-swap="outerHTML"— preserve exactly; Phase 14 is visual only, no HTMX behavior changes. @FieldError(errs.X)— existing error display helper; wire through FormField's Error field rather than calling directly.
Integration Points
AuthLayoutneeds to importtailwind.cssandhtmx.min.js(same asLayout) — auth pages are HTMX-driven.AnimatedBackgroundreferences/static/logo_dark.png— the file must exist inbackend/static/before the template compiles and renders.auth.cssis already imported inbackend/tailwind.input.css; path stays the same so no import change needed.- Handler code in
backend/internal/web/handlers_auth.go(or equivalent) callstemplates.LoginPage(...)andtemplates.SignupPage(...)— signatures must remain compatible.AuthLayoutis an internal template detail; handlers don't change.
</code_context>
## Specific Ideas- Animated background: exactly 35 logo elements as in go-backend's
AnimatedBackground— no pruning. The dancing logo icons are the intended visual effect. - Google button: uses the full
gsi-material-buttonstructure (state layer + content wrapper + icon SVG + text span) matching go-backend'sGoogleButtontempl, not the simpler link-styled button currently in use. - Cross-page links: "Don't have an account? Sign up" on login; "Already have an account? Sign in" on signup. Positioned below the form, centered, small text with brand-colored link.
- Auth card: logo image above heading (same as go-backend
title-group), not just text.
- Dark mode logo swap (
light-only/dark-onlyclasses from go-backend) — go-backend showslogo_dark.pngfor light andlogo_white.pngfor dark. Dark mode is a Future requirement (DARK-01). Phase 14 useslogo_dark.pngonly. - "Forgot password?" link — go-backend login form has a reset-password row. No password reset flow exists in backend yet; defer to a future phase.
- Responsive/mobile layout for auth pages — Future requirement (RESP-01..03).
Phase: 14-Auth Pages Context gathered: 2026-05-16