Follow-up from #29 (Tier 3 typed-client). #29 enum-typed the visibility/data_type/authority-kind fields on the admin object/field/authority View DTOs, but SearchHitView.visibility (crates/api/src/admin_search.rs) is still a plain String and so generates string in web/src/api/schema.d.ts rather than the Visibility union.
Effect: web/src/search/search-result-row.tsx passes hit.visibility (typed string) to <VisibilityBadge>, which is why that component's prop stayed visibility: string rather than tightening to the union.
Ask
Annotate SearchHitView.visibility with #[schema(value_type = domain::Visibility)] (the domain::Visibility schema is already registered in openapi.rs from #29; domain::ToSchema is in place per #3 Option A). The runtime field stays String (the search projection builds it from the indexed string) — only the schema description changes.
Optionally tighten VisibilityBadge's prop to the Visibility union now that every caller passes it.
Acceptance
SearchHitView.visibility is the Visibility union in schema.d.ts.
Web typecheck/tests stay green; no new casts.
Small, low-risk; the pattern is exactly the one applied in #29.
Follow-up from #29 (Tier 3 typed-client). #29 enum-typed the `visibility`/`data_type`/authority-`kind` fields on the admin object/field/authority View DTOs, but **`SearchHitView.visibility`** (`crates/api/src/admin_search.rs`) is still a plain `String` and so generates `string` in `web/src/api/schema.d.ts` rather than the `Visibility` union.
Effect: `web/src/search/search-result-row.tsx` passes `hit.visibility` (typed `string`) to `<VisibilityBadge>`, which is why that component's prop stayed `visibility: string` rather than tightening to the union.
## Ask
- Annotate `SearchHitView.visibility` with `#[schema(value_type = domain::Visibility)]` (the `domain::Visibility` schema is already registered in `openapi.rs` from #29; `domain::ToSchema` is in place per #3 Option A). The runtime field stays `String` (the search projection builds it from the indexed string) — only the schema description changes.
- Regenerate `web/src/api/schema.d.ts`; `SearchHitView.visibility` becomes the `"draft" | "internal" | "public"` union.
- Optionally tighten `VisibilityBadge`'s prop to the `Visibility` union now that every caller passes it.
## Acceptance
- `SearchHitView.visibility` is the `Visibility` union in `schema.d.ts`.
- Web typecheck/tests stay green; no new casts.
Small, low-risk; the pattern is exactly the one applied in #29.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Follow-up from #29 (Tier 3 typed-client). #29 enum-typed the
visibility/data_type/authority-kindfields on the admin object/field/authority View DTOs, butSearchHitView.visibility(crates/api/src/admin_search.rs) is still a plainStringand so generatesstringinweb/src/api/schema.d.tsrather than theVisibilityunion.Effect:
web/src/search/search-result-row.tsxpasseshit.visibility(typedstring) to<VisibilityBadge>, which is why that component's prop stayedvisibility: stringrather than tightening to the union.Ask
SearchHitView.visibilitywith#[schema(value_type = domain::Visibility)](thedomain::Visibilityschema is already registered inopenapi.rsfrom #29;domain::ToSchemais in place per #3 Option A). The runtime field staysString(the search projection builds it from the indexed string) — only the schema description changes.web/src/api/schema.d.ts;SearchHitView.visibilitybecomes the"draft" | "internal" | "public"union.VisibilityBadge's prop to theVisibilityunion now that every caller passes it.Acceptance
SearchHitView.visibilityis theVisibilityunion inschema.d.ts.Small, low-risk; the pattern is exactly the one applied in #29.