feat: 完善模板内容后台配置能力
This commit is contained in:
1 parent
2bc2193b44
commit
9266ec824a
37 files changed
+2273
-63
No files matched your search
@@ -0,0 +1,63 @@
|
||||
# Progress Log
|
||||
|
||||
## Session Start
|
||||
|
||||
- **Date**: 2026-09-28
|
||||
- **Task name**: `template-editability`
|
||||
- **Task dir**: `.codex-tasks/template-editability/`
|
||||
- **Spec**: `SPEC.md`
|
||||
- **Plan**: `TODO.csv` (5 milestones)
|
||||
- **Environment**: TypeScript / React / NestJS / Node test
|
||||
|
||||
## Context Recovery Block
|
||||
|
||||
- **Current milestone**: #5 — Run delivery checks and review diff
|
||||
- **Current status**: DONE
|
||||
- **Last completed**: #5 — Run delivery checks and review diff
|
||||
- **Current artifact**: `TODO.csv`
|
||||
- **Key context**: Acheng contains unsupported fixed food and response claims. Linjing consumes structured trust and profile configuration that normal administrators cannot edit; offering details also lack form controls.
|
||||
- **Known issues**: Published workspace reads release snapshots, so save and publish must be tested separately.
|
||||
- **Next action**: Ask the user to inspect editability and visual results in Admin and both compiled miniapp templates; this is acceptance, not an unimplemented code step.
|
||||
|
||||
## Milestone 2: Add manifest-driven structured editors
|
||||
|
||||
- **Status**: DONE
|
||||
- **What was done**: Added list field declarations and plain-language list controls for brand, trust, and offering content.
|
||||
- **Validation**: `pnpm --filter @personal-brand/admin typecheck` → exit 0.
|
||||
|
||||
## Milestone 3: Connect both template renderers and remove false claims
|
||||
|
||||
- **Status**: DONE
|
||||
- **What was done**: Added Linjing editing declarations and replaced Acheng unsupported business claims with editable content or omission.
|
||||
- **Validation**: `pnpm validate:templates` → exit 0.
|
||||
|
||||
## Milestone 4: Add regression coverage for edit and publish behavior
|
||||
|
||||
- **Status**: DONE
|
||||
- **What was done**: Added binding and manifest tests plus an API integration test that edits brand, trust, and offering fields and verifies snapshot publication.
|
||||
- **Validation**: `pnpm --filter @personal-brand/api test:integration` → 38 tests passed.
|
||||
|
||||
## Milestone 5: Run delivery checks and review diff
|
||||
|
||||
- **Status**: DONE
|
||||
- **What was done**: Reviewed field-to-editor mappings, scoped brand form fields to brand bindings, documented the structured editing rule in ADR 0016, and confirmed the running Admin and API respond.
|
||||
- **Validation**: `pnpm format:check`, `pnpm lint`, `pnpm typecheck`, `pnpm template:check`, `pnpm --filter @personal-brand/admin build`, `git diff --check` → exit 0.
|
||||
- **Known warning**: The Admin production bundle still reports a pre-existing >500 kB chunk warning. Owner: Admin frontend; follow-up: evaluate route-level/vendor chunk splitting separately from template content editing.
|
||||
|
||||
## Final Summary
|
||||
|
||||
- **Total milestones**: 5
|
||||
- **Completed**: 5
|
||||
- **Failed + recovered**: 1 compiler assertion updated for the generic startup title; 1 lint and 2 formatting issues fixed.
|
||||
- **External unblock events**: 0
|
||||
- **Total retries**: 3
|
||||
- **Key learnings**: A template-rendered field is not truly configurable until the ordinary Admin form can edit it and a release test proves the public snapshot changes only after publication.
|
||||
- **Recommendations for future tasks**: Require every new template to document its rendered business facts and matching editor bindings during template validation.
|
||||
|
||||
## Milestone 1: Audit source-to-editor coverage
|
||||
|
||||
- **Status**: DONE
|
||||
- **What was done**: Traced both template renderers to published workspace, admin forms, and template declarations.
|
||||
- **Key decisions**: Preserve the existing snapshot contract; use template-declared plain-language editing fields instead of exposing JSON.
|
||||
- **Validation**: `rg -n 'profilePresentation|trustPresentation|今日有售' packages apps` → exit 0.
|
||||
- **Next step**: Milestone 2 — Add manifest-driven structured editors.
|
||||
@@ -0,0 +1,47 @@
|
||||
# Task Specification
|
||||
|
||||
## Task Shape
|
||||
|
||||
- **Shape**: `single-full`
|
||||
|
||||
## Goals
|
||||
|
||||
- Make material business facts shown by the Linjing and Acheng miniapp templates editable by a brand administrator, or remove unsupported claims.
|
||||
- Preserve template-owned visual design while keeping content brand-scoped and release-snapshot based.
|
||||
|
||||
## Non-Goals
|
||||
|
||||
- Inventory, payment, or real-time opening-state management.
|
||||
- New database tables or template-specific fields in the shared brand model.
|
||||
|
||||
## Constraints
|
||||
|
||||
- Template manifests declare template-specific editable content.
|
||||
- Admin UI uses plain-language controls, never asks users to edit JSON.
|
||||
- Published miniapp content changes only after a new release.
|
||||
|
||||
## Environment
|
||||
|
||||
- **Project root**: `/home/que01/Project/persionalBrand`
|
||||
- **Language/runtime**: TypeScript, React, NestJS, WeChat miniapp JavaScript
|
||||
- **Package manager**: pnpm
|
||||
- **Test framework**: Node test, API integration tests
|
||||
- **Build command**: `pnpm build`
|
||||
|
||||
## Deliverables
|
||||
|
||||
- Template declarations and admin editing controls for material content.
|
||||
- Miniapp rendering without unsupported hard-coded factual claims.
|
||||
- Contract, runtime, and integration regression tests.
|
||||
|
||||
## Done-When
|
||||
|
||||
- [ ] Both templates expose all material displayed facts through admin content controls or omit them.
|
||||
- [ ] Published workspace consumes the edited snapshot and does not change before publication.
|
||||
- [ ] Relevant tests, type checks, template validation, formatting, and build pass.
|
||||
|
||||
## Final Validation Command
|
||||
|
||||
```bash
|
||||
pnpm format:check && pnpm lint && pnpm typecheck && pnpm template:check && pnpm --filter @personal-brand/admin build
|
||||
```
|
||||
@@ -0,0 +1,6 @@
|
||||
id,task,status,acceptance_criteria,validation_command,completed_at,retry_count,notes
|
||||
1,Audit source-to-editor coverage,DONE,Map material displayed fields and unsupported claims,rg -n 'profilePresentation|trustPresentation|今日有售' packages apps,2026-09-28,0,Acheng claims and Linjing structured content identified
|
||||
2,Add manifest-driven structured editors,DONE,Brand and trust lists editable without JSON,pnpm --filter @personal-brand/admin typecheck,2026-09-28,0,Typecheck passed after api-client build
|
||||
3,Connect both template renderers and remove false claims,DONE,Displayed facts come from published data or are omitted,pnpm validate:templates,2026-09-28,0,Template validation passed after catalog generation
|
||||
4,Add regression coverage for edit and publish behavior,DONE,Contract and integration tests pass,pnpm --filter @personal-brand/api test:integration,2026-09-28,0,38 API integration tests passed
|
||||
5,Run delivery checks and review diff,DONE,Checks pass and no unmapped material claims remain,pnpm format:check,2026-09-28,0,Format lint typecheck template checks admin build and diff check passed; manual miniapp visual acceptance pending user
|
||||
|
Reference in new issue
Block a user