feat(web): F1/F2/F3 前端——拆书入库为规则 / 续写式链选择 / 模板库
- gen:api 纳入 /templates、chain continue_volume、teardown rules ingest 端点 - F1:GeneratorRunner 识别拆书为单对象入库(整 preview 作一条 teardown), ingestTable(BookTeardownResult)=rules,buildIngestRequest 组装 teardown 体, 按 isSingleObjectIngest 隐藏勾选框、改文案「入库为规则」 - F2:ChainStarter 加链类型单选(draft_volume 从头写 / continue_volume 续写), chain_key 作 path 参传给 run(CHAIN_KINDS 对齐后端 SUPPORTED_CHAINS) - F3:模板库页 app/templates + 全局 nav 入口 + TemplatesManager(列/建/删,乐观更新回滚); GeneratorRunner 加 TemplateFiller「从模板填入」(body 填进 brief/text,纯前端) - vitest 覆盖 templates/ingest teardown/templateFillTarget/CHAIN_KINDS 纯逻辑
This commit is contained in:
@@ -4,6 +4,7 @@ import { emptyDecisions, setNote, setVerdict } from "@/lib/review/decisions";
|
||||
import type { JobView } from "@/lib/jobs/job";
|
||||
import {
|
||||
buildResumeRequest,
|
||||
CHAIN_KINDS,
|
||||
chainPhase,
|
||||
chainResultView,
|
||||
} from "./chain";
|
||||
@@ -110,3 +111,19 @@ describe("buildResumeRequest", () => {
|
||||
expect(buildResumeRequest([])).toEqual({ decisions: [] });
|
||||
});
|
||||
});
|
||||
|
||||
describe("CHAIN_KINDS", () => {
|
||||
it("exposes both built-in chain kinds aligned with backend SUPPORTED_CHAINS", () => {
|
||||
expect(CHAIN_KINDS.map((k) => k.key)).toEqual([
|
||||
"draft_volume",
|
||||
"continue_volume",
|
||||
]);
|
||||
});
|
||||
|
||||
it("gives each kind a non-empty label and description", () => {
|
||||
for (const kind of CHAIN_KINDS) {
|
||||
expect(kind.label.length).toBeGreaterThan(0);
|
||||
expect(kind.description.length).toBeGreaterThan(0);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user