---
id: w1/m21/t004
title: Dashboard static-site UI (create, publishPath, redirects/rewrites, headers)
worker: worker1
status: done
estimate: 60m
depends_on: [w1/m21/t003]
---

## Objective

Let a user create and manage a static site from the dashboard: choose the `static_site` type at create, set `publishPath` + build command, and edit redirects/rewrites and custom headers. Mirror Render's static-site UI.

## Context

- `dashboard/` — TanStack Start + Apollo + shadcn; read `dashboard/CLAUDE.md` first.
- Consumes the GraphQL surface from t003; no direct k8s access.

## Steps

1. Add `static_site` to the create-service flow with `publishPath` + build command fields.
2. Add a Redirects/Rewrites editor and a Headers editor on the static-site detail page.
3. Wire read/write via GraphQL; validate ordering + path patterns client-side.

## Files

- `dashboard/…` (create flow + static-site detail + GraphQL operations)

## Acceptance criteria

- [ ] A static site can be created and its routes/headers edited from the UI, persisted via GraphQL.
- [ ] Layout mirrors Render's static-site settings.

## Out of scope

- Backend/mechanism (t001–t003).
- Create-via-dashboard: the `/services/new` wizard exists (w5/m15) but does not yet offer the `static_site` type — a follow-up. This task delivers the static-site **settings** editing (publishPath/routes/headers) + type recognition.

## Status (2026-07-12) — DONE

Implemented: `static_site` → "Static Site" type recognition (`service-type.ts`, badge, i18n en/zh); `ServiceView` publishPath/routes/headers + mapper (`status.ts`); the detail `server.graphql` selections + `static-site.graphql` mutations; `use-static-site.ts` hook; `static-site-section.tsx` (publishPath edit + routes/headers editors) wired into the Settings tab for static sites. **`yarn typecheck` clean; `yarn vitest` 138 pass.**

Codegen was the last blocker, resolved offline (no live API): dump the schema with `SCHEMA_DUMP_PATH=… go test ./internal/api -run TestDumpGraphQLSchema`, then `SCHEMA_JSON=… yarn codegen`. Doing so also required fixing two **pre-existing** codegen defects — a duplicate `Workspaces` operation (team + workspaces `.graphql`) and the dump test omitting the Deps-sourced `usage`/`audit` features. A full regen is still not reproducible upstream: commit `7504210` (a revert "to unblock the image build") left orphaned generated Documents (`Repos`/`GitConnection`/`CreateService`) whose source `.graphql` are gone. So the static-site documents were **spliced onto the committed `definitions.ts`** (keeping those orphans, which live upstream hooks still import) rather than full-regenerated. A clean full regen needs that upstream debt resolved.
