Skip to content

feat(web): Wave 10 Chunk F — collection description/summary auto-gen + 4-language radio#1793

Merged
earayu merged 1 commit into
mainfrom
bryce/wave10-chunk-f-fe-form-changes
Apr 28, 2026
Merged

feat(web): Wave 10 Chunk F — collection description/summary auto-gen + 4-language radio#1793
earayu merged 1 commit into
mainfrom
bryce/wave10-chunk-f-fe-form-changes

Conversation

@earayu
Copy link
Copy Markdown
Collaborator

@earayu earayu commented Apr 28, 2026

Summary

Wave 10 Chunk F (per design doc §11 + earayu2 directive): the collection create / settings form must reflect that description (short) and summary (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

  • Create page (action="add"): drop the description input box — user no longer types it.
  • Settings page (action="edit"):
    • Replace editable description textarea with read-only display + "Regenerate description" button → POST /api/v2/collections/{id}/description/regen.
    • Add a parallel summary read-only block + "Regenerate summary" button → POST /api/v2/collections/{id}/summary/regen.
  • Language radio expand: zh-CN / en-USzh-CN / en-US / ja-JP / ko-KR.
  • i18n: new keys for hint text, regen labels, success toasts, and ja-JP / ko-KR language labels.
  • Schema: description becomes optional in the form so existing edit-mode round-trips still validate; the create flow no longer sends a value.
  • Regenerated web/src/api-v2/schema.d.ts from the latest openapi.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 build succeeds (Wave 10 + Wave 11 admin TS noise pre-existing on main; baseline preserved).
  • node scripts/i18n-check.mjs passes for both locales.
  • pnpm exec eslint 0 errors on edited files (4 pre-existing warnings unchanged).
  • CI: lint-and-unit + e2e-http-smoke + e2e-http-provider all green.
  • Manual browser verify: create page no description input / settings page read-only + regen buttons / 4-language radio.

🤖 Generated with Claude Code

…+ 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>
@earayu
Copy link
Copy Markdown
Collaborator Author

earayu commented Apr 28, 2026

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)

```
lint-and-unit pass 3m52s ← #1774 tsc gate green
e2e-http-compose / provider-preflight ×3 pass
e2e-http-compose / e2e-http-smoke ×3 pass
e2e-http-compose / e2e-http-provider ×3 pass
```

10/10 lanes green.

Verification

Check Result
`git diff origin/main..pr-1793 --stat` ✅ 8 files / +323/-61, scope clean (web only)
Create page: description input deleted ✅ `{action === 'edit' && (...)}` gates description blocks; create flow has none
Settings: description read-only + regen button ✅ `` renders read-only display + 「重新生成描述」button → calls `regenCollectionDescription(collection.id)`
Settings: summary read-only + regen button ✅ `` mirror pattern → calls `regenCollectionSummary(collection.id)`
4-language radio (Wave 11 #7) ✅ zh-CN / en-US / ja-JP / ko-KR all 4 `` rendered
i18n keys synced both locales ✅ `page_collections.json` zh-CN + en-US both have `language_ja_JP` / `language_ko_KR` / `description_auto_generated_` / `summary_auto_generated_` / `regen_pending` / `regen_button`
client-api 2 new functions ✅ `regenCollectionSummary` (line 79) + `regenCollectionDescription` (line 91)
Type alias: `CollectionRegenTriggerResponse` ✅ replaces removed `CollectionSummaryTriggerResponse`
schema.d.ts regen ✅ openapi-typescript output reflects backend Wave 10 endpoints

12-invariant + simple-stable

Wave 10 + Wave 11 alignment check

PR #1793 closes:

  • ✅ Wave 10 Chunk F (1+2+3 — design doc §11 implementation order)
  • ✅ Wave 11 feat: chat animate #7 (architect audit msg=84784b9b — 4-language radio expand)

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.

@earayu
Copy link
Copy Markdown
Collaborator Author

earayu commented Apr 28, 2026

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.

@earayu earayu merged commit d8bba0b into main Apr 28, 2026
10 checks passed
@earayu earayu deleted the bryce/wave10-chunk-f-fe-form-changes branch April 28, 2026 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant