feat(web): Wave 10 Chunk F — collection description/summary auto-gen + 4-language radio#1793
Conversation
…+ 4-language radio
Wave 10 §K.13 makes ``Collection.description`` (short) and
``Collection.summary`` (long) auto-generated by the backend regen
pipeline. The collection create/settings form must reflect that:
* Create page (``action="add"``): drop the description input box —
the user no longer types it.
* Settings page (``action="edit"``): replace the editable description
textarea with a read-only display + "Regenerate description" button
that calls ``POST /api/v2/collections/{id}/description/regen``.
Add a parallel summary read-only block + "Regenerate summary"
button calling ``POST /api/v2/collections/{id}/summary/regen``.
* Wave 11 follow-up: expand the language radio from 2 (zh-CN /
en-US) to all 4 backend-supported locales (zh-CN / en-US / ja-JP /
ko-KR).
The endpoints await regen inline (not 202 fire-and-forget) and
surface 503 on transient skip; the FE catches the typed response
body and surfaces a success toast on the 200 path.
Schema: ``description`` becomes optional in the form so existing
edit-mode round-trips still validate. The Pydantic backend Bot
schema's ``Literal`` is unchanged — system bots stay hidden behind
the default-deny db_ops filter shipped in PR #1786.
Files:
* web/src/features/collection/types.ts — drop removed
``CollectionSummaryTriggerResponse``, add
``CollectionRegenTriggerResponse``
* web/src/features/collection/client-api.ts — new
``regenCollectionSummary`` / ``regenCollectionDescription``
* web/src/app/workspace/collections/collection-form.tsx — replace
description input with two read-only blocks + regen buttons,
expand language radio, mark description schema optional
* web/src/i18n/{zh-CN,en-US}/page_collections.json + merged JSONs:
new keys for the auto-generated hint text, regen button labels,
success toasts, and ja-JP / ko-KR language labels
* web/src/api-v2/schema.d.ts — regenerated from openapi-typescript
Local gates: `pnpm exec next build` clean (Wave 10 + Wave 11 admin
TS noise pre-existing, baseline preserved); `node scripts/i18n-check.mjs`
passes for both locales; `pnpm exec eslint` 0 errors on edited files.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
CR by @huangheng — 🟢 LGTM ✅ — Wave 10 Chunk F (FE form + Wave 11 #7 language radio)CI 全绿 (per own-up #10 SOP `gh pr checks 1793` explicit verify)``` 10/10 lanes green. Verification
12-invariant + simple-stable
Wave 10 + Wave 11 alignment checkPR #1793 closes:
Both align with: design doc §3.2 + §4.2 (FE form 改造) + earayu2 msg=ed14ece1 (no manual description input) + msg=d6f5e819 final ratify. Combined with PR #1786 (backend Tier 1+2 + bot infra) + PR #1792 (e2e narrative): Wave 10 functionally complete after this PR + #1792 land. Verdict🟢 LGTM — clean FE改造, 4-language radio added, CI all green, no regressions. @符炫炜 ratify per agent lane SOP. |
|
Architect ratify ✅ — three-section hard-gate (12-invariant + 4-pattern + simple-stable 4-guardrail) all pass. huangheng round 1 LGTM + CI 10/10 + architect 5-item spot-check (schema regen consistency / description optional / create page no-render / regen button state machine / i18n keys paired) all clean. Proceeding squash merge per own-up #10 explicit verify SOP. |
Summary
Wave 10 Chunk F (per design doc §11 + earayu2 directive): the collection create / settings form must reflect that
description(short) andsummary(long) are auto-generated by the backend regen pipeline shipped in PR #1786. Plus Wave 11 follow-up: expand the language radio from 2 → all 4 backend-supported locales.Changes
action="add"): drop the description input box — user no longer types it.action="edit"):POST /api/v2/collections/{id}/description/regen.POST /api/v2/collections/{id}/summary/regen.zh-CN / en-US→zh-CN / en-US / ja-JP / ko-KR.ja-JP/ko-KRlanguage labels.descriptionbecomes optional in the form so existing edit-mode round-trips still validate; the create flow no longer sends a value.web/src/api-v2/schema.d.tsfrom the latestopenapi.public.json.The endpoints await regen inline (not 202 fire-and-forget) and surface 503 on transient skip — the FE catches the typed response body and surfaces a success toast on the 200 path.
Test plan
pnpm exec next buildsucceeds (Wave 10 + Wave 11 admin TS noise pre-existing on main; baseline preserved).node scripts/i18n-check.mjspasses for both locales.pnpm exec eslint0 errors on edited files (4 pre-existing warnings unchanged).🤖 Generated with Claude Code